Game: name rasterisers from the pack's register images #3047
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!3047
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3047"
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?
@zed6000 on GitHub · 2026-11-26 05:14 UTC · original
zed6000:pr-raster-registers→main· +135 −5 · 1 files · 1 commits · openCloses the rasteriser half of #2930.
translate --cache --pipelinesskipped 852 of the pack's pipelines asrasteriser state not named: 6 of the pack's 18 rasteriser hashes have slope biases (and for 5, aDepthBiasClamp) thatraster_spacedoesn't list. The register images do keep the rasteriser. In the fixed partregisters()reads, the 7 words from+0x28arePA_CL_CLIP_CNTL,PA_SU_SC_MODE_CNTL, two unused words,PA_SU_POLY_OFFSET_CLAMP,_FRONT_SCALEand_FRONT_OFFSET.raster_from_registersreads cull (CULL_FRONT→ 2,CULL_BACK→ 3, neither → 1), winding (FACEclear → counter-clockwise), depth clip (bothZCLIP_*_DISABLEclear), the clamp as is, the slope bias as scale / 16 and the integer bias as the offset. It enumerates b13–b15, which these words don't hold. Wireframe, both-faces culling and non-integer offsets give nothing.name_from_registerstries it for every record whose rasteriser is still wanted, before the enumeration. As before, a description counts only if its CityHash64 is the record's.Measured on
shaders.rpf1.0.2.1 (offline, RX 7900 XTX):mainalready names, the registers give the named description in every field.Named::findtime is unchanged (~85 ms).translate --cache --pipelines:rasteriser state not namedgoes from 852 to 0. Every pipeline was created and none refused. One of the newly named pipelines is in an earlier game run'searly-pipelines.txtunder the same key, which includes the whole D3D12 rasteriser description.cargo test -p victory-game17/0 (2 new tests, on synthetic registers), andcargo clippy -p victory-game -p victory --all-targets --locked -- -D warningsclean.This doesn't conflict in purpose with #2575 / #2787: with every rasteriser named from the registers, their early stop ends
raster_spaceimmediately.No game data: the tests use made-up register values.
🤖 Generated with Claude Code
@Marvisak on GitHub · 2026-11-26 06:16 UTC · original
Automated triage for the maintainers.
Verdict: merge candidate.
crates/victory-game/src/pipelines.rs:raster_registersreads the 7 words from 0x28 into the fixed part of the register image, which ends exactly whereregisters()starts (0x44).raster_from_registersdecodes cull fromPA_SU_SC_MODE_CNTLbits 0-1 (none/front/back as D3D12 1/2/3, both culled skipped), winding fromFACE(bit 2), wireframe fromPOLY_MODE(bits 3-4), and depth clip from the twoZCLIP_*_DISABLEbits (26-27) ofPA_CL_CLIP_CNTL. These bit positions match the public RDNA2 register reference. The slope scale over 16 is how AMD hardware stores the slope bias. A candidate still counts only when its CityHash64 equals the record's hash, so a wrong decode would name nothing rather than name the wrong state.Named::findtries it before the enumeration, and the tests use synthetic register values.CI:
checkpassing. #3048 is stacked on this PR.Generated by Claude Code
@fuzeofficlal on GitHub · 2026-11-26 05:20 UTC · original · approved these changes
Static review of
3c4c7d85(crates/victory-game/src/pipelines.rs).Verified the AMD GFX10 rasteriser register decoding against
rasterizer_descandraster_space:PA_CL_CLIP_CNTLbits 26–27 (ZCLIP_NEAR_DISABLE | ZCLIP_FAR_DISABLE) ->b[12](depth_clip).PA_SU_SC_MODE_CNTLbits 0–1 (CULL_FRONT | CULL_BACK) ->1/2/3, bit 2 (FACE) ->ccw, bits 3–4 (POLY_MODE) -> solid-only filter.PA_SU_POLY_OFFSET_CLAMP,_FRONT_SCALE / 16.0, and_FRONT_OFFSET(withfract() == 0.0and(-128.0..=127.0)range check that also rejects NaN/infinities).0..16) covers the exact[b[13], b[14], b[15]]space thatraster_spaceuses, deduplicated by(rasterizer_hash, regs)soNamed::findstays fast and exact via CityHash64.Clean, focused, and well tested.
@kotekompotek on GitHub · 2026-11-26 05:27 UTC · original · approved these changes
Verified:
raster_registerslocates the rasteriser image at base+0x28 (0x74/0xc8 by shader stage, matchingregisters),raster_from_registersrejects wireframe/both-culled/fractional-bias cases that D3D12 can't express, decodes cull, winding, depth-clip, clamp verbatim and slope bias as scale/16, then enumerates only the three unkept tail bytes.tried_rasterdedups repeated images. The test asserts the exact 16-byte block for a decoded case plus every rejection path.@andrewpozdnakov7-jpg on GitHub · 2026-11-26 14:36 UTC · original
I checked the full
Pack::parse→Named::findpath on main63bcca4and exact head3c4c7d8with the same synthetic fixture. Main found 0/2 rasteriser descriptions. The PR found 2/2 directly from the registers, with the expected bytes for both the vertex and mesh layouts. Both builds left two controls with a different nonzero clamp hash unresolved. The PR plus the fixture passed 18/18victory-gamelib tests, strict Clippy, and policy.I put the optional test directly on your head. If folded into your commit, please retain
Co-authored-by: andrewpozdnakov7-jpg <[email protected]>. Test commitAI-assisted with Codex.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.