mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-13 15:16:16 +00:00
spirv: Add block decorations with a transform
Any struct which is used as the store type of a buffer variable needs to have a block decoration. If that struct is nested inside an array or another struct, we wrap it inside another struct first. This removes the SPIR-V backend's reliance on the [[block]] attribute, which will soon be deprecated and removed. Bug: tint:1324 Change-Id: Ib6ad54f24a3e4a090da9faeed699f266abcb66ba Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/72082 Kokoro: Kokoro <noreply+kokoro@google.com> Reviewed-by: Ben Clayton <bclayton@google.com>
This commit is contained in:
@@ -2160,7 +2160,8 @@ bool Resolver::ValidateStructure(const sem::Struct* str) {
|
||||
}
|
||||
|
||||
for (auto* deco : str->Declaration()->decorations) {
|
||||
if (!(deco->Is<ast::StructBlockDecoration>())) {
|
||||
if (!(deco->IsAnyOf<ast::StructBlockDecoration,
|
||||
ast::InternalDecoration>())) {
|
||||
AddError("decoration is not valid for struct declarations", deco->source);
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user