Shaders: build the constant-colour test shader only on Windows, where its tests run #258

Closed
github-bot wants to merge 1 commit from gh-pr/258/head into gh-pr/258/base
Owner

@⁠SkippySteve on GitHub · 2026-11-24 01:53 UTC · original
SkippySteve/shader-constant-color-cfg → main · +6 −3 · 1 files · 1 commits · closed without merging

constant_color() in crates/victory-shader/src/emit/mod.rs is only called by two #[cfg(windows)] tests (stub_pipeline_is_created, constant_color_validates), but the helper itself had no gate. On Linux the test build warns function constant_color is never used, so cargo clippy -p victory-shader --all-targets -- -D warnings fails.

This gates the helper on windows and moves its two imports (bitcode::Attr, shader::Shader) into the function body, because nothing else in the test module uses them and they would otherwise become unused imports.

No behaviour change. The Windows tests compile and run exactly as before.

Checked on Linux:

  • cargo clippy -p victory-shader --all-targets -- -D warnings: clean (it failed before this change)
  • cargo clippy -p victory-shader --all-targets --target x86_64-pc-windows-msvc -- -D warnings: clean
  • cargo test -p victory-shader: 56 passed
  • cargo fmt --check, cargo xtask policy: ok
**@⁠SkippySteve** on GitHub · 2026-11-24 01:53 UTC · [original](https://github.com/Marvisak/VIctory/pull/258) `SkippySteve/shader-constant-color-cfg` → `main` · +6 −3 · 1 files · 1 commits · closed without merging `constant_color()` in `crates/victory-shader/src/emit/mod.rs` is only called by two `#[cfg(windows)]` tests (`stub_pipeline_is_created`, `constant_color_validates`), but the helper itself had no gate. On Linux the test build warns `function constant_color is never used`, so `cargo clippy -p victory-shader --all-targets -- -D warnings` fails. This gates the helper on `windows` and moves its two imports (`bitcode::Attr`, `shader::Shader`) into the function body, because nothing else in the test module uses them and they would otherwise become unused imports. No behaviour change. The Windows tests compile and run exactly as before. Checked on Linux: - `cargo clippy -p victory-shader --all-targets -- -D warnings`: clean (it failed before this change) - `cargo clippy -p victory-shader --all-targets --target x86_64-pc-windows-msvc -- -D warnings`: clean - `cargo test -p victory-shader`: 56 passed - `cargo fmt --check`, `cargo xtask policy`: ok
constant_color() feeds two #[cfg(windows)] tests (a D3D12 pipeline and
dxil.dll validation), but was itself unconditional, so on Linux the test
build warned that it was never used and clippy -D warnings failed. Gate it
on Windows and move its two imports (Attr, Shader) into it, since nothing
else in the test module uses them.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:56:55 +00:00
github-bot closed this pull request 2026-11-26 03:56:55 +00:00
Author
Owner

@⁠SkippySteve on GitHub · 2026-11-24 01:55 UTC · original

superseded by #262 (combined: keep helper + hermetic Linux container test)

**@⁠SkippySteve** on GitHub · 2026-11-24 01:55 UTC · [original](https://github.com/Marvisak/VIctory/pull/258#issuecomment-7119587526) superseded by #262 (combined: keep helper + hermetic Linux container test)

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!258
No description provided.