mirror of
https://github.com/KytyPS5/KytyPS5.git
synced 2026-10-20 02:47:02 +02:00
revert HTile lifetime changes and opt-in ZMask support
This commit is contained in:
+3
-8
@@ -263,6 +263,9 @@ void TextureCache::DeleteImage(ImageId id) {
|
||||
EXIT("TextureCache: deleting a GPU-modified image without resolving its contents\n");
|
||||
}
|
||||
m_download_images.erase(id);
|
||||
if (image->info.metadata.kind == ImageMetadataKind::Htile) {
|
||||
m_surface_metas.erase(image->info.metadata.range.address);
|
||||
}
|
||||
UnregisterImage(id);
|
||||
if (m_scheduler.Active()) {
|
||||
m_scheduler.DeferOperation([this, id] { m_slot_images.erase(id); });
|
||||
@@ -716,13 +719,6 @@ ImageId TextureCache::ResolveDepthOverlap(const ImageInfo& requested, BindingTyp
|
||||
"TextureCache: unsupported unequal-sample depth overlap copy (%u -> %u)\n",
|
||||
cached.backing.samples, replacement.backing.samples);
|
||||
}
|
||||
if (info.IsDepth() && info.metadata.kind == ImageMetadataKind::Htile) {
|
||||
// Copied depth supersedes pending clears from the previous native image.
|
||||
const auto metadata = m_surface_metas.find(info.metadata.range.address);
|
||||
if (metadata != m_surface_metas.end()) {
|
||||
metadata->second.clear_mask.reset();
|
||||
}
|
||||
}
|
||||
FreeImage(cached_id);
|
||||
return replacement_id;
|
||||
}
|
||||
@@ -1880,7 +1876,6 @@ void TextureCache::UnmapMemory(uint64_t address, uint64_t size) {
|
||||
EXIT("TextureCache: invalid unmap range\n");
|
||||
}
|
||||
std::scoped_lock lock {m_lock};
|
||||
// HTILE belongs to guest memory, independently of native image replacements.
|
||||
for (auto metadata = m_surface_metas.begin(); metadata != m_surface_metas.end();) {
|
||||
const auto base = metadata->first;
|
||||
if (base >= address && base < address + size) {
|
||||
|
||||
@@ -126,13 +126,9 @@ NativeStorageBuffer(RenderContext& context, const PreparedBindings::BufferSource
|
||||
if (size > graphics.GetPhysicalDeviceProperties().limits.maxStorageBufferRange) {
|
||||
EXIT("storage buffer range is unsupported\n");
|
||||
}
|
||||
const bool metadata_read = resource.read && Config::SupportZmaskEnabled() &&
|
||||
(address & 0x7fffu) == 0 &&
|
||||
context.GetTextureCache().IsMeta(address);
|
||||
auto [buffer, offset] = context.GetBufferCache().ObtainBuffer(
|
||||
address, size, resource.written || metadata_read,
|
||||
auto [buffer, offset] = context.GetBufferCache().ObtainBuffer(
|
||||
address, size, resource.written,
|
||||
resource.formatted || (resource.read && Config::SyncRawImageBuffersEnabled()), id);
|
||||
if (metadata_read) buffer->Fill(offset, size, 0xf); // HTILE ZMask::kUncompressed.
|
||||
const auto aligned_offset = Common::AlignDown(offset, alignment);
|
||||
const auto adjustment = offset - aligned_offset;
|
||||
const auto max_range = graphics.GetPhysicalDeviceProperties().limits.maxStorageBufferRange;
|
||||
|
||||
Reference in New Issue
Block a user