gpu: accept partially resident depth flags

This commit is contained in:
Çağatay Güçlü 2026-10-04 23:25:41 +04:00 committed by nmzik
parent 94e7d239dd
commit a98a39c575
2 changed files with 13 additions and 2 deletions

View File

@ -160,8 +160,7 @@ static TextureCache::ImageDesc MakeDepthTargetDesc(const CommandBuffer& buffer,
z.depth_view.slice_max);
}
// EXPCLEAR permits an HTile acceleration state; the host attachment is already expanded.
if (z.z_info.partially_resident ||
z.stencil_info.partially_resident || z.z_info.max_mip_level != 0 ||
if (z.z_info.max_mip_level != 0 ||
z.depth_view.current_mip_level != 0 || unsupported_shading_rate_encoding ||
depth_address == 0 || (depth_address & 0xffffu) != 0) {
DepthFatal("unsupported depth register state");

View File

@ -12813,6 +12813,18 @@ public:
RenderDepthInfo phased_depth{};
RenderExecutorTestAccess::ResolveRenderDepthTarget(
executor, scheduler.Current(), phased_depth);
// PRT permits missing backing; a fully resident target keeps the same layout and image.
phased_depth_target.z_info.partially_resident = true;
phased_depth_target.stencil_info.partially_resident = true;
registers.SetDepthRenderTarget(phased_depth_target);
RenderDepthInfo resident_prt_depth{};
RenderExecutorTestAccess::ResolveRenderDepthTarget(
executor, scheduler.Current(), resident_prt_depth);
Require(name, "fully resident PRT depth identity",
resident_prt_depth.image_id == phased_depth.image_id &&
resident_prt_depth.desc.info.data == phased_depth.desc.info.data &&
resident_prt_depth.desc.info.stencil == phased_depth.desc.info.stencil,
"PRT permission changed a fully backed depth/stencil attachment");
auto non_texture_compatible_target = phased_depth_target;
non_texture_compatible_target.z_info.texture_compatibility =
Prospero::TextureCompatiblePlaneCompression::kDisable;