diff --git a/src/graphics/host_gpu/renderer/depthRenderTarget.cpp b/src/graphics/host_gpu/renderer/depthRenderTarget.cpp index 507da9bb..c7f883ae 100644 --- a/src/graphics/host_gpu/renderer/depthRenderTarget.cpp +++ b/src/graphics/host_gpu/renderer/depthRenderTarget.cpp @@ -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"); diff --git a/tests/ShaderRecompilerComputeTests.cpp b/tests/ShaderRecompilerComputeTests.cpp index ec6c4355..10dfc705 100644 --- a/tests/ShaderRecompilerComputeTests.cpp +++ b/tests/ShaderRecompilerComputeTests.cpp @@ -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;