Skip to content

Commit

Permalink
Naga: GLSL 410 does not support layout(binding = ...)
Browse files Browse the repository at this point in the history
Naga assumed that GLSL 410 supported layout(binding = ...) but it does not,
it only supports layout(location = ...). It is not possible to enable only
layout(location = ...) currently, so we need to predicate the feature on GLSL
420 instead.
  • Loading branch information
bes committed Mar 6, 2024
1 parent badb3c8 commit fdbcafb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ By @cwfitzgerald in [#5325](https://github.com/gfx-rs/wgpu/pull/5325).
#### Naga
- Make use of `GL_EXT_texture_shadow_lod` to support sampling a cube depth texture with an explicit LOD. By @cmrschwarz in #[5171](https://github.com/gfx-rs/wgpu/pull/5171).
- In spv-in, remove unnecessary "gl_PerVertex" name check so unused builtins will always be skipped. By @Imberflur in [#5227](https://github.com/gfx-rs/wgpu/pull/5227).
- GLSL 410 does not support layout(binding = ...), enable only for GLSL 420. By @bes in [#5357](https://github.com/gfx-rs/wgpu/pull/5357)

#### Tests

Expand Down
2 changes: 1 addition & 1 deletion naga/src/back/glsl/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ impl Version {
/// Note: `location=` for vertex inputs and fragment outputs is supported
/// unconditionally for GLES 300.
fn supports_explicit_locations(&self) -> bool {
*self >= Version::Desktop(410) || *self >= Version::new_gles(310)
*self >= Version::Desktop(420) || *self >= Version::new_gles(310)
}

fn supports_early_depth_test(&self) -> bool {
Expand Down

0 comments on commit fdbcafb

Please sign in to comment.