Skip to content

Commit

Permalink
feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
atlv24 committed Jan 11, 2025
1 parent 0fbac57 commit e1a6713
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
12 changes: 11 additions & 1 deletion naga/src/front/glsl/parser/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -274,9 +274,19 @@ impl ParsingContext<'_> {
qualifiers.precision = Some((p, token.meta));
}
TokenValue::MemoryQualifier(access) => {
let load_store = crate::StorageAccess::LOAD | crate::StorageAccess::STORE;
let storage_access = qualifiers
.storage_access
.get_or_insert((crate::StorageAccess::all(), Span::default()));
.get_or_insert((load_store, Span::default()));

if !storage_access.0.contains(!access & load_store) {
frontend.errors.push(Error {
kind: ErrorKind::SemanticError(
"The same memory qualifier can only be used once".into(),
),
meta: token.meta,
})
}

storage_access.0 &= access;
storage_access.1.subsume(token.meta);
Expand Down
2 changes: 1 addition & 1 deletion naga/tests/in/atomicTexture.param.ron
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
capabilities: [],
),
hlsl: (
shader_model: V6_6,
shader_model: V5_0,
binding_map: {},
fake_missing_bindings: true,
special_constants_binding: Some((space: 1, register: 0)),
Expand Down

0 comments on commit e1a6713

Please sign in to comment.