Shaders: check the constant-colour container's layout and hash on every host #262
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!262
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/262/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?
@SkippySteve on GitHub · 2026-11-24 01:53 UTC · original
SkippySteve/shader-container-test-linux→main· +25 −3 · 1 files · 2 commits · closed without mergingconstant_color()invictory-shader's emit tests builds a pixel shader container but was only called by the two#[cfg(windows)]tests (stub_pipeline_is_created,constant_color_validates). Off Windows it was dead code, socargo test/cargo clippy --all-targets -p victory-shaderon Linux warned:This PR combines two fixes for that warning (it supersedes #258):
Keep the helper on every host and use it there. Gating
constant_color()with#[cfg(windows)](#258's approach) would have hidden the warning, but left the container untested off Windows. Instead, a new test runs on every host:constant_color_is_a_well_formed_container. It checks what D3D12 and the validator look at before they read the bitcode:dxbc::Container, and its size field equals its lengthSFI0 ISG1 OSG1 PSV0 HASH DXILDXILpart starts with the program headercontainer::hashof the bytes after itIt needs neither D3D12 nor
dxil.dll.Import hygiene from #258.
bitcode::Attrandshader::Shaderare used only byconstant_color(), so their imports move from the test module into the helper.The change is tests only: no runtime code changes.
Testing (Linux)
cargo test -p victory-shader: 57 passed (was 56)cargo clippy -p victory-shader --all-targets -- -D warnings: clean (it failed before because of the warning)cargo clippy -p victory-shader --all-targets --target x86_64-pc-windows-msvc -- -D warnings: cleancargo fmt -p victory-shader --check,cargo xtask policy: clean@SkippySteve on GitHub · 2026-11-24 02:32 UTC · original
Folded into #326 to keep the PR count down. The commits are unchanged there.
Pull request closed