Repository navigation
Conversation
|
For triage: #1315 also translates console geometry programs (single-stream triangle geometry, with a new This PR on its own, at |
Offline measurement on a retail dump, and the shader tests on AdaResult: +195 programs over Offline. I merged head d01f9a6 onto
None of the 195 is among the programs that #1402 gains, so this PR adds to the bundles instead of overlapping them. It is the only open PR I have measured that clears "an address in an SGPR that is no root parameter" (195 on Tests: with the same merge, No shader names or data are included, per the asset policy. AI-assisted (Claude Code). |
Static review of the ES/GS lowering (head d01f9a6)Summary: On a retail dump this PR gains 195 programs, 0 lost (measurement), and its tests pass on Ada. Those counts only prove that the DXIL validates. Below are the places where the output could still be wrong although it validates. Line numbers refer to the PR head. Likely bug1. The emitted vertex's index is computed, then ignored. Outputs are stored at the
This is correct only if, for every vertex k, all of its writes come after emit k−1 and before emit k. The synthetic test (
In both cases the host emits the last-written values for several vertices, so primitives collapse or stretch. Suggested fix: keep a counter of emits per stream. For every write between emit k−1 and emit k, require Risks (cannot be confirmed without one real ES/GS pair)2. The LDS layout is assumed to follow signature rows, not Both ES→GS and GSVS dwords are mapped as If the console lays out ES→GS or GSVS memory by parameter slot, or compacts unused components, inputs and outputs are silently mixed up. Both ES and GS use the same rule, so they agree with each other but can both be wrong. A cheap guard: check 3. Silent defaults for the GS state. ( When
A wrong input primitive changes how many vertices 4. Non-zero streams have no host consumer. (
5. A GSVS or ES→GS write with no signature row is dropped silently. ( A real output whose row the signature lacks becomes undefined on the host. Other paths refuse in that case ("a GS input the signature lacks"). Nits
What looks right
What the tests cover, and what they don'tCovered:
Not covered:
AI-assisted (Claude Code); static review only, nothing run. |
d01f9a6 to
e80b166
Compare
|
Rebased onto What changed in the design:
Checked on this base:
Not checked: the whole-title program counts were not re-measured on this base, no live run was made with these pipelines, and the pre-build path for these records has not been compared against a run's pipeline keys. AI-assisted (Claude Code); checked on Windows 11 / RTX 5090. |
|
I reproduced the GSVS write/emit ordering issue raised above on the rebased head
With the patch the full 32 × 32 RGBA readbacks match exactly. The failure on the PR head was visible in rendering even though the generated shaders passed DXIL validation. Patch and regression test · The patch queues writes by Full |
|
Rebased this onto current Rebase conflicts were three hunks:
It is open as #1924 so the maintainer can take a ready branch including the ordering fix. If you would rather update this PR yourself, reset |
|
Automated triage for the maintainers. Needs work. Thanks for the rebase: This changes emulation behaviour, and the PR states no evidence for it:
CI: passing ( Generated by Claude Code |
A GS that stores all three vertices' ring slots before its first EMIT, the write batching that made Marvisak#1399 draw nothing: each EMIT still takes its own vertex's values (checked through the input reads they come from). raise takes each slot at the EMIT that consumes it, by its offset in the invocation's ring, so it needs no change. Untested at commit time: waiting for the machine's test queue (WARP). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…etry programs as gs_6_6) The console runs a vertex shader that feeds a geometry shader, and that geometry shader, as the two halves of one wave, the vertices between them in LDS. An export program now translates to a plain vertex shader (its LDS writes are its outputs) and a geometry program to a geometry shader (its LDS reads are its input primitive's vertices, its LDS writes the outputs of the vertex its next stream message emits). - native: `StageIo::Es` / `StageIo::Gs(GsIo)` stage data. - resource: the geometry stage's own table (`GS_TABLE`, s[8:9]). - io: ring reads and writes raised to inputs and outputs by row and channel; `s_sendmsg` GS / GS_DONE raised to emit, cut and done. - emit: the geometry-shader state of rectangle lists (`Shader::gs`, the `GSState` and `PSV0` it writes) is generalized from "triangles in, strips out, n vertices" to a `Geometry` (input primitive, output topology, maximum vertices, instances; one stream) that the generated rectangle shader and title shaders share. Lowering: vertex-axis `loadInput`, `emitStream` / `cutStream` / `emitThenCutStream`, `primitiveID`, `gsInstanceID`, the prologue's lane masks as "every invocation", no barrier and a return for the export program's handover. 16-bit values in the rings and streams other than 0 are refused. - gpu: a title's geometry shader takes the host pipeline's geometry stage (root parameters visible to it); a pipeline with one and a rectangle-list topology is refused with a reason rather than chained. - app: `translate` counts export and geometry programs; the pipeline pre-build makes records with an export and a geometry stage. Tests: stage data, I/O raising, and a merged pair drawn on the host (export program as vertex shader, geometry program after it). Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
e80b166 to
2900907
Compare
|
Rebased onto current main ( AI-assisted (Claude Code); checked on Windows 11 / RTX 5090. |
Summary
Rebased cleanly onto
upstream/main(ffe310e):Decodes, raises, lowers, validates, and wires console merged ES+GS hardware geometry stages (
HwStage::Es->vs_6_6andHwStage::Gs->gs_6_6):victory-shader/src/native.rs: DecodesHwStage::EsandHwStage::Gsstage data (StageIo::Es,StageIo::Gs(GsIo)including vertex stride, GSVS ring stride, invocations, and max vertices).victory-shader/src/resource.rs: Recognizes the console merged-GS internal ring-table SGPR pair (GS_TABLE) without disrupting root parameter tracking.victory-shader/src/io.rs: Raises ES->GS and GSVS LDS traffic (ds_read*->gs_reads,ds_write*->lds_outputs), ES system VGPRs (VertexId,PrimitiveId,InstanceId), GSGsInstanceId, ands_sendmsg(MSG_GS / MSG_GS_DONE)stream operations (gs_ops).victory-shader/src/emit/{container,shader,lower,mod,host}.rs:gs_6_6modules withGSStateentry property (tag 1), single-streamdx.viewIdState, and GSPSV0metadata.dx.op.loadInputwith vertex axis,dx.op.primitiveID.i32(108),dx.op.gsInstanceID.i32(100),dx.op.storeOutput, andemitStream/cutStream/emitThenCutStream(97/98/99), plus ES barrier elision and indirect handover return.Host::gs_pipelinefor live D3D12 VS+GS+PS pipeline creation.victory-gpu/src/pipeline{,/host}.rs: IncludesHwStage::Gsin shader resource extraction, allows"geometry"inHostPipeline::new, addsD3D12_SHADER_VISIBILITY_GEOMETRY, bindsdesc.GS, and includes GS bytecode in the pipeline library cache key.apps/victory/src/translate.rs: IncludesHwStage::GsandHwStage::Esin raising, DXIL emission, validation, host pipeline verification, and corpus reporting.Es/Gsstage data decoding, LDS/sendmsg raising, and livedxil.dllvalidation + D3D12 pipeline creation for bothEs(vs_6_6) andGs(gs_6_6).Verification
cargo clippy -p victory-shader --all-targets&-p victory-gpu --all-targets— passedcargo test -p victory-shader&cargo test -p victory-gpu pipeline— passedcargo xtask policy— passed