Repository navigation
Conversation
A rectangle list gives three vertices per rectangle and the hardware adds
the fourth. The host draws them as triangles after expanding the vertex
buffers (primitive::expand_rects). A vertex shader that reads no vertex
buffer and places the corners from SV_VertexID has nothing to expand: its
draw ran as count / 3 * 6 vertices with the wrong vertex numbers, and an
indirect one was dropped. The title's tiled lighting and many of its
full-screen passes are drawn this way.
A rectangle-topology pipeline without per-vertex inputs now gets a
geometry stage of ours, generated from the vertex stage's output
signature. It takes the three vertices and emits the rectangle as a
four-vertex strip. The corner opposite the longest side is taken as the
middle one, so it does not depend on which of the three the title puts
between the other two; the fourth vertex is the other two's sum less it,
for every interpolated output (integer outputs take the middle vertex's).
Such pipelines are made with cull mode none, their direct draws keep the
title's vertex count and first vertex, and their non-indexed indirect
draws run with the title's records.
The stage is compiled to DXIL: the host refuses a pipeline that mixes
shader model 6 stages with a 5.1 one ("Graphics pipeline state mixes
shader model 6.0 or above with 5.1 or below"), so D3DCompile cannot make
it.
shortcut: the compiler is the Windows SDK's dxcompiler.dll, loaded at run
time (VICTORY_DXC names another). Without it these pipelines are made as
before. Indexed rectangle lists stay undrawn.
Tests (real GPU, skipped without a compiler): three vertices placed by
number cover the whole target through the stage and only a triangle
without it, for both corner orders; the signature parser reads a compiled
vertex stage.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TydV9AGmPCiUTkG8rHubBQ
|
We checked the non-indexed indirect route on an RTX 4090 under Wine/vkd3d-proton 3.2. A source-built SM 6.8 vertex shader used both SV_VertexID and SV_StartVertexLocation. VIctory’s indirect draw preparation consumed the record The authored rectangle coverage test passed on the same setup. Together these results check geometry completion and retention of the indirect record’s count and start vertex. The two end-of-frame lighting targets in your title report remain a separate result. On our gstack integration, the indirect draw produced the same 32-pixel mask, and the existing GPU vertex-buffer expansion still matched CPU expansion. The integration bypasses that buffer expansion only for pipelines that already have the generated rectangle geometry stage. The full GPU suite had 88 passes, one ignored test and the known Wine empty-library failure. |
…C from the search path With both the indirect rectangle expansion (Marvisak#346) and the geometry stage (Marvisak#1020): a rectangle-list draw whose pipeline has the geometry stage runs the title's own records and vertices, unexpanded (the expansion would hand it twice the vertex ids), and indexed ones, direct and indirect, are drawn through the stage too (it completes whatever triangles reach it). The expansion keeps the rectangle draws of pipelines with vertex inputs. The stage's compiler: without a Windows SDK, dxcompiler.dll from the DLL search path, which shader translation and the argument clamp already load (under Wine, the prefix's system directory). Before, no SDK meant no stage, and every such pipeline stayed as before. The pass log marks rectangle draws, and those with the stage. In Grand Theft Auto VI's world these are the tiled lighting (VS_TiledLighting_*) and tiled weathering (VS_TiledWeathering_*) passes, 256 indirect rectangle draws a frame, all placed by vertex id.
|
Independent verification at
No game data used. AI-assisted; all builds and GPU tests executed on my machine. |
…ometry stage Merges Gargalindis's 39e056a over Marvisak#282's rectangle expansion and the depth-twin work. A rectangle-topology pipeline whose vertex stage reads per-vertex input keeps Marvisak#282's path: its buffers are expanded (direct draws on the CPU, indirect draws through the record rewrite). One without per-vertex input that got Marvisak#1020's geometry stage (rect_gs) is not expanded: its direct draws keep the title's vertex count and first vertex, its non-indexed indirect draws execute the title's records with the title's signature. Whether a direct draw expands is asked after prepare, and the indirect expansion refuses a geometry-stage pipeline, so a pipeline made ready on another thread mid-draw is never both expanded and completed. Indexed rectangle lists stay undrawn. HostPipeline keeps both depth_format/stencil (depth twins) and rect_gs. Diagnostics: the listed-frame pass lines say "rect gs true|false" for direct and indirect draws. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…y stage Conflicts: draw.rs (indirect rectangles: pipelines with our geometry stage run with the title's records; the others take #346's GPU expansion), pipeline/host.rs (our blend tests and #1020's stage, both kept). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tage Adapt the geometry-stage approach in Marvisak#1020 (39e056a) to Linux DXC and ordinary and depth-bounds stream PSOs. Restrict admission to the four observed VS_TiledLighting programs and vertex-buffer-free layouts. Link both GS signatures, preserve flat attributes, and leave indirect argument records, instance IDs and the existing budget clamp intact. Exercise the normal command path with a GPU-supplied count and padded argument records. Read back all colors, including the inferred corner. Report GS primitives in selected pass measurements. Co-authored-by: Gargalindis <360729470+Gargalindis@users.noreply.github.com>
|
Closing: |
AI-assisted (Claude Code). Tested on my own machine: Windows 11, NVIDIA GPU, v1.0.2.1 in Series X mode.
Relates to #255.
What
A rectangle-topology pipeline whose vertex stage reads no per-vertex input gets a geometry stage of ours that completes each rectangle from its three vertices. Its draws keep the title's vertex counts, and its non-indexed indirect draws run with the title's records.
Why
primitive::expand_rects(and the GPU expansion in #282 / #346) make the fourth corner from vertex buffer contents. The title's tiled lighting has no vertex buffer:VS_TiledLightingcomputes the tile and the corner fromSV_VertexID(tile = id / 3, corner = id % 3). Many of its full-screen passes are built the same way. For those draws there is nothing to expand, so onmaina direct draw runscount / 3 * 6vertices with vertex numbers the shader does not expect, and an indirect one is dropped.This may be part of why the picture stayed black after #346 (louketa's comment on #255): the draws stop being dropped, but the vertices they run still carry the wrong numbers.
How
OSG1signature, compile it, check the compiled stage's output registers equal the vertex stage's, add it to the pipeline, and set cull mode none.a + b - middlefor every float output; integer outputs take the middle vertex's value.D3DCompile(gs_5_1) the host refused every such pipeline: "Graphics pipeline state mixes shader model 6.0 or above with 5.1 or below".Limits
dxcompiler.dll, loaded at run time (VICTORY_DXCnames another path). Without it, these pipelines are made exactly as before. I know GPU: build the indirect-argument clamp with our own writer (no shader compiler at run time) #190 moves the other direction (no compiler at run time); emitting this stage with the crate's own DXIL writer would remove the dependency, and I'm happy to rework it that way if that is the preference.Tests
cargo test -p victory-gpu --lib: 52 passed, 0 failed, 1 ignored.cargo clippy -p victory-gpu --all-targets: clean.New, on the real GPU (skipped when no compiler is found):
rectangles_placed_by_vertex_number_are_completed: three vertices placed by number, for both corner orders, cover all 64 pixels of an 8x8 target through the stage, and only a triangle without it.signature_of_a_compiled_vertex_stage: the signature parser reads a compiled vertex stage's input and output.Measured in the game (counts only)
On my integration branch (not
main), with a pipeline-statistics query around the enabled tiled-lighting draws in the world, 720 vertices each:I have no statistics from before the change, only that the pass's two targets were all zero at the end of the frame. They still are: the no-directional-light pixel stage now runs and writes zero. So the picture is not fixed by this alone on NVIDIA: the directional variant draws no tiles because the tile texture its vertex stage tests is all zero, and the compute passes that feed lighting (
shadowmask,cascadeshadows_classify,indirect_light_probes) do not translate on a 32-lane host. About 310 pipelines in a run into the world are of this kind (the count the host refused when the stage was stillgs_5_1).No game-derived content is included.
🤖 Generated with Claude Code
https://claude.ai/code/session_01TydV9AGmPCiUTkG8rHubBQ