From 390a4169fb9c9c538f57ec221e01221f2e8a099b Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Sat, 14 Sep 2024 20:34:20 -0700 Subject: [PATCH] naga: Don't consider per-polygon inputs to be subgroup uniform Implementations can absolutely pack multiple triangles per subgroup. Fixes #6270. --- CHANGELOG.md | 1 + naga/src/valid/analyzer.rs | 15 ++++----------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d4d021ddf..894da6ddc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -99,6 +99,7 @@ By @bradwerth [#6216](https://github.com/gfx-rs/wgpu/pull/6216). - Accept only `vec3` (not `vecN`) for the `cross` built-in. By @ErichDonGubler in [#6171](https://github.com/gfx-rs/wgpu/pull/6171). - Configure `SourceLanguage` when enabling debug info in SPV-out. By @kvark in [#6256](https://github.com/gfx-rs/wgpu/pull/6256) +- Per-polygon and flat inputs should not be considered subgroup uniform. By @magcius in [#6276](https://github.com/gfx-rs/wgpu/pull/6276). #### General diff --git a/naga/src/valid/analyzer.rs b/naga/src/valid/analyzer.rs index 89b3da6a4..af95fd098 100644 --- a/naga/src/valid/analyzer.rs +++ b/naga/src/valid/analyzer.rs @@ -589,23 +589,16 @@ impl FunctionInfo { requirements: UniformityRequirements::empty(), } } - // depends on the builtin or interpolation + // depends on the builtin E::FunctionArgument(index) => { let arg = &resolve_context.arguments[index as usize]; let uniform = match arg.binding { Some(crate::Binding::BuiltIn( - // per-polygon built-ins are uniform - crate::BuiltIn::FrontFacing // per-work-group built-ins are uniform - | crate::BuiltIn::WorkGroupId + crate::BuiltIn::WorkGroupId | crate::BuiltIn::WorkGroupSize - | crate::BuiltIn::NumWorkGroups) - ) => true, - // only flat inputs are uniform - Some(crate::Binding::Location { - interpolation: Some(crate::Interpolation::Flat), - .. - }) => true, + | crate::BuiltIn::NumWorkGroups, + )) => true, _ => false, }; Uniformity {