Skip to content

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

Closed
SkippySteve wants to merge 1 commit into
Marvisak:mainfrom
SkippySteve:SkippySteve/shader-constant-color-cfg
Closed

SkippySteve wants to merge 1 commit into
Marvisak:mainfrom
SkippySteve:SkippySteve/shader-constant-color-cfg

Conversation

@SkippySteve

Copy link
Copy Markdown

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.
@SkippySteve

Copy link
Copy Markdown
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant