Convert align attribute to expressions.

This CL updates the align attribute to parse expressions.

Bug: tint:1633
Change-Id: I5412180ff62e6b286b35ea3297e2b4f136899960
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/102841
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
This commit is contained in:
dan sinclair
2022-09-26 15:54:55 +00:00
committed by Dawn LUCI CQ
parent 5b0bab84be
commit cb41b8f97f
17 changed files with 194 additions and 68 deletions

View File

@@ -1811,7 +1811,7 @@ TEST_F(InspectorGetUniformBufferResourceBindingsTest, ContainingArray) {
"foo_type",
utils::Vector{
Member("0i32", ty.i32()),
Member("b", ty.array(ty.u32(), 4_u, /*stride*/ 16), utils::Vector{MemberAlign(16_u)}),
Member("b", ty.array(ty.u32(), 4_u, /*stride*/ 16), utils::Vector{MemberAlign(16_i)}),
});
AddUniformBuffer("foo_ub", ty.Of(foo_struct_type), 0, 0);
@@ -3239,7 +3239,7 @@ TEST_F(InspectorGetWorkgroupStorageSizeTest, StructAlignment) {
// here the struct is expected to occupy 1024 bytes of workgroup storage.
const auto* wg_struct_type = MakeStructTypeFromMembers(
"WgStruct", utils::Vector{
MakeStructMember(0, ty.f32(), utils::Vector{MemberAlign(1024_u)}),
MakeStructMember(0, ty.f32(), utils::Vector{MemberAlign(1024_i)}),
});
AddWorkgroupStorage("wg_struct_var", ty.Of(wg_struct_type));