Skip to content

Commit

Permalink
naga: Don't consider per-polygon inputs to be subgroup uniform
Browse files Browse the repository at this point in the history
Implementations can absolutely pack multiple triangles per subgroup.

Fixes #6270.
  • Loading branch information
magcius committed Sep 15, 2024
1 parent eb18854 commit f13a7c4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,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

Expand Down
9 changes: 1 addition & 8 deletions naga/src/valid/analyzer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::WorkGroupSize
| crate::BuiltIn::NumWorkGroups)
) => true,
// only flat inputs are uniform
Some(crate::Binding::Location {
interpolation: Some(crate::Interpolation::Flat),
..
}) => true,
_ => false,
};
Uniformity {
Expand Down

0 comments on commit f13a7c4

Please sign in to comment.