Geometry shaders, step 2: read the merged ES+GS stage data #311
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/fxceless--victory-fork#311
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
@Revens2 on GitHub · 2026-11-24 23:29 UTC · original
Follow-up to #138, after #309 (step 1: the GS half reads the merged stage's SGPRs and stops at GS emit).
The merged stages keep their stage data in a layout native.rs does not read (see its module notes). Needed before any emission: the GS output signature rows and how the output records in LDS map onto them, the GS input layout (what the ES half writes per vertex), limits (max output vertices, output topology, instance count) and the LDS size. Read from the GS record and the ES record, with a synthetic fixture per field; add them to StageIo::Gs (today a unit variant). Status of what the runtime table at user data 0/1 holds, and whether the ES half reads it too, belongs here as well.
Not started.
@avt0m4t48 on GitHub · 2026-11-24 23:47 UTC · original
There is a container-level source for some of these fields while the native records are being mapped. Microsoft's PSV layout puts the GS input primitive, output topology, stream mask and position flag at PSV0 payload offsets 4, 8, 12 and 16. For a declared runtime-info size of at least 36 bytes, offset 28 is the stage tag (geometry = 2), and offset 30 is the maximum vertex count (u16). XCL's restricted triangle-to-triangle-strip pairing reads the topology and limit from that part. Victory already has a reader for the outer ISG1 and OSG1 signature rows.
I checked those offsets against five original
gs_6_0fixtures generated with DXC 1.9.2609.5. All five passeddxv. Changing line to triangle input, line strip to point output, and max vertices from 8 to 12 changed the corresponding fields. ISG1 and OSG1 held distinct TEXCOORD indices and the expected two-component masks. Changing only[instance(1)]to[instance(3)]left the entire PSV0 identical. The standard DXIL entry metadata contained the changed instance count.This supports testing a small outer-metadata reader independently of the native stages. Instance count in the native record, LDS size, the signature-to-LDS mapping, and the contents and ES use of the runtime table still need a source. I would keep #311 open for those fields and use compiler-produced ES+GS pairs with one declaration varied at a time to establish the native offsets. The checks above used original shaders and desktop DXIL. They exercised no console stage execution.
Source investigation and fixtures were prepared with Codex assistance.