Skip to content

Commit c20020a

Browse files
inner-daemonsclaude
andcommitted
fix(naga): clippy bool_assert_comparison + benches zero-init enum
- rewrite assert_eq!(x, true/false) as assert!(x)/assert!(!x) in the serde round-trip tests (naga clippy --all-targets --all-features was not run locally before) - benches glsl::Options.zero_initialize_workgroup_memory: true -> Polyfill (missed Phase-3 construction site; the other zero_init sites are hal::ProgrammableStage bools) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent baaf336 commit c20020a

4 files changed

Lines changed: 7 additions & 6 deletions

File tree

benches/benches/wgpu-benchmark/shader.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,8 @@ pub fn backends(ctx: BenchmarkContext) -> anyhow::Result<Vec<SubBenchResult>> {
471471
version: naga::back::glsl::Version::new_gles(320),
472472
writer_flags: naga::back::glsl::WriterFlags::empty(),
473473
binding_map: Default::default(),
474-
zero_initialize_workgroup_memory: true,
474+
zero_initialize_workgroup_memory:
475+
naga::back::ZeroInitializeWorkgroupMemoryMode::Polyfill,
475476
};
476477
for input in &inputs.inner {
477478
if !input.options.targets.unwrap().contains(Targets::GLSL) {

naga/src/back/spv/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1260,7 +1260,7 @@ mod serde_tests {
12601260
let json = serde_json::to_string(&opts).unwrap();
12611261
let back: Options = serde_json::from_str(&json).unwrap();
12621262
assert_eq!(back.lang_version, (1, 5));
1263-
assert_eq!(back.common.force_loop_bounding, false);
1263+
assert!(!back.common.force_loop_bounding);
12641264
assert!(back.debug_info.is_none());
12651265

12661266
// partial JSON works via serde(default)

naga/src/front/spv/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3291,13 +3291,13 @@ mod serde_tests {
32913291
};
32923292
let json = serde_json::to_string(&opts).unwrap();
32933293
let back: Options = serde_json::from_str(&json).unwrap();
3294-
assert_eq!(back.strict_capabilities, true);
3294+
assert!(back.strict_capabilities);
32953295
assert_eq!(back.block_ctx_dump_prefix.as_deref(), Some("dump"));
32963296

32973297
// serde(default): empty object deserializes to defaults (adjust_coordinate_space=true, strict_capabilities=true).
32983298
let def: Options = serde_json::from_str("{}").unwrap();
3299-
assert_eq!(def.adjust_coordinate_space, true);
3300-
assert_eq!(def.strict_capabilities, true);
3299+
assert!(def.adjust_coordinate_space);
3300+
assert!(def.strict_capabilities);
33013301
assert!(def.block_ctx_dump_prefix.is_none());
33023302
}
33033303
}

naga/src/front/wgsl/parse/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2441,7 +2441,7 @@ mod serde_tests {
24412441
// serde(default) falls back to Options::new() which sets capabilities = Capabilities::all().
24422442
let opts: Options = serde_json::from_str("{}").unwrap();
24432443
assert_eq!(opts.capabilities, Capabilities::all());
2444-
assert_eq!(opts.parse_doc_comments, false);
2444+
assert!(!opts.parse_doc_comments);
24452445
}
24462446

24472447
#[test]

0 commit comments

Comments
 (0)