mirror of
https://github.com/KytyPS5/KytyPS5.git
synced 2026-10-29 08:41:20 +00:00
Fix GPU memory protection and depth target invalidation
This commit is contained in:
1 parent
75d20486ba
commit
5ed447818f
2 files changed
+6
-5
No files matched your search
@@ -3051,8 +3051,11 @@ void TextureCache::PrepareHostWrite(uint64_t vaddr, uint64_t size) {
|
|||||||
bool found = false;
|
bool found = false;
|
||||||
for (const auto& cached: m_images) {
|
for (const auto& cached: m_images) {
|
||||||
for (uint32_t range = 0; range < cached->RangeCount(); range++) {
|
for (uint32_t range = 0; range < cached->RangeCount(); range++) {
|
||||||
|
// CPU-current depth targets use the same tracked guest refresh path as sampled and
|
||||||
|
// color images. GPU-owned targets and metadata aliases remain unsupported below.
|
||||||
const bool host_refreshable = (cached->kind == CachedImage::Kind::Texture ||
|
const bool host_refreshable = (cached->kind == CachedImage::Kind::Texture ||
|
||||||
cached->kind == CachedImage::Kind::RenderTarget) &&
|
cached->kind == CachedImage::Kind::RenderTarget ||
|
||||||
|
cached->kind == CachedImage::Kind::DepthTarget) &&
|
||||||
!cached->buffer_modified;
|
!cached->buffer_modified;
|
||||||
switch (ClassifyHostWriteOverlap(vaddr, size, cached->Address(range),
|
switch (ClassifyHostWriteOverlap(vaddr, size, cached->Address(range),
|
||||||
cached->Size(range), host_refreshable,
|
cached->Size(range), host_refreshable,
|
||||||
|
|||||||
@@ -3455,10 +3455,8 @@ int KYTY_SYSV_ABI KernelMprotect(const void* addr, size_t len, int prot) {
|
|||||||
if (old_gpu_mode == GpuAccessMode::NoAccess) {
|
if (old_gpu_mode == GpuAccessMode::NoAccess) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if ((old_range.type != VirtualRangeType::Stack &&
|
if (!GetGpuResources().IsMapped(old_range.start, old_range.size)) {
|
||||||
old_range.type != VirtualRangeType::Code) ||
|
EXIT("GPU protection transition requires tracked memory: addr=0x%016" PRIx64
|
||||||
!GetGpuResources().IsMapped(old_range.start, old_range.size)) {
|
|
||||||
EXIT("GPU protection transition requires tracked stack/code memory: addr=0x%016" PRIx64
|
|
||||||
" size=0x%016" PRIx64 " type=%s\n",
|
" size=0x%016" PRIx64 " type=%s\n",
|
||||||
old_range.start, old_range.size, Common::EnumName(old_range.type).c_str());
|
old_range.start, old_range.size, Common::EnumName(old_range.type).c_str());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user