mirror of
https://github.com/KytyPS5/KytyPS5.git
synced 2026-08-03 11:23:49 +00:00
Fix GPU memory protection and depth target invalidation
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user