Fix GPU memory protection and depth target invalidation

This commit is contained in:
nmzik
2026-07-17 18:26:10 +02:00
parent 75d20486ba
commit 5ed447818f
2 changed files with 6 additions and 5 deletions
@@ -3051,8 +3051,11 @@ void TextureCache::PrepareHostWrite(uint64_t vaddr, uint64_t size) {
bool found = false;
for (const auto& cached: m_images) {
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 ||
cached->kind == CachedImage::Kind::RenderTarget) &&
cached->kind == CachedImage::Kind::RenderTarget ||
cached->kind == CachedImage::Kind::DepthTarget) &&
!cached->buffer_modified;
switch (ClassifyHostWriteOverlap(vaddr, size, cached->Address(range),
cached->Size(range), host_refreshable,
+2 -4
View File
@@ -3455,10 +3455,8 @@ int KYTY_SYSV_ABI KernelMprotect(const void* addr, size_t len, int prot) {
if (old_gpu_mode == GpuAccessMode::NoAccess) {
continue;
}
if ((old_range.type != VirtualRangeType::Stack &&
old_range.type != VirtualRangeType::Code) ||
!GetGpuResources().IsMapped(old_range.start, old_range.size)) {
EXIT("GPU protection transition requires tracked stack/code memory: addr=0x%016" PRIx64
if (!GetGpuResources().IsMapped(old_range.start, old_range.size)) {
EXIT("GPU protection transition requires tracked memory: addr=0x%016" PRIx64
" size=0x%016" PRIx64 " type=%s\n",
old_range.start, old_range.size, Common::EnumName(old_range.type).c_str());
}