diff --git a/core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp b/core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp index 6b7e1ea89612..c61f52ef369f 100644 --- a/core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp +++ b/core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp @@ -101,6 +101,8 @@ std::atomic& anyDepthGuard() { struct DepthSamplingState { std::vector initial; + std::optional initialDepth; + std::optional initialStencil; std::string refusal; std::optional aliasStencil; std::optional unprovenStencil; @@ -153,6 +155,68 @@ std::uint64_t fillNoteAfter(const Recorder& recorder, const GuestMemory::Unchang return found; } +bool uniformPlaneTarget(const DepthTarget& target) { + return target.format == VK_FORMAT_D32_SFLOAT_S8_UINT && target.stencilAddress != 0u && target.htileAddress == 0u; +} + +template +std::optional uniformPlaneValue(std::uint64_t address, std::size_t bytes) { + std::array chunk{}; + std::optional value; + for (std::size_t offset = 0u; offset < bytes;) { + const auto count = std::min(chunk.size(), (bytes - offset) / sizeof(Element)); + const auto elements = std::span(chunk).first(count); + GuestMemory::Read(address + offset, std::as_writable_bytes(elements)); + if (!value) value = elements.front(); + if (std::ranges::any_of(elements, [&](Element element) { return element != *value; })) return std::nullopt; + offset += count * sizeof(Element); + } + return value; +} + +DepthSamplingState prepareUniformPlaneSampling(const Context& context, const DepthTarget& target, DepthSamplingState state) { + const auto refuse = [&](const char* reason) { + state.refusal = reason; + return state; + }; + if (target.depthSwizzle != 24u || target.firstSlice != 0u || target.lastSlice != 0u) return refuse("native multisample depth arrays or non-Z_X layout are not implemented"); + if ((target.pipeBankXor & ~0xcf00u) != 0u) return refuse("unsupported native multisample depth XOR"); + if (target.address == 0u || (target.address & 65535u) != 0u || (target.stencilAddress & 65535u) != 0u) return refuse("native multisample depth base is not aligned"); + if (target.htileStencil) return refuse("native multisample stencil import is not implemented"); + state.initial = {{target.address, static_cast(MultisampledDepthBytes_nid_no_patch(target.extent, 4u, target.samples)), 0u}, {target.stencilAddress, static_cast(MultisampledDepthBytes_nid_no_patch(target.extent, 1u, target.samples)), 0u}}; + for (const auto& range : state.initial) { + if (range.address > std::numeric_limits::max() - range.bytes) return refuse("native depth import range overflows"); + if (!GuestMemory::Accessible(reinterpret_cast(range.address), range.bytes) || !GuestMemory::Watched(range.address, range.bytes)) return refuse("native multisample depth import requires watched accessible guest memory"); + } + const auto& depth = state.initial[0]; + const auto& stencil = state.initial[1]; + if (depth.address + depth.bytes > stencil.address && stencil.address + stencil.bytes > depth.address) return refuse("native depth and stencil initial ranges overlap"); + for (std::size_t index = 0u; index < state.initial.size(); ++index) { + const auto alias = MultisampleColorTargetOver(state.initial[index].address, state.initial[index].bytes); + if (!alias) continue; + reportAlias(*alias, state.initial[index], index == 1u ? "stencil plane" : "depth"); + return refuse(index == 1u ? stencilAliasRefusal : depthAliasRefusal); + } + for (auto& range : state.initial) { + if (auto* recorder = RecorderFor(context)) recorder->SyncThrough(range.address, range.bytes); + StorageTexture::FlushPending(range.address, range.bytes); + GuestMemory::FlushGpuWrites(range.address, range.bytes); + if (!GuestMemory::Accessible(reinterpret_cast(range.address), range.bytes) || !GuestMemory::Watched(range.address, range.bytes)) return refuse("native multisample depth import requires watched accessible guest memory"); + range.generation = GuestMemory::CollectWritesUncached(range.address, range.bytes); + if (range.generation == 0u) return refuse("native multisample depth import requires tracked generations"); + } + const auto depthWord = uniformPlaneValue(depth.address, depth.bytes); + const auto depthValue = depthWord ? std::bit_cast(*depthWord) : 0.0f; + if (!depthWord || !(depthValue >= 0.0f && depthValue <= 1.0f)) return refuse("native multisample depth plane without HTILE does not hold one depth value in [0, 1]"); + const auto stencilByte = uniformPlaneValue(stencil.address, stencil.bytes); + if (!stencilByte) return refuse("native multisample stencil plane without HTILE does not hold one stencil value"); + for (const auto& range : state.initial) GuestMemory::CollectWritesUncached(range.address, range.bytes); + if (!GuestMemory::UnchangedSinceAll(state.initial)) return refuse("guest writes raced native multisample depth import"); + state.initialDepth = depthValue; + state.initialStencil = *stencilByte; + return state; +} + DepthSamplingState prepareDepthSampling(const Context& context, const DepthTarget& target) { DepthSamplingState state; const auto refuse = [&](const char* reason) { @@ -160,6 +224,7 @@ DepthSamplingState prepareDepthSampling(const Context& context, const DepthTarge return state; }; if (target.samples != 2u && target.samples != 4u && target.samples != 8u) return refuse("unsupported native depth sample count"); + if (uniformPlaneTarget(target)) return prepareUniformPlaneSampling(context, target, std::move(state)); const bool stencil = target.format == VK_FORMAT_D32_SFLOAT_S8_UINT; const bool stencilPlane = stencil && !target.htileStencil && target.htileDepthOnly; if (target.format != VK_FORMAT_D16_UNORM && target.format != VK_FORMAT_D32_SFLOAT && !stencil) return refuse("native multisample stencil or depth format import is not implemented"); @@ -411,7 +476,7 @@ class DepthSurface { toGeneral.subresourceRange = viewInfo.subresourceRange; const auto barrier = context.Resolved(&DeviceFunctions::cmdPipelineBarrier, "vkCmdPipelineBarrier"); barrier(commands, VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT, 0, 0, nullptr, 0, nullptr, 1, &toGeneral); - const VkClearDepthStencilValue clear{target.clearDepth, this->sampling.aliasStencil.value_or(target.clearStencil)}; + const VkClearDepthStencilValue clear{this->sampling.initialDepth.value_or(target.clearDepth), this->sampling.initialStencil.value_or(this->sampling.aliasStencil.value_or(target.clearStencil))}; context.Function("vkCmdClearDepthStencilImage")(commands, image, VK_IMAGE_LAYOUT_GENERAL, &clear, 1, &toGeneral.subresourceRange); RecordMemoryBarrier(context, commands, VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT | VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT, VK_ACCESS_TRANSFER_WRITE_BIT, VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT | VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT); if (batch) batch->SubmitAndWait(); @@ -450,8 +515,9 @@ class DepthSurface { if (!alias || (index == 2u && sampling.unprovenStencil && stencilClearGeneration == 0u)) continue; const auto value = index == 2u && separatePlane ? aliasedStencil(*alias, range, target.samples) : std::nullopt; const bool kept = value.has_value() && (stencilClearGeneration != 0u ? *value == *stencilClearValue : value == sampling.aliasStencil); - if (!kept) reportAlias(*alias, range, index == 2u ? "stencil plane" : index == 1u ? "HTILE" : "depth"); - Require(kept, index == 2u ? stencilAliasRefusal : depthAliasRefusal); + const bool stencilRange = index == 2u || (index == 1u && uniformPlaneTarget(target)); + if (!kept) reportAlias(*alias, range, stencilRange ? "stencil plane" : index == 1u ? "HTILE" : "depth"); + Require(kept, stencilRange ? stencilAliasRefusal : depthAliasRefusal); planeAliased = true; } if (stencilClearGeneration != 0u) { @@ -508,6 +574,10 @@ class DepthSurface { const bool identity = stencil ? resource.format == 5u : resource.baseAddress == target.address && resource.format == (target.format == VK_FORMAT_D16_UNORM ? 7u : 22u); Require(identity && resource.width == target.extent.width && resource.height == target.extent.height && resource.samples == target.samples, "native multisample depth sampled identity or format mismatch"); Require(resource.dimension == TextureDimension::k2DMsaa && resource.tileMode == TextureTileMode::kZ64KBX && resource.depthOrLastArray == 0u && resource.baseArray == 0u && resource.baseLevel == 0u && resource.lastLevel == 0u && resource.mipCount == 1u && resource.allocatedMipCount == 1u && resource.minLod == 0u, "native multisample depth sampled array, mip or layout is not implemented"); + if (uniformPlaneTarget(target)) { + Require(resource.pipeBankXor == target.pipeBankXor && resource.dccAddress == 0u && !resource.dccAlphaOnMsb, "native multisample depth sampled metadata or XOR mismatch"); + return; + } const bool htile = resource.dccAddress == target.htileAddress && resource.dccPipeAligned == target.htilePipeAligned; const bool bare = resource.dccAddress == 0u && !resource.dccPipeAligned; if (stencil) { diff --git a/core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_native_multisample_depth_tests.cmake b/core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_native_multisample_depth_tests.cmake index aa54fc51961d..2e8dd6462983 100644 --- a/core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_native_multisample_depth_tests.cmake +++ b/core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_native_multisample_depth_tests.cmake @@ -12,10 +12,11 @@ if(BUILD_TESTING) add_test(NAME agc_driver_native_depth_expand_gate COMMAND agc_driver_native_multisample_depth_tests --expand-gate) add_test(NAME agc_driver_native_depth_stencil_view COMMAND agc_driver_native_multisample_depth_tests --stencil-view) add_test(NAME agc_driver_native_depth_buffer_clear COMMAND agc_driver_native_multisample_depth_tests --buffer-clear) - set_tests_properties(agc_driver_native_depth_clears agc_driver_native_depth_clear_refusals agc_driver_native_depth_stencil agc_driver_native_depth_separate_stencil agc_driver_native_depth_aliased_stencil agc_driver_native_depth_expand_gate agc_driver_native_depth_stencil_view agc_driver_native_depth_buffer_clear PROPERTIES TIMEOUT 30 ENVIRONMENT "ANYPS5_NO_SHADER_CACHE=1" SKIP_RETURN_CODE 77 WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}") + add_test(NAME agc_driver_native_depth_uniform_planes COMMAND agc_driver_native_multisample_depth_tests --uniform-planes) + set_tests_properties(agc_driver_native_depth_clears agc_driver_native_depth_clear_refusals agc_driver_native_depth_stencil agc_driver_native_depth_separate_stencil agc_driver_native_depth_aliased_stencil agc_driver_native_depth_expand_gate agc_driver_native_depth_stencil_view agc_driver_native_depth_buffer_clear agc_driver_native_depth_uniform_planes PROPERTIES TIMEOUT 30 ENVIRONMENT "ANYPS5_NO_SHADER_CACHE=1" SKIP_RETURN_CODE 77 WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}") if(WIN32) set_tests_properties(agc_driver_native_depth_retirement PROPERTIES ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:$") - set_tests_properties(agc_driver_native_depth_clears agc_driver_native_depth_clear_refusals agc_driver_native_depth_stencil agc_driver_native_depth_separate_stencil agc_driver_native_depth_aliased_stencil agc_driver_native_depth_expand_gate agc_driver_native_depth_stencil_view agc_driver_native_depth_buffer_clear PROPERTIES ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:$") + set_tests_properties(agc_driver_native_depth_clears agc_driver_native_depth_clear_refusals agc_driver_native_depth_stencil agc_driver_native_depth_separate_stencil agc_driver_native_depth_aliased_stencil agc_driver_native_depth_expand_gate agc_driver_native_depth_stencil_view agc_driver_native_depth_buffer_clear agc_driver_native_depth_uniform_planes PROPERTIES ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:$") endif() add_test(NAME agc_driver_native_depth_driver_path COMMAND agc_driver_native_multisample_depth_tests --driver-path) add_test(NAME agc_driver_native_depth_driver_queued_fill COMMAND agc_driver_native_multisample_depth_tests --driver-queued-fill) diff --git a/core/libs/prx/libSceAgcDriver/tests/execution/NativeMultisampleDepth.cpp b/core/libs/prx/libSceAgcDriver/tests/execution/NativeMultisampleDepth.cpp index 78abde3e2c6a..e4e59c4c0db2 100644 --- a/core/libs/prx/libSceAgcDriver/tests/execution/NativeMultisampleDepth.cpp +++ b/core/libs/prx/libSceAgcDriver/tests/execution/NativeMultisampleDepth.cpp @@ -2572,6 +2572,97 @@ int CheckDriverPath(bool queued) { } +void CheckUniformPlanesWithoutHtile(Context context, std::uint32_t samples) { + constexpr VkExtent2D extent{129u, 67u}; + const auto depthBytes = static_cast(MultisampledDepthBytes_nid_no_patch(extent, 4u, samples)); + const auto stencilBytes = static_cast(MultisampledDepthBytes_nid_no_patch(extent, 1u, samples)); + TargetMemory memory(depthBytes), stencil(stencilBytes); + const auto fill = [&](float depth, std::uint8_t value) { + const auto word = std::bit_cast(depth); + for (std::size_t offset = 0u; offset < depthBytes; offset += 4u) std::memcpy(memory.Data() + offset, &word, 4u); + std::memset(stencil.Data(), value, stencilBytes); + }; + DepthTarget target{memory.Address(), stencil.Address(), extent, VK_FORMAT_D32_SFLOAT_S8_UINT, 1.0f, 0u, 0u, false, samples}; + target.depthSwizzle = 24u; + Recorder recorder(context); + recorder.Activate(); + auto words = DepthSampleWords(target); + words[6] &= ~((1u << 19u) | (1u << 21u)); + auto stencilTarget = target; + stencilTarget.address = target.stencilAddress; + auto stencilWords = DepthSampleWords(stencilTarget); + stencilWords[1] = (stencilWords[1] & ~(0x1ffu << 20u)) | (5u << 20u); + stencilWords[6] &= ~((1u << 19u) | (1u << 21u)); + const auto lookup = [&] { return DepthSurfaceTexture(context, words, DecodeTextureResource(words), VkComponentMapping{}); }; + const auto clear = [&] { + recorder.Sync(); + ClearCachedTextures(context.device); + ClearDepthSurfaces(context.device); + }; + struct Cleanup { + decltype(clear)& action; + ~Cleanup() { action(); } + } cleanup{clear}; + for (std::uint32_t field = 0u; field < 5u; ++field) { + fill(0.25f, 0x5au); + auto invalid = target; + std::string_view reason; + switch (field) { + case 0u: memory.Data()[depthBytes - 1u] = std::byte{0x3f}; reason = "does not hold one depth value"; break; + case 1u: fill(2.0f, 0x5au); reason = "does not hold one depth value"; break; + case 2u: stencil.Data()[stencilBytes - 1u] = std::byte{0x5b}; reason = "does not hold one stencil value"; break; + case 3u: invalid.htileStencil = true; reason = "stencil import"; break; + case 4u: invalid.stencilAddress = memory.Address() + 65536u; reason = "overlap"; break; + } + Require(DepthSurfaceView(context, invalid) != VK_NULL_HANDLE, "a refused uniform-plane import must preserve attachment rendering"); + TargetRefuses([&] { DepthSurfaceTexture(context, words, DecodeTextureResource(words), VkComponentMapping{}); }, reason); + clear(); + } + for (const auto& [depth, value] : std::array{std::pair{0.0f, std::uint8_t{0xc3u}}, std::pair{0.25f, std::uint8_t{0x5au}}}) { + fill(depth, value); + Require(DepthSurfaceView(context, target) != VK_NULL_HANDLE, "a uniform-plane D32S8 target without HTILE has no attachment view"); + auto texture = lookup(); + Require(texture != nullptr && texture->View() != VK_NULL_HANDLE, "a uniform-plane D32S8 target without HTILE was not sampled natively"); + Buffer output(context, (extent.width * extent.height * samples + 2u) * 16u, VK_BUFFER_USAGE_STORAGE_BUFFER_BIT); + std::memset(output.Bytes().data(), 0xa5, output.Bytes().size()); + { + const Fetch fetch(context, *texture, output, FetchShader(extent.width, extent.height, samples, false, true)); + CommandBatch batch(context); + fetch.Run(batch.Handle(), extent.width * extent.height * samples); + RecordMemoryBarrier(context, batch.Handle(), VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, VK_PIPELINE_STAGE_HOST_BIT, VK_ACCESS_SHADER_WRITE_BIT, VK_ACCESS_HOST_READ_BIT); + batch.SubmitAndWait(); + output.Invalidate(); + for (std::uint32_t i = 0u; i < extent.width * extent.height * samples; ++i) { + std::array sampled{}; + std::memcpy(sampled.data(), output.Bytes().data() + (i + 1u) * 16u, 16u); + Require(sampled == std::array{depth, 0.0f, 0.0f, 1.0f}, "a uniform depth plane without HTILE was not imported into every sample"); + } + } + auto stencilTexture = DepthSurfaceTexture(context, stencilWords, DecodeTextureResource(stencilWords), VkComponentMapping{}); + Require(stencilTexture != nullptr && stencilTexture->View() != VK_NULL_HANDLE, "the stencil plane of a uniform-plane D32S8 target without HTILE was not sampled natively"); + { + std::memset(output.Bytes().data(), 0xa5, output.Bytes().size()); + const Fetch fetch(context, *stencilTexture, output, FetchShader(extent.width, extent.height, samples, false, false)); + CommandBatch batch(context); + fetch.Run(batch.Handle(), extent.width * extent.height * samples); + RecordMemoryBarrier(context, batch.Handle(), VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, VK_PIPELINE_STAGE_HOST_BIT, VK_ACCESS_SHADER_WRITE_BIT, VK_ACCESS_HOST_READ_BIT); + batch.SubmitAndWait(); + output.Invalidate(); + for (std::uint32_t i = 0u; i < extent.width * extent.height * samples; ++i) { + std::array sampled{}; + std::memcpy(sampled.data(), output.Bytes().data() + (i + 1u) * 16u, 16u); + Require(sampled[0] == value, "a uniform stencil plane without HTILE was not imported into every sample: sample " + std::to_string(i) + " holds " + std::to_string(sampled[0]) + ", the plane " + std::to_string(value)); + } + } + stencilTexture.reset(); + texture.reset(); + stencil.Data()[0] = std::byte{static_cast(value + 1u)}; + TargetRefuses([&] { lookup(); }, "guest writes"); + clear(); + } + std::printf("Native D32S8 without HTILE, samples=%u: uniform planes imported and sampled, other planes refused\n", samples); +} + int main(int argc, char** argv) { try { #ifdef __linux__ @@ -2616,6 +2707,16 @@ int main(int argc, char** argv) { } return 0; } + if (argc == 2 && std::string_view(argv[1]) == "--uniform-planes") { + std::uint32_t checked = 0u, unavailable = 0u; + for (const auto samples : {2u, 4u, 8u}) { + if (!DepthSupported(context, HostDepthFormat(context, VK_FORMAT_D32_SFLOAT_S8_UINT), samples)) { ++unavailable; continue; } + CheckUniformPlanesWithoutHtile(context, samples); + ++checked; + } + std::printf("Native depth uniform-plane cases checked=%u unavailable=%u\n", checked, unavailable); + return checked != 0u ? 0 : VulkanTestSkipped; + } if (argc == 2 && std::string_view(argv[1]) == "--clears") { CheckClearDispatch(); std::uint32_t checked = 0u, unavailable = 0u; diff --git a/docs/dev/debt/libSceAgcDriver.md b/docs/dev/debt/libSceAgcDriver.md index 8c3bbd89c215..ed4f3e228261 100644 --- a/docs/dev/debt/libSceAgcDriver.md +++ b/docs/dev/debt/libSceAgcDriver.md @@ -64,6 +64,7 @@ - [Native depth allocation retirement](../../../core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp) covers sampling-eligible multisampled owners only. Successful release notifications must cumulatively cover both complete depth and HTILE ranges; protection changes, failed releases and partial coverage keep the original guards. Retired owners leave lookup and metadata routing, while held views and recorded work retain their images. Retirement of single-sample or sampling-ineligible depth attachments and console equivalence remain unimplemented or unmeasured. The regression uses real allocation-registry operations with a no-op host-release callback, so it does not validate the host unmap backend. - [Native MSAA depth attachment feedback](../../../core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp) is not implemented. A draw sampling a native multisampled depth view while attaching its source image throws before pipeline creation or render-pass recording, including read-only attachment feedback. Sampling that image in a separate draw or dispatch remains supported. The refusal compares the held native image views and their device and attachment identity; single-sample depth behavior is retained. - [Native multisampled depth sampling](../../../core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp) accepts numeric D16 or D32, and D32 with an 8-bit stencil plane whose state is in HTILE or, with a depth-only HTILE, in the plane, two/four/eight samples, one Z_X slice and mip, and pipe-aligned HTILE, or a depth-only HTILE that is not pipe-aligned whose words are all one clear word, without VRS, with ITERATE_256 on or off: the initial import reads no compressed Z planes, and Mesa's HTILE clear words (`radv_get_htile_fast_clear_value`) and Addrlib's HTILE footprint do not depend on ITERATE_256, which `ac_descriptors.c` ties to TC reads of compressed MSAA HTILE. Sampling eligibility is recorded before the attachment's first host clear: every HTILE word must prove the same initial clear of zero or one and, with the stencil in HTILE, SMem 0 (the stencil holds `DB_STENCIL_CLEAR`), or with a depth-only HTILE every stencil plane byte must equal it; and the complete sample-aware depth, stencil and HTILE ranges must be accessible and write-watched. Unsupported initial state or device sampling support retains attachment rendering but sampling throws; eligibility is never retried. Sampling rejects later guest writes, queued external GPU writes and unproven HTILE clear/fill transitions. A fill of the whole HTILE, or a one-byte fill of the whole stencil plane (a stencil clear), is proven at the next sample like an HTILE mask clear: complete tracked stores since the fill, or a fill still queued that is the one write recorded over the range since it was noted (a fill noted again once that write is recorded counts once), and every word proving the depth and, with the stencil in HTILE, the stencil clear, or every plane byte the fill byte; partial fills, an HTILE mask clear of a target with stencil, and an HTILE fill noted while an HTILE mask clear dispatch is pending (from its notification until a sample takes it) are refused. A queued fill of more than 64 KiB is stored through a host import, so where host imports are compared rather than write-watched (always on Windows, and on Linux where the import probe finds that imports resolve write protection) its HTILE is no longer write-watched after the store and the fill is refused. A stencil plane whose exact footprint a resident multisampled R8 colour target of the same sample count covers takes its value from that target's newest uniform content (a fill it absorbed, a CMASK fast clear, or a recorded clear with no draw since), and a plane fill is proven the same way, without reading guest memory; any colour target over the depth or HTILE, or a colour draw over a plane taken this way, refuses sampling, and other colour content over the plane leaves it unproven as listed below. A descriptor without metadata whose XOR and ITERATE_256 match is sampled from the decompressed host image only after an observed in-place expand, a draw over the target with `DB_RENDER_CONTROL.DEPTH_COMPRESS_DISABLE` and, with a stencil plane, `STENCIL_COMPRESS_DISABLE`, and until an HTILE clear or fill, a plane fill or a clear draw; a later depth write that recompresses tiles is not observed. Other metadata is refused. A guest read over the depth or HTILE range of a surface the host has not written since import (draws with depth or stencil writes, depth/stencil copies, storage write-back; not clears after a proven HTILE clear) retires it instead of throwing; that a draw without those writes leaves the console's Z planes and HTILE unchanged is inferred, not measured. Guest publication of a written surface, arbitrary guest depth import, raw-bit sampling, arrays and storage access remain unimplemented; stencil plane sampling is listed below. The block footprint follows main's AMD Addrlib thin-block rule; the accepted HTILE clear words and PS5 equivalence are not measured on console hardware. PPSA99902's historical resident eight-sample D32 reader is documented in [#419](https://github.com/boykopovar/AnyPS5/pull/419#issuecomment-6105597729). +- [Native multisampled D32S8 depth without HTILE](../../../core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp) is imported only when its depth plane repeats one float in [0, 1], its separate stencil plane repeats one byte and no multisampled colour target covers either plane; the host image starts at those values and the sampled descriptor must name no metadata, whose pipe-aligned and ITERATE_256 bits are then not compared. The depth plane is sampled as a 32-bit float and the stencil plane through the R8_UINT descriptor of the stencil plane sampling entry below. That every sample then holds them is inferred from the uncompressed layout, not measured on the console. Planes holding more than one value, and D16 or D32 without HTILE, still throw. - [Native multisample stencil plane drawn as colour](../../../core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp) (libSceAgcDriver) - a native D32S8 target whose separate stencil plane a multisampled colour target covers with anything but a known R8 value of the same sample count is imported with the plane unproven: its host stencil is not taken from it, and a stencil-tested draw or a sample of the plane refuses (`native multisample stencil plane aliases a multisampled colour target whose samples are only on the host`) until a whole-plane fill gives its byte, which a colour target still over the plane must have absorbed as the same R8 byte at the same sample count. Taking a drawn plane without a fill needs a GPU copy of the colour target's R8 samples, in the same sample order, into the depth image's stencil aspect, which is not implemented. Whether the console's stencil reads of a plane written through the colour path match that copy is not measured. - [Native multisample stencil plane sampling](../../../core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp) (libSceAgcDriver) - the separate stencil plane of a native multisampled D32S8 target with a depth-only HTILE is sampled through an R8_UINT 2D MSAA descriptor at the plane with the target's extent, samples, tile mode and XOR and no metadata, as a stencil-aspect view of the host depth image or of its sample shadow, which then copies the stencil with the depth. A stencil kept in HTILE, another format, metadata or layout is refused, and a plane left unproven by a colour target refuses as listed above. Whether the console's reads of the plane through such a descriptor match the host stencil is not measured. - [sceAgcDriverSetSubmitValidationMode, sceAgcDriverGetSubmitValidationMode, sceAgcDriverSetSubmitValidationConfig, sceAgcDriverGetSubmitValidationConfig, sceAgcDriverSetValidationErrorOutputFrequency, sceAgcDriverGetShaderDebuggingStatus](../../../core/libs/prx/libSceAgcDriver/Unimplemented.cpp) (libSceAgcDriver) - the five validation calls return `0x8A6C1000` without reading their arguments or writing caller memory, and `sceAgcDriverGetShaderDebuggingStatus` returns 1, as [OpenAGC](https://github.com/OpenAGC/OpenAGC/blob/3c7e8072f0d7684e930454794fd5c02056946d73/src/game_compat.c#L250-L291) reads them from Sony's libSceAgcDriver.sprx: each validation export is `mov eax, 0x8a6c1000; ret` in the copy Dragon Quest VII Reimagined bundles (0x7bb0-0x7bf0), and the debugging status is 1 in the firmware 5.50 library (0x6740). The parameters (a 32-bit mode or frequency, a mode output, a configuration pointer) follow OpenAGC and are never read. Whether later retail firmware enables submit validation or shader debugging is unverified; no title in this repository is known to call them