GPU: the depth bounds test reaches the host #158
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!158
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/158/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@r4tedx on GitHub · 2026-11-24 01:01 UTC · original
r4tedx:gpu/depth-bounds→main· +444 −33 · 7 files · 4 commits · merged 2026-11-25 22:48 UTCRebased onto
main940d32f(2026-11-25); headb5c468fdrops the mesh-dispatch test that starteddxc, per the triage.mainstill drops the flag and ignores the slot, so the change is the same; what moved with the rebase is under "Now" and "Tested".What
The README lists depth bounds as missing for the world. Two places dropped it:
D3D12_DEPTH_STENCIL_DESC1) to the plain description and discardedDepthBoundsTestEnable;0x220slot (OMSetDepthBounds) wasignored_state.Now:
DEPTH_STENCIL1(the mesh stream helper is generalised for both); others are made as before. Since the rebase the vertex stream also carries the rectangle lists' geometry shader (683ad7a), and both streams the topology typemaingives the mesh stream.OMSetDepthBounds(min, max)reaches the host list (slot0x220,0x230on newer lists through the existing slot shift) and is replayed when a graphics pipeline is bound, including after the indirect argument clamp. Fresh and reset lists keep D3D12's0..1.DepthBoundsTestSupportedkeep today's behaviour and warn once.Not verified
No game files were used. The entry point assumes the PC two-
f32signature and needs checking against a title. The kind-21 subobject is read with the PC layout;main's pre-build (depth_stencil_descincrates/victory-game/src/pipelines.rs) writes the engine's description with the depth-bounds flag at the same offset, which I read but did not check against a title.Not run since the rebase: the mesh stream with
DEPTH_STENCIL1(its GPU test, which starteddxc, was removed atb5c468f; the stream-level test still covers the flag), a rectangle-list pipeline with depth bounds (the geometry-shader subobject was empty in the run), the pipeline library's load path for either stream, and anything on a hardware GPU.Tested
At
49dd080, synthetic only:cargo test --workspace --lockedon the runner's WARP adapter).VICTORY_D3D12_WARP=1,--features diagnostics,--test-threads=1):cargo test -p victory-gpu149 passed, 0 failed, 2 ignored. The draw test reported depth bounds supported and read back[0.25, 0.5, 0.25, 0.25]for fresh, excluded, included and reset: with bounds excluding the cleared depth the pixel keeps 0.5; with bounds including it, 0.25 is written. The mesh-dispatch test was skipped (VICTORY_PC_DXCunset); it has since been removed (b5c468f), so no code in this PR starts a process.-D warnings.cargo test -p xtask: 6 passed (policy included).Before the rebase (head
520d629, oldmain), on an NVIDIA RTX 5070 and WARP: the same draw and the mesh dispatch behaved as above, with support forced off every pixel was drawn, and the stream-reader test failed onmain(flag dropped). Testers ran that head on an RTX 5060 Laptop, an RTX 3070 Ti and an RTX 5090 (comments below).Touches
list.rs/draw.rsnear #24 andhost.rsnear #32; neither implements depth bounds.#301 (open) keeps the kind-26 depth-stencil description in the same
GraphicsStateand leaves depth bounds to this PR; merged together the build fails untildepth_boundsis carried through kind 26, so whichever lands second needs that (noted by its author on #301).AI-assisted; no game assets were used.
🤖 Generated with Claude Code
67e8ae1) into the depth bounds branch b32dbccd3913f91ca) into the depth bounds branch 1a45c5e3fcgithub-bot referenced this pull request2026-11-26 05:05:31 +00:00
@jeremygold02 on GitHub · 2026-11-24 04:41 UTC · original
Tested head
728a8e3c91e7a8417c36ac9863d15bfb1e2eb11awithcargo test -p victory-gpu --lib depth_bounds_test -- --test-threads=1: 3 passed, 0 failed (44 unrelated tests filtered out). The cases verify depth bounds reach host handling for a title draw and mesh dispatch, and that the depth-bounds flag changes stream state (depth_bounds_test.rs). This is unit coverage; no live GPU or title run was performed.@DeerSilver on GitHub · 2026-11-24 10:51 UTC · original
Tested head
520d629merged ontomainffe310e(clean merge) on NVIDIA GeForce RTX 5060 Laptop GPU (Blackwell), driver 621.24, Windows 11 26300, Rust 1.98.1. No game files: the test suite only: pass.depth_bounds_flag_changes_the_stream_statedepth_bounds_control_a_title_drawdepth_bounds_control_a_title_mesh_dispatchVICTORY_PC_DXC is unset. I re-ran it withVICTORY_PC_DXCset to the Windows SDK's10.0.26100.0\x64\dxc.exe, and it then ran on the GPU with no skip message. So depth bounds control both a draw and a mesh dispatch on NVIDIA.cargo test --workspace --locked: 345 passed, 0 failed, 6 ignored, against 342 / 6 onmain.cargo clippy --workspace --all-targets --locked -- -D warnings: clean.AI-assisted (Claude Code).
@465d6a0eac on GitHub · 2026-11-24 16:28 UTC · original · edited 2026-11-24 17:20 UTC
Thank you for this, @r4tedx! Many pull requests here are still waiting to be merged, so I've ported this one to 465d6a0eac/AgentRecompVI, a VIctory fork where AI agents review and merge each other's work: https://github.com/465d6a0eac/AgentRecompVI/pull/27. You're credited as the author there. This pull request stays the original.
Test results
cargo clippy(both variants) andcargo test --workspacepass (345 passed, 0 failed).depth_bounds_control_a_title_drawpasses on the GPU and reportsdepth bounds on NVIDIA GeForce RTX 3070 Ti: true;depth_bounds_control_a_title_mesh_dispatchwas skipped here (noVICTORY_PC_DXC).@Marvisak on GitHub · 2026-11-25 00:18 UTC · original · edited 2026-11-25 19:19 UTC
Automated triage for the maintainers.
Merge candidate. This is a recommendation to look, not an approval. It merges cleanly into
main. CI:checkpassing.The PR forwards the title's depth bounds to the host. Slot 68 (0x220, already labelled as depth bounds in
list.rs) now callsState::set_depth_bounds, which usesOMSetDepthBounds, and the bounds are set again whenever a graphics pipeline is bound.GraphicsStatekeepsDepthBoundsTestEnablefrom subobject kind 21, whichmaindrops with a shortcut comment. The flag is part of the pipeline key, and hosts that reportDepthBoundsTestSupportedbuild the pipeline from a stream withDEPTH_STENCIL1, for both mesh and vertex pipelines through the sharedstream_pipeline.What I checked: kind 11 clears the flag,
State::resetreturns the bounds to none, vertex pipelines with bounds still go throughlibrary::pipelineunder a distinct name, and nothing in the PR starts a process now that the dxc test is gone. As the thread notes, the title does not enable the test on the window/fence pipeline from the RTX 3070 report, so that visual change probably came from another PR on that branch. The PR stands on its own as a missing capability.Generated by Claude Code
@r4tedx on GitHub · 2026-11-25 04:33 UTC · original
Rebased onto
main940d32f: head49dd080, one commit, CI green. @DenRakEiw thanks for the run on the RTX 5090 and WARP, and for offering to re-verify; this is the head to check.mainstill has no depth bounds of its own (kind 21 drops the flag, slot0x220isignored_state), so the change is the same. Two things moved with the rebase, both inpipeline/host.rs:mainadded (683ad7a), so such a pipeline keeps it;mainadded to the mesh stream.Tested at
49dd080on WARP only (VICTORY_D3D12_WARP=1, diagnostics build, one test thread):cargo test -p victory-gpu149 passed, 0 failed, 2 ignored; the draw test read back[0.25, 0.5, 0.25, 0.25]. Not run since the rebase: the mesh-dispatch test (needsVICTORY_PC_DXC), a rectangle-list pipeline with depth bounds, and anything on a hardware GPU. A hardware run withVICTORY_PC_DXCset would cover the first and the last. The description has the details.No game data was used. AI-assisted.
@r4tedx on GitHub · 2026-11-25 06:24 UTC · original
On the one open point of the triage: the external process is only in
depth_bounds_control_a_title_mesh_dispatch. It runsdxcfromVICTORY_PC_DXCto compile one mesh and one pixel shader written inline in the test, writes them to a temporary directory, and is skipped when the variable is unset, the same pattern as main'sdiff_tests.rs,flow_tests.rsandemit/mod.rs. Nothing else in the PR starts a process; the vertex-pipeline render test compiles in process withD3DCompile.If you would rather not take new process-spawning code, I can drop that one test. What would remain for the mesh path is the stream-level check (
depth_bounds_flag_changes_the_stream_state) and the sharedstream_pipelinethe vertex render test already exercises; the mesh dispatch itself would then be untested on a GPU. Say which you prefer and I will push it.Nothing was run for this note. AI-assisted.
@r4tedx on GitHub · 2026-11-25 07:06 UTC · original
I dropped the test that started
dxc, as offered above, so nothing in this PR starts an external process now. New headb5c468f, one commit on top of49dd080, no history rewritten.What stays:
depth_bounds_flag_changes_the_stream_state(stream key) anddepth_bounds_control_a_title_draw(vertex pipeline drawn and read back, compiled in process withD3DCompile). The mesh path of the sharedstream_pipelineis no longer exercised on a GPU by this PR.Checked here:
cargo clippy -p victory-gpu --all-targetswith and without--all-features,-D warnings, clean. The tests were not rerun locally; CI runs them on WARP for this head.Note for merge order: this PR and #159 both edit the same README row (GPU: world). Each merges cleanly into
mainon its own; whichever lands second will need that one line resolved, and I'll do it right away.AI-assisted; no game data used.
@Slay326 on GitHub · 2026-11-25 16:25 UTC · original
Hardware test: this fixes a visible error on an RTX 3070. RTX 3070 (8 GB, 32-lane waves), Windows 11, Series X mode, 480 s runs into the world of Grand Theft Auto VI 1.0.2.1. Local test branch: main
940d32fplus #1906, #1890, #1883, #1962, #1779, #1763, #1762, a page-mark guard like #2167 and the memory PRs #2129, #2180, #1873, #1969, #2161.Before: in the first cell scene (the player at the barred window), the back of the character's head was black inside a rectangle. A target dump showed the alpha prepass of the window/fence (mesh
0c6c5a3a, pixel629743ca) writing a full rectangle into the main depth target, over the nearer head; the hair was black exactly inside that rectangle.With this PR (merged on the branch above; one conflict in
host.rs, both sides kept, plus theheap_usagefield from #1962 in the test's state): the head and ponytail show in full in the same scene. 640 s run, no device removal.victory-gpu: both depth-bounds tests pass.AI-assisted.
@Venom2054 on GitHub · 2026-11-25 16:46 UTC · original
Title-side depth-bounds data for
b5c468fon native Windows 11, RTX 5070 Ti (621.01). I compared the same940d32f-based prologue build (including #2311 and #2349), save, scripted input and starting cache, with and without this PR. The PR run had two logging probes, one atset_depth_boundsand one at graphics pipeline creation. Both runs reached the cell window and completed a 330 s observation without device removal.set_depth_boundswith(0.0, 1.0)first. After world entry the first non-default pair was approximately(0.000047207, 0.000277936). These are the values received as twof32s by this build.0c6c5a3a/629743ca), the one pipeline creation I observed hadDepthBoundsTestEnable = false. The head remained a dark silhouette in both runs, so I couldn't isolate the reported rectangular occlusion on this integration. That flag would be worth comparing on the build that showed the change.[0.25, 0.5, 0.25, 0.25](fresh, excluded, included, reset).As a separate visual control I tried only the rectangle shader from #2366 (
d29e14f) on the same baseline. In three captures of the settled courtyard, the same upper edge had three sawtooth jumps of at least 24 px on the baseline and with #158 alone, and zero with #2366 alone. The result held at three brightness thresholds. This separates the triangles around the opening from the dark silhouette on this setup.Tested with OpenAI Codex assistance.
@r4tedx on GitHub · 2026-11-25 16:49 UTC · original
@Venom2054 thank you, especially for the two probes. The
DepthBoundsTestEnable = falseyou saw on the window/fence pair is the comparison to make next.Our own runs on an RTX 5070 can't answer that yet. Our layer builds carry an older head of this PR (
49dd080), and the same window/fence pipeline is created in every run, but no build of ours logs the depth-bounds flag per pipeline. A coming build adds that field to the pipeline line. When it has run, I'll post the enable flag and the bounds pair for that pipeline here, so it can be set next to your 5070 Ti numbers and Slay326's 3070 result.The runs mentioned here were runs of the title on my PC with my own local copy of its data; only logged flags and values will be quoted.
AI-assisted
@r4tedx on GitHub · 2026-11-25 18:44 UTC · original
Updated for the current
main: head1a45c5e3, two merge commits onb5c468f(main67e8ae1, then13f91ca), no force-push.host.rsconflict was main's new code next to the depth-bounds lines; both are kept.git diff 13f91ca 1a45c5e3is the PR's own 7-file change. The only difference from before is that the README "GPU: world" row now starts from main's new wording.--features diagnosticson WARP, at the first merge: 200 passed, 0 failed, 1 ignored (a release-only benchmark). Both depth-bounds tests pass. After the README-only second merge,cargo check -p victory-gpu --all-targets --features diagnosticsis clean.@Slay326 thank you for the RTX 3070 result: the head and ponytail coming back in that scene is the first in-title confirmation of this PR.
Synthetic tests only for this update; no title data used.
AI-assisted
@r4tedx on GitHub · 2026-11-25 18:54 UTC · original
@Venom2054 here is the comparison promised above. It agrees with your result.
Our run: RTX 5070, diagnostics build of a local play tree that carries an older head of this PR (
49dd080) plus one logging commit that prints the depth-bounds state per pipeline.depth_bounds_test = false. The title does not ask for the test on it, so nothing is applied.(0.0, 1.0), then(4.8637e-5, 2.7794e-4), then(2.0462e-4, 2.7794e-4). Your max is the same, and your min of 4.72e-5 is close.So on this pipeline this PR has nothing to switch on: the bounds reach the host, but the title draws the window/fence without the test. That also means the depth-bounds test on this pipeline isn't what changed the picture in Slay326's RTX 3070 run. Their branch differs from main in several other PRs, and I haven't found which change made the difference there.
This was a run of the title on my PC with my own local copy of its data. Only the logged flags and values are quoted here.
AI-assisted
@andrewpozdnakov7-jpg on GitHub · 2026-11-25 20:45 UTC · original
I reran the ClearState integration regression on this PR at
1a45c5e3, combined with the current-main ClearState follow-up based on #1166 at2d779bf. WARP reported depth-bounds support. The same guest draw fixture read these five depth values before and after the integration fix.The next bind replayed the saved depth bounds after ClearState. bfa77cb clears the saved range while retaining #1166's cached views and descriptor ownership. It keeps swarm's Git authorship from the original regression and both PR histories. Six paired WARP runs reproduced the readback. The serial GPU suite passed 203 tests with one ignored under each debug setting. Strict Clippy in both configurations and asset policy passed.
Please retain the Git authorship and existing trailer if reapplying the integration commit. If you fold the adaptation into another commit, please keep its attribution with the following trailer.
Co-authored-by: andrewpozdnakov7-jpg [email protected]
AI-assisted with Codex. Synthetic GPU commands on WARP.
@r4tedx on GitHub · 2026-11-25 20:46 UTC · original
@andrewpozdnakov7-jpg thank you. The ClearState row shows a real gap in the combination: the saved range survives ClearState and is replayed on the next bind.
bfa77cbaddsself.depth_bounds = None;to #1166'sState::clear_state. Currentmain(13f91ca) has no ClearState yet, and nothing in this PR's draw.rs resets state there. So the change can't land on this PR alone: it needs whichever of #158 and #1166 merges second.maininto this branch (no force-push) and applybfa77cbas it stands, with swarm's authorship and yourCo-authored-bytrailer, plus the five-value readback test.I read the diff only and haven't run it. The table and the 203-test WARP suite are your results. No title data was involved.
AI-assisted