Repository navigation
GPU: a typed depth format in a shader resource view is made in the readable colour format - #2294
denkencar-sketch wants to merge 2 commits into
Conversation
catminou4
left a comment
There was a problem hiding this comment.
Typed depth formats in shader resource views made readable (DEPTH_READABLE mapping). Static review only: victory-gpu/victory-hle are Windows-only (D3D12/windows-sys); not compiled or tested on this macOS arm64 host. rustc 1.98.1.
…efaults & depth/rect fixes - Reserve a dedicated 64 KiB zero-filled guard page inside kArenaReserved (kTitleGuardOffset) at arena creation and route uncommitted, past-cap, or arena-full title-memory VAs to it instead of handing raw CPU pointers to shaders (prevents VK_ERROR_DEVICE_LOST page faults; adapted from ubiquitarianism/leonida#1631, GPL-3.0). - Raise default unset LEONIDA_ARENA_MB up to 4095 MiB on >=16 GiB 64-bit hosts (with graceful step-down retry and system-RAM preference on <=12 GiB ReBAR GPUs) and default LEONIDA_TITLE_WINDOWS_MB from 256 to 512 MiB (up to 35% of arena). - Reclaim retired arena ranges on submit and across buffer/heap/shader/title-window allocations, and add bounded LRU eviction of idle title windows from earlier epochs without disturbing active submission windows. - Amortize large raw-texture recheck sweeps (>256 entries) over 16 rotating passes (adapted from MESIA-Unified@de27b6d, GPL-3.0). - Map Xbox slot-70/raw typed depth SRV formats (D32_FLOAT/D16_UNORM/D24S8/D32S8) to readable depth-plane colour formats (ported from Marvisak/VIctory#2294, GPL-3.0). - Remove duplicate if (rect_list) geometry-stage block in PipelineState::create_graphics that always failed after vs_stage.words was cleared. - Add guard-page, arena-reclaim, LRU-eviction, Xbox slot-70 depth SRV, and low-VRAM arena policy tests in runtime/test/d3d12_xmem_shadow_test.cpp.
|
I checked the D3D12 depth-SRV question on
The probe created a real 4×4 typeless depth resource in each family, passed its typed depth format through the runtime's On pristine Reproduction on Windows. I put the opt-in readback in a single source-only commit on this PR head. This version creates the title’s SRV through the production descriptor path. It compiles its shader at test time. From the PR branch at git fetch https://github.com/steven-seagull27/VIctory.git refs/heads/codex/pr2294-depth-srv-readback
git cherry-pick 53a1725153001bacaa2e91d3988eac5017f7a787
$env:VICTORY_D3D12_DEBUG = '1'
foreach ($warp in '0', '1') {
$env:VICTORY_D3D12_WARP = $warp
cargo test --locked -p victory-gpu --lib --features diagnostics draw::tests::typed_depth_srvs_read_the_rendered_depth -- --exact --ignored --nocapture --test-threads=1
if ($LASTEXITCODE -ne 0) { break }
}I ran these Cargo invocations on the published commit. Each process printed its real adapter name and four |
|
Automated triage for the maintainers. Merge candidate (worth a look). Rebased onto current On your reply: the two updated expectations in Generated by Claude Code |
…adable colour format The host refuses a depth format for a shader resource view; the view of a typeless depth texture took the title's.
298a006 to
3968b02
Compare
|
Rebased onto current \main\ (\842b0cb) and updated the two \R32_TYPELESS + D32_FLOAT\ / \R16_TYPELESS + D16_UNORM\ expectations in \placed_uav_textures_create_real_host_uavs\ (added by #1273) now that those SRVs create real readable host views without D3D12 errors. \descriptor::host::tests\ (16/16) and \clippy\ pass. |
…his line has them placed_uav_textures_create_real_host_uavs (main's, Marvisak#1273): Marvisak#2294 (96f6894) makes a typed depth format in a shader resource view in its readable colour format (fits, DEPTH_READABLE), so an SRV of an R32_TYPELESS or R16_TYPELESS texture in D32_FLOAT or D16_UNORM is now a real R32_FLOAT or R16_UNORM view, not the null fallback. The debug layer logs nothing for it, as the test checks. SRV cases 0 and 1 now expect a real view. The unordered-access cases stay null. query_resolves_after_unordered_access_to_destination (Marvisak#159's): main's clamp (315cea1) reads the title's records through a root view and writes into the list's own argument buffer, so the destination's copy is never written or left in unordered access. The test checks the title's records stay as written and that the resolve lands, and is renamed query_resolves_after_a_clamp_reads_destination. This is the author-branch fix gpu/host-queries ba872ae2 with this line's bound() arguments. PLAY-MAIN-781E846.md: both traced and fixed in the tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Summary
The host refuses a depth format for a shader resource view, but the view of a typeless depth texture took the title's format. A typed depth format in a shader resource view is now made in the matching readable colour format (depth 20/40/45/55 map to 21/41/46/56).
fits()is only used for SRV/UAV, and a depth texture cannot carry a UAV. The branch has a second, comment-only commit that keeps two doc comments with their items.Testing
Test
depth_formats_in_shader_resource_views_are_made_readablefails onmainand passes with this change.cargo test --workspace --lockedpasses apart from known flakes:modules::dstorage::tests::a_page_list_filled_after_its_request_startsfails now and then onmaintoo, and so does a parallel-run flake invictory-gpu's lib tests (watch::anddescriptor::host::tests, 2 of 40 runs on pristinemain).Not tried: a run in the game, or the D3D12 debug layer rejecting a D32_FLOAT SRV.
AI-assisted.