graphics: preserve raw D16 uint texture reads

This commit is contained in:
nmzik
2026-08-20 08:12:16 +02:00
parent 6f9ed6ffe5
commit 22bdafecbb
2 changed files with 51 additions and 1 deletions
+15 -1
View File
@@ -683,9 +683,23 @@ ImageId TextureCache::ResolveDepthOverlap(const ImageInfo& requested, BindingTyp
}
const bool stencil_match = requested.HasStencil() == cached.info.HasStencil();
const bool bpp_match = requested.bytes_per_block == cached.info.bytes_per_block;
// PPSA04264
const bool raw_d16_texture =
binding == BindingType::Texture && cached.info.IsDepth() &&
cached.info.guest_format == Prospero::BufferFormat::k16UNorm &&
requested.guest_format == Prospero::BufferFormat::k16UInt &&
requested.pixel_format == vk::Format::eR16Uint && cached.backing.samples == 1 &&
requested.samples == 1 && requested.data == cached.info.data &&
requested.extent == cached.info.extent && requested.resources == cached.info.resources &&
requested.type == cached.info.type && requested.pitch == cached.info.pitch &&
requested.tile_mode == cached.info.tile_mode && !requested.HasStencil() &&
!cached.info.HasStencil() && !requested.HasMetadata() && !cached.info.HasMetadata();
bool recreate = cached.info.resources < requested.resources;
switch (binding) {
case BindingType::Texture: recreate |= requested.IsDepth() && !cached.info.IsDepth(); break;
case BindingType::Texture:
recreate |= requested.IsDepth() && !cached.info.IsDepth();
recreate |= raw_d16_texture;
break;
case BindingType::Storage: recreate |= cached.info.IsDepth(); break;
case BindingType::RenderTarget: recreate |= cached.info.IsDepth(); break;
case BindingType::DepthTarget: