Skip to content

Commit c6c7a54

Browse files
committed
test: fix reflect tests
1 parent 0e8b42f commit c6c7a54

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

librashader-cli/src/cli/main.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ struct ShaderFeatureArgs {
4444
/// `frametime-uniforms` defines `_HAS_FRAMETIME_UNIFORMS`.
4545
///
4646
/// Note that defines will disappear in the final output, and are only passed for reflection.
47-
#[arg(long, short='d')]
47+
#[arg(long, short = 'd')]
4848
features: Vec<ShaderDefinesEnums>,
4949
}
5050

librashader/tests/reflect.rs

+5-4
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ use librashader::reflect::FromCompilation;
1414
use librashader::reflect::OutputTarget;
1515
use librashader::reflect::SpirvCompilation;
1616

17+
use librashader_common::shader_features::ShaderFeatures;
1718
use librashader_pack::{LoadableResource, PassResource};
1819
use librashader_preprocess::PreprocessError;
1920
use librashader_presets::PassMeta;
@@ -29,7 +30,7 @@ fn collect_all_slang_presets(collect_is_error: bool) -> Vec<(PathBuf, ShaderPres
2930
.into_par_iter()
3031
.filter_map(|entry| {
3132
if let Ok(path) = entry {
32-
match ShaderPreset::try_parse(&path) {
33+
match ShaderPreset::try_parse(&path, ShaderFeatures::all()) {
3334
Ok(preset) => {
3435
#[cfg(not(feature = "github-ci"))]
3536
println!("[INFO] Parsing preset {path:?}");
@@ -59,7 +60,7 @@ fn collect_all_loadable_slang_presets() -> Vec<(PathBuf, ShaderPreset)> {
5960
!preset
6061
.passes
6162
.par_iter()
62-
.any(|shader| ShaderSource::load(&shader.path).is_err())
63+
.any(|shader| ShaderSource::load(&shader.path, ShaderFeatures::all()).is_err())
6364
});
6465

6566
presets
@@ -71,7 +72,7 @@ pub fn preprocess_all_slang_presets_parsed() {
7172

7273
for (path, preset) in presets {
7374
preset.passes.into_par_iter().for_each(|shader| {
74-
if let Err(e) = ShaderSource::load(&shader.path) {
75+
if let Err(e) = ShaderSource::load(&shader.path, ShaderFeatures::all()) {
7576
#[cfg(not(feature = "github-ci"))]
7677
eprintln!(
7778
"[ERROR] Failed to preprocess shader {} from preset {}: {:?}",
@@ -147,7 +148,7 @@ where
147148
.par_iter()
148149
.map(|p| {
149150
(
150-
PassMeta::load(&p.path).map(|data| PassResource {
151+
PassMeta::load(&p.path, ShaderFeatures::all()).map(|data| PassResource {
151152
meta: p.meta.clone(),
152153
data,
153154
}),

0 commit comments

Comments
 (0)