transform: Do not generate block attributes

These are no longer necessary, and the attribute will soon be
deprecated and removed.

Bug: tint:1324
Change-Id: Ia3cdd4e9d9bd7bca45d734a06466993199b3e838
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/72085
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
This commit is contained in:
James Price 2021-12-09 15:45:03 +00:00
parent 7c0693d9fe
commit ebdfa5d303
23 changed files with 5 additions and 200 deletions

View File

@ -18,7 +18,6 @@
#include <string>
#include <utility>
#include "src/ast/struct_block_decoration.h"
#include "src/program_builder.h"
#include "src/sem/call.h"
#include "src/sem/variable.h"
@ -144,9 +143,7 @@ void ArrayLengthFromUniform::Run(CloneContext& ctx,
{ctx.dst->Member(
kBufferSizeMemberName,
ctx.dst->ty.array(ctx.dst->ty.vec4(ctx.dst->ty.u32()),
(max_buffer_size_index / 4) + 1))},
ast::DecorationList{ctx.dst->create<ast::StructBlockDecoration>()});
(max_buffer_size_index / 4) + 1))});
buffer_size_ubo = ctx.dst->Global(
ctx.dst->Sym(), ctx.dst->ty.Of(buffer_size_struct),
ast::StorageClass::kUniform,

View File

@ -34,7 +34,6 @@ namespace transform {
///
/// The generated uniform buffer will have the form:
/// ```
/// [[block]]
/// struct buffer_size_struct {
/// buffer_size : array<u32, 8>;
/// };

View File

@ -52,7 +52,6 @@ TEST_F(ArrayLengthFromUniformTest, Error_MissingSimplifyPointers) {
TEST_F(ArrayLengthFromUniformTest, Basic) {
auto* src = R"(
[[block]]
struct SB {
x : i32;
arr : array<i32>;
@ -67,14 +66,12 @@ fn main() {
)";
auto* expect = R"(
[[block]]
struct tint_symbol {
buffer_size : array<vec4<u32>, 1u>;
};
[[group(0), binding(30)]] var<uniform> tint_symbol_1 : tint_symbol;
[[block]]
struct SB {
x : i32;
arr : array<i32>;
@ -103,7 +100,6 @@ fn main() {
TEST_F(ArrayLengthFromUniformTest, WithStride) {
auto* src = R"(
[[block]]
struct SB {
x : i32;
y : f32;
@ -119,14 +115,12 @@ fn main() {
)";
auto* expect = R"(
[[block]]
struct tint_symbol {
buffer_size : array<vec4<u32>, 1u>;
};
[[group(0), binding(30)]] var<uniform> tint_symbol_1 : tint_symbol;
[[block]]
struct SB {
x : i32;
y : f32;
@ -156,27 +150,22 @@ fn main() {
TEST_F(ArrayLengthFromUniformTest, MultipleStorageBuffers) {
auto* src = R"(
[[block]]
struct SB1 {
x : i32;
arr1 : array<i32>;
};
[[block]]
struct SB2 {
x : i32;
arr2 : array<vec4<f32>>;
};
[[block]]
struct SB3 {
x : i32;
arr3 : array<vec4<f32>>;
};
[[block]]
struct SB4 {
x : i32;
arr4 : array<vec4<f32>>;
};
[[block]]
struct SB5 {
x : i32;
arr5 : array<vec4<f32>>;
@ -200,38 +189,32 @@ fn main() {
)";
auto* expect = R"(
[[block]]
struct tint_symbol {
buffer_size : array<vec4<u32>, 2u>;
};
[[group(0), binding(30)]] var<uniform> tint_symbol_1 : tint_symbol;
[[block]]
struct SB1 {
x : i32;
arr1 : array<i32>;
};
[[block]]
struct SB2 {
x : i32;
arr2 : array<vec4<f32>>;
};
[[block]]
struct SB3 {
x : i32;
arr3 : array<vec4<f32>>;
};
[[block]]
struct SB4 {
x : i32;
arr4 : array<vec4<f32>>;
};
[[block]]
struct SB5 {
x : i32;
arr5 : array<vec4<f32>>;
@ -277,27 +260,22 @@ fn main() {
TEST_F(ArrayLengthFromUniformTest, MultipleUnusedStorageBuffers) {
auto* src = R"(
[[block]]
struct SB1 {
x : i32;
arr1 : array<i32>;
};
[[block]]
struct SB2 {
x : i32;
arr2 : array<vec4<f32>>;
};
[[block]]
struct SB3 {
x : i32;
arr3 : array<vec4<f32>>;
};
[[block]]
struct SB4 {
x : i32;
arr4 : array<vec4<f32>>;
};
[[block]]
struct SB5 {
x : i32;
arr5 : array<vec4<f32>>;
@ -318,38 +296,32 @@ fn main() {
)";
auto* expect = R"(
[[block]]
struct tint_symbol {
buffer_size : array<vec4<u32>, 1u>;
};
[[group(0), binding(30)]] var<uniform> tint_symbol_1 : tint_symbol;
[[block]]
struct SB1 {
x : i32;
arr1 : array<i32>;
};
[[block]]
struct SB2 {
x : i32;
arr2 : array<vec4<f32>>;
};
[[block]]
struct SB3 {
x : i32;
arr3 : array<vec4<f32>>;
};
[[block]]
struct SB4 {
x : i32;
arr4 : array<vec4<f32>>;
};
[[block]]
struct SB5 {
x : i32;
arr5 : array<vec4<f32>>;
@ -392,7 +364,6 @@ fn main() {
TEST_F(ArrayLengthFromUniformTest, NoArrayLengthCalls) {
auto* src = R"(
[[block]]
struct SB {
x : i32;
arr : array<i32>;
@ -421,13 +392,11 @@ fn main() {
TEST_F(ArrayLengthFromUniformTest, MissingBindingPointToIndexMapping) {
auto* src = R"(
[[block]]
struct SB1 {
x : i32;
arr1 : array<i32>;
};
[[block]]
struct SB2 {
x : i32;
arr2 : array<vec4<f32>>;
@ -446,20 +415,17 @@ fn main() {
)";
auto* expect = R"(
[[block]]
struct tint_symbol {
buffer_size : array<vec4<u32>, 1u>;
};
[[group(0), binding(30)]] var<uniform> tint_symbol_1 : tint_symbol;
[[block]]
struct SB1 {
x : i32;
arr1 : array<i32>;
};
[[block]]
struct SB2 {
x : i32;
arr2 : array<vec4<f32>>;

View File

@ -26,7 +26,6 @@ using BindingRemapperTest = TransformTest;
TEST_F(BindingRemapperTest, NoRemappings) {
auto* src = R"(
[[block]]
struct S {
a : f32;
};
@ -52,7 +51,6 @@ fn f() {
TEST_F(BindingRemapperTest, RemapBindingPoints) {
auto* src = R"(
[[block]]
struct S {
a : f32;
};
@ -67,7 +65,6 @@ fn f() {
)";
auto* expect = R"(
[[block]]
struct S {
a : f32;
};
@ -96,7 +93,6 @@ fn f() {
TEST_F(BindingRemapperTest, RemapAccessControls) {
auto* src = R"(
[[block]]
struct S {
a : f32;
};
@ -113,7 +109,6 @@ fn f() {
)";
auto* expect = R"(
[[block]]
struct S {
a : f32;
};
@ -146,7 +141,6 @@ fn f() {
// decorations in type aliases. If not, just remove.
TEST_F(BindingRemapperTest, DISABLED_RemapAccessControlsWithAliases) {
auto* src = R"(
[[block]]
struct S {
a : f32;
};
@ -169,7 +163,6 @@ fn f() {
)";
auto* expect = R"(
[[block]]
struct S {
a : f32;
};
@ -206,7 +199,6 @@ fn f() {
TEST_F(BindingRemapperTest, RemapAll) {
auto* src = R"(
[[block]]
struct S {
a : f32;
};
@ -221,7 +213,6 @@ fn f() {
)";
auto* expect = R"(
[[block]]
struct S {
a : f32;
};
@ -252,7 +243,6 @@ fn f() {
TEST_F(BindingRemapperTest, BindingCollisionsSameEntryPoint) {
auto* src = R"(
[[block]]
struct S {
i : i32;
};
@ -272,7 +262,6 @@ fn f() {
)";
auto* expect = R"(
[[block]]
struct S {
i : i32;
};
@ -306,7 +295,6 @@ fn f() {
TEST_F(BindingRemapperTest, BindingCollisionsDifferentEntryPoints) {
auto* src = R"(
[[block]]
struct S {
i : i32;
};
@ -331,7 +319,6 @@ fn f2() {
)";
auto* expect = R"(
[[block]]
struct S {
i : i32;
};
@ -370,7 +357,6 @@ fn f2() {
TEST_F(BindingRemapperTest, NoData) {
auto* src = R"(
[[block]]
struct S {
a : f32;
};

View File

@ -38,7 +38,6 @@ TEST_F(CalculateArrayLengthTest, Error_MissingCalculateArrayLength) {
TEST_F(CalculateArrayLengthTest, Basic) {
auto* src = R"(
[[block]]
struct SB {
x : i32;
arr : array<i32>;
@ -53,7 +52,6 @@ fn main() {
)";
auto* expect = R"(
[[block]]
struct SB {
x : i32;
arr : array<i32>;
@ -80,7 +78,6 @@ fn main() {
TEST_F(CalculateArrayLengthTest, InSameBlock) {
auto* src = R"(
[[block]]
struct SB {
x : i32;
arr : array<i32>;
@ -97,7 +94,6 @@ fn main() {
)";
auto* expect = R"(
[[block]]
struct SB {
x : i32;
arr : array<i32>;
@ -126,7 +122,6 @@ fn main() {
TEST_F(CalculateArrayLengthTest, WithStride) {
auto* src = R"(
[[block]]
struct SB {
x : i32;
y : f32;
@ -142,7 +137,6 @@ fn main() {
)";
auto* expect = R"(
[[block]]
struct SB {
x : i32;
y : f32;
@ -170,7 +164,6 @@ fn main() {
TEST_F(CalculateArrayLengthTest, Nested) {
auto* src = R"(
[[block]]
struct SB {
x : i32;
arr : array<i32>;
@ -191,7 +184,6 @@ fn main() {
)";
auto* expect = R"(
[[block]]
struct SB {
x : i32;
arr : array<i32>;
@ -227,13 +219,11 @@ fn main() {
TEST_F(CalculateArrayLengthTest, MultipleStorageBuffers) {
auto* src = R"(
[[block]]
struct SB1 {
x : i32;
arr1 : array<i32>;
};
[[block]]
struct SB2 {
x : i32;
arr2 : array<vec4<f32>>;
@ -252,7 +242,6 @@ fn main() {
)";
auto* expect = R"(
[[block]]
struct SB1 {
x : i32;
arr1 : array<i32>;
@ -261,7 +250,6 @@ struct SB1 {
[[internal(intrinsic_buffer_size)]]
fn tint_symbol([[internal(disable_validation__ignore_constructible_function_parameter)]] buffer : SB1, result : ptr<function, u32>)
[[block]]
struct SB2 {
x : i32;
arr2 : array<vec4<f32>>;
@ -295,7 +283,6 @@ fn main() {
TEST_F(CalculateArrayLengthTest, Shadowing) {
auto* src = R"(
[[block]]
struct SB {
x : i32;
arr : array<i32>;
@ -316,7 +303,6 @@ fn main() {
auto* expect =
R"(
[[block]]
struct SB {
x : i32;
arr : array<i32>;

View File

@ -1320,7 +1320,6 @@ fn main2() -> tint_symbol_1 {
TEST_F(CanonicalizeEntryPointIOTest, Struct_LayoutDecorations) {
auto* src = R"(
[[block]]
struct FragmentInput {
[[size(16), location(1)]] value : f32;
[[builtin(position)]] [[align(32)]] coord : vec4<f32>;
@ -1338,7 +1337,6 @@ fn frag_main(inputs : FragmentInput) -> FragmentOutput {
)";
auto* expect = R"(
[[block]]
struct FragmentInput {
[[size(16)]]
value : f32;

View File

@ -24,7 +24,6 @@ using DecomposeMemoryAccessTest = TransformTest;
TEST_F(DecomposeMemoryAccessTest, SB_BasicLoad) {
auto* src = R"(
[[block]]
struct SB {
a : i32;
b : u32;
@ -80,7 +79,6 @@ fn main() {
)";
auto* expect = R"(
[[block]]
struct SB {
a : i32;
b : u32;
@ -222,7 +220,6 @@ fn main() {
TEST_F(DecomposeMemoryAccessTest, UB_BasicLoad) {
auto* src = R"(
[[block]]
struct UB {
a : i32;
b : u32;
@ -278,7 +275,6 @@ fn main() {
)";
auto* expect = R"(
[[block]]
struct UB {
a : i32;
b : u32;
@ -420,7 +416,6 @@ fn main() {
TEST_F(DecomposeMemoryAccessTest, SB_BasicStore) {
auto* src = R"(
[[block]]
struct SB {
a : i32;
b : u32;
@ -476,7 +471,6 @@ fn main() {
)";
auto* expect = R"(
[[block]]
struct SB {
a : i32;
b : u32;
@ -635,7 +629,6 @@ fn main() {
TEST_F(DecomposeMemoryAccessTest, LoadStructure) {
auto* src = R"(
[[block]]
struct SB {
a : i32;
b : u32;
@ -670,7 +663,6 @@ fn main() {
)";
auto* expect = R"(
[[block]]
struct SB {
a : i32;
b : u32;
@ -795,7 +787,6 @@ fn main() {
TEST_F(DecomposeMemoryAccessTest, StoreStructure) {
auto* src = R"(
[[block]]
struct SB {
a : i32;
b : u32;
@ -830,7 +821,6 @@ fn main() {
)";
auto* expect = R"(
[[block]]
struct SB {
a : i32;
b : u32;
@ -1005,7 +995,6 @@ struct S2 {
c : i32;
};
[[block]]
struct SB {
[[size(128)]]
a : i32;
@ -1040,7 +1029,6 @@ struct S2 {
c : i32;
};
[[block]]
struct SB {
[[size(128)]]
a : i32;
@ -1077,7 +1065,6 @@ struct S2 {
c : i32;
};
[[block]]
struct SB {
[[size(128)]]
a : i32;
@ -1108,7 +1095,6 @@ struct S2 {
c : i32;
};
[[block]]
struct SB {
[[size(128)]]
a : i32;
@ -1156,7 +1142,6 @@ type A2 = S2;
type A2_Array = [[stride(256)]] array<S2>;
[[block]]
struct SB {
[[size(128)]]
a : i32;
@ -1195,7 +1180,6 @@ type A2 = S2;
type A2_Array = [[stride(256)]] array<S2>;
[[block]]
struct SB {
[[size(128)]]
a : i32;
@ -1223,7 +1207,6 @@ fn main() {
TEST_F(DecomposeMemoryAccessTest, StorageBufferAtomics) {
auto* src = R"(
[[block]]
struct SB {
padding : vec4<f32>;
a : atomic<i32>;
@ -1261,7 +1244,6 @@ fn main() {
)";
auto* expect = R"(
[[block]]
struct SB {
padding : vec4<f32>;
a : atomic<i32>;

View File

@ -51,7 +51,6 @@ TEST_F(DecomposeStridedMatrixTest, MissingDependencySimplify) {
}
TEST_F(DecomposeStridedMatrixTest, ReadUniformMatrix) {
// [[block]]
// struct S {
// [[offset(16), stride(32)]]
// [[internal(ignore_stride_decoration)]]
@ -74,9 +73,6 @@ TEST_F(DecomposeStridedMatrixTest, ReadUniformMatrix) {
b.create<ast::StrideDecoration>(32),
b.Disable(ast::DisabledValidation::kIgnoreStrideDecoration),
}),
},
{
b.StructBlock(),
});
b.Global("s", b.ty.Of(S), ast::StorageClass::kUniform,
b.GroupAndBinding(0, 0));
@ -91,7 +87,6 @@ TEST_F(DecomposeStridedMatrixTest, ReadUniformMatrix) {
});
auto* expect = R"(
[[block]]
struct S {
[[size(16)]]
padding : u32;
@ -117,7 +112,6 @@ fn f() {
}
TEST_F(DecomposeStridedMatrixTest, ReadUniformColumn) {
// [[block]]
// struct S {
// [[offset(16), stride(32)]]
// [[internal(ignore_stride_decoration)]]
@ -140,9 +134,6 @@ TEST_F(DecomposeStridedMatrixTest, ReadUniformColumn) {
b.create<ast::StrideDecoration>(32),
b.Disable(ast::DisabledValidation::kIgnoreStrideDecoration),
}),
},
{
b.StructBlock(),
});
b.Global("s", b.ty.Of(S), ast::StorageClass::kUniform,
b.GroupAndBinding(0, 0));
@ -157,7 +148,6 @@ TEST_F(DecomposeStridedMatrixTest, ReadUniformColumn) {
});
auto* expect = R"(
[[block]]
struct S {
[[size(16)]]
padding : u32;
@ -179,7 +169,6 @@ fn f() {
}
TEST_F(DecomposeStridedMatrixTest, ReadUniformMatrix_DefaultStride) {
// [[block]]
// struct S {
// [[offset(16), stride(8)]]
// [[internal(ignore_stride_decoration)]]
@ -202,9 +191,6 @@ TEST_F(DecomposeStridedMatrixTest, ReadUniformMatrix_DefaultStride) {
b.create<ast::StrideDecoration>(8),
b.Disable(ast::DisabledValidation::kIgnoreStrideDecoration),
}),
},
{
b.StructBlock(),
});
b.Global("s", b.ty.Of(S), ast::StorageClass::kUniform,
b.GroupAndBinding(0, 0));
@ -219,7 +205,6 @@ TEST_F(DecomposeStridedMatrixTest, ReadUniformMatrix_DefaultStride) {
});
auto* expect = R"(
[[block]]
struct S {
[[size(16)]]
padding : u32;
@ -242,7 +227,6 @@ fn f() {
}
TEST_F(DecomposeStridedMatrixTest, ReadStorageMatrix) {
// [[block]]
// struct S {
// [[offset(8), stride(32)]]
// [[internal(ignore_stride_decoration)]]
@ -265,9 +249,6 @@ TEST_F(DecomposeStridedMatrixTest, ReadStorageMatrix) {
b.create<ast::StrideDecoration>(32),
b.Disable(ast::DisabledValidation::kIgnoreStrideDecoration),
}),
},
{
b.StructBlock(),
});
b.Global("s", b.ty.Of(S), ast::StorageClass::kStorage,
ast::Access::kReadWrite, b.GroupAndBinding(0, 0));
@ -282,7 +263,6 @@ TEST_F(DecomposeStridedMatrixTest, ReadStorageMatrix) {
});
auto* expect = R"(
[[block]]
struct S {
[[size(8)]]
padding : u32;
@ -308,7 +288,6 @@ fn f() {
}
TEST_F(DecomposeStridedMatrixTest, ReadStorageColumn) {
// [[block]]
// struct S {
// [[offset(16), stride(32)]]
// [[internal(ignore_stride_decoration)]]
@ -331,9 +310,6 @@ TEST_F(DecomposeStridedMatrixTest, ReadStorageColumn) {
b.create<ast::StrideDecoration>(32),
b.Disable(ast::DisabledValidation::kIgnoreStrideDecoration),
}),
},
{
b.StructBlock(),
});
b.Global("s", b.ty.Of(S), ast::StorageClass::kStorage,
ast::Access::kReadWrite, b.GroupAndBinding(0, 0));
@ -348,7 +324,6 @@ TEST_F(DecomposeStridedMatrixTest, ReadStorageColumn) {
});
auto* expect = R"(
[[block]]
struct S {
[[size(16)]]
padding : u32;
@ -370,7 +345,6 @@ fn f() {
}
TEST_F(DecomposeStridedMatrixTest, WriteStorageMatrix) {
// [[block]]
// struct S {
// [[offset(8), stride(32)]]
// [[internal(ignore_stride_decoration)]]
@ -393,9 +367,6 @@ TEST_F(DecomposeStridedMatrixTest, WriteStorageMatrix) {
b.create<ast::StrideDecoration>(32),
b.Disable(ast::DisabledValidation::kIgnoreStrideDecoration),
}),
},
{
b.StructBlock(),
});
b.Global("s", b.ty.Of(S), ast::StorageClass::kStorage,
ast::Access::kReadWrite, b.GroupAndBinding(0, 0));
@ -411,7 +382,6 @@ TEST_F(DecomposeStridedMatrixTest, WriteStorageMatrix) {
});
auto* expect = R"(
[[block]]
struct S {
[[size(8)]]
padding : u32;
@ -437,7 +407,6 @@ fn f() {
}
TEST_F(DecomposeStridedMatrixTest, WriteStorageColumn) {
// [[block]]
// struct S {
// [[offset(8), stride(32)]]
// [[internal(ignore_stride_decoration)]]
@ -460,9 +429,6 @@ TEST_F(DecomposeStridedMatrixTest, WriteStorageColumn) {
b.create<ast::StrideDecoration>(32),
b.Disable(ast::DisabledValidation::kIgnoreStrideDecoration),
}),
},
{
b.StructBlock(),
});
b.Global("s", b.ty.Of(S), ast::StorageClass::kStorage,
ast::Access::kReadWrite, b.GroupAndBinding(0, 0));
@ -477,7 +443,6 @@ TEST_F(DecomposeStridedMatrixTest, WriteStorageColumn) {
});
auto* expect = R"(
[[block]]
struct S {
[[size(8)]]
padding : u32;
@ -499,7 +464,6 @@ fn f() {
}
TEST_F(DecomposeStridedMatrixTest, ReadWriteViaPointerLets) {
// [[block]]
// struct S {
// [[offset(8), stride(32)]]
// [[internal(ignore_stride_decoration)]]
@ -528,9 +492,6 @@ TEST_F(DecomposeStridedMatrixTest, ReadWriteViaPointerLets) {
b.create<ast::StrideDecoration>(32),
b.Disable(ast::DisabledValidation::kIgnoreStrideDecoration),
}),
},
{
b.StructBlock(),
});
b.Global("s", b.ty.Of(S), ast::StorageClass::kStorage,
ast::Access::kReadWrite, b.GroupAndBinding(0, 0));
@ -554,7 +515,6 @@ TEST_F(DecomposeStridedMatrixTest, ReadWriteViaPointerLets) {
});
auto* expect = R"(
[[block]]
struct S {
[[size(8)]]
padding : u32;

View File

@ -18,7 +18,6 @@
#include <unordered_map>
#include <utility>
#include "src/ast/struct_block_decoration.h"
#include "src/program_builder.h"
#include "src/sem/function.h"
#include "src/sem/member_accessor_expression.h"
@ -133,9 +132,7 @@ void FirstIndexOffset::Run(CloneContext& ctx,
instance_index_offset = offset;
offset += 4;
}
auto* struct_ =
ctx.dst->Structure(ctx.dst->Sym(), std::move(members),
{ctx.dst->create<ast::StructBlockDecoration>()});
auto* struct_ = ctx.dst->Structure(ctx.dst->Sym(), std::move(members));
// Create a global to hold the uniform buffer
Symbol buffer_name = ctx.dst->Sym();

View File

@ -41,7 +41,6 @@ namespace transform {
/// }
///
/// After:
/// [[block]]
/// struct TintFirstIndexOffsetData {
/// tint_first_vertex_index : u32;
/// tint_first_instance_index : u32;

View File

@ -59,7 +59,6 @@ fn entry([[builtin(vertex_index)]] vert_idx : u32) -> [[builtin(position)]] vec4
)";
auto* expect = R"(
[[block]]
struct tint_symbol {
first_vertex_index : u32;
};
@ -106,7 +105,6 @@ fn entry([[builtin(instance_index)]] inst_idx : u32) -> [[builtin(position)]] ve
)";
auto* expect = R"(
[[block]]
struct tint_symbol {
first_instance_index : u32;
};
@ -158,7 +156,6 @@ fn entry(inputs : Inputs) -> [[builtin(position)]] vec4<f32> {
)";
auto* expect = R"(
[[block]]
struct tint_symbol {
first_vertex_index : u32;
first_instance_index : u32;
@ -217,7 +214,6 @@ fn entry([[builtin(vertex_index)]] vert_idx : u32) -> [[builtin(position)]] vec4
)";
auto* expect = R"(
[[block]]
struct tint_symbol {
first_vertex_index : u32;
};
@ -280,7 +276,6 @@ fn entry_c([[builtin(instance_index)]] inst_idx : u32) -> [[builtin(position)]]
)";
auto* expect = R"(
[[block]]
struct tint_symbol {
first_vertex_index : u32;
first_instance_index : u32;

View File

@ -33,7 +33,6 @@ namespace transform {
///
/// Before:
/// ```
/// [[block]]
/// struct S {
/// f : f32;
/// };

View File

@ -199,7 +199,6 @@ fn main() {
TEST_F(ModuleScopeVarToEntryPointParamTest, Buffers_Basic) {
auto* src = R"(
[[block]]
struct S {
a : f32;
};
@ -217,7 +216,6 @@ fn main() {
)";
auto* expect = R"(
[[block]]
struct S {
a : f32;
};
@ -236,7 +234,6 @@ fn main([[group(0), binding(0), internal(disable_validation__entry_point_paramet
TEST_F(ModuleScopeVarToEntryPointParamTest, Buffers_FunctionCalls) {
auto* src = R"(
[[block]]
struct S {
a : f32;
};
@ -268,7 +265,6 @@ fn main() {
)";
auto* expect = R"(
[[block]]
struct S {
a : f32;
};
@ -490,7 +486,6 @@ fn main([[internal(disable_validation__entry_point_parameter)]] tint_symbol_1 :
TEST_F(ModuleScopeVarToEntryPointParamTest, UnusedVariables) {
auto* src = R"(
[[block]]
struct S {
a : f32;
};
@ -512,7 +507,6 @@ fn main() {
)";
auto* expect = R"(
[[block]]
struct S {
a : f32;
};

View File

@ -241,8 +241,7 @@ struct MultiplanarExternalTexture::State {
params_struct_sym = b.Symbols().New("ExternalTextureParams");
b.Structure(params_struct_sym, member_list,
ast::DecorationList{b.StructBlock()});
b.Structure(params_struct_sym, member_list);
}
/// Constructs a StatementList containing all the statements making up the

View File

@ -78,7 +78,6 @@ fn main([[builtin(position)]] coord : vec4<f32>) -> [[location(0)]] vec4<f32> {
)";
auto* expect = R"(
[[block]]
struct ExternalTextureParams {
numPlanes : u32;
vr : f32;
@ -123,7 +122,6 @@ fn main([[builtin(position)]] coord : vec4<f32>) -> [[location(0)]] vec4<f32> {
auto* expect = R"(
[[group(0), binding(0)]] var s : sampler;
[[block]]
struct ExternalTextureParams {
numPlanes : u32;
vr : f32;
@ -177,7 +175,6 @@ fn main([[builtin(position)]] coord : vec4<f32>) -> [[location(0)]] vec4<f32> {
)";
auto* expect = R"(
[[block]]
struct ExternalTextureParams {
numPlanes : u32;
vr : f32;
@ -235,7 +232,6 @@ fn main([[builtin(position)]] coord : vec4<f32>) -> [[location(0)]] vec4<f32> {
auto* expect = R"(
[[group(0), binding(0)]] var s : sampler;
[[block]]
struct ExternalTextureParams {
numPlanes : u32;
vr : f32;
@ -309,7 +305,6 @@ fn main([[builtin(position)]] coord : vec4<f32>) -> [[location(0)]] vec4<f32> {
auto* expect = R"(
[[group(0), binding(0)]] var s : sampler;
[[block]]
struct ExternalTextureParams {
numPlanes : u32;
vr : f32;
@ -392,7 +387,6 @@ fn main() {
)";
auto* expect = R"(
[[block]]
struct ExternalTextureParams {
numPlanes : u32;
vr : f32;
@ -459,7 +453,6 @@ fn main() {
)";
auto* expect = R"(
[[block]]
struct ExternalTextureParams {
numPlanes : u32;
vr : f32;
@ -528,7 +521,6 @@ fn main() {
)";
auto* expect = R"(
[[block]]
struct ExternalTextureParams {
numPlanes : u32;
vr : f32;
@ -607,7 +599,6 @@ fn main() {
)";
auto* expect = R"(
[[block]]
struct ExternalTextureParams {
numPlanes : u32;
vr : f32;

View File

@ -122,8 +122,7 @@ void NumWorkgroupsFromUniform::Run(CloneContext& ctx,
auto* num_workgroups_struct = ctx.dst->Structure(
ctx.dst->Sym(),
{ctx.dst->Member(kNumWorkgroupsMemberName,
ctx.dst->ty.vec3(ctx.dst->ty.u32()))},
ast::DecorationList{ctx.dst->create<ast::StructBlockDecoration>()});
ctx.dst->ty.vec3(ctx.dst->ty.u32()))});
num_workgroups_ubo = ctx.dst->Global(
ctx.dst->Sym(), ctx.dst->ty.Of(num_workgroups_struct),
ast::StorageClass::kUniform,

View File

@ -30,7 +30,6 @@ namespace transform {
///
/// The generated uniform buffer will have the form:
/// ```
/// [[block]]
/// struct num_workgroups_struct {
/// num_workgroups : vec3<u32>;
/// };

View File

@ -66,7 +66,6 @@ fn main([[builtin(num_workgroups)]] num_wgs : vec3<u32>) {
)";
auto* expect = R"(
[[block]]
struct tint_symbol_2 {
num_workgroups : vec3<u32>;
};
@ -109,7 +108,6 @@ fn main(in : Builtins) {
)";
auto* expect = R"(
[[block]]
struct tint_symbol_2 {
num_workgroups : vec3<u32>;
};
@ -158,7 +156,6 @@ fn main(in : Builtins) {
)";
auto* expect = R"(
[[block]]
struct tint_symbol_2 {
num_workgroups : vec3<u32>;
};
@ -234,7 +231,6 @@ fn main3([[builtin(num_workgroups)]] num_wgs : vec3<u32>) {
)";
auto* expect = R"(
[[block]]
struct tint_symbol_6 {
num_workgroups : vec3<u32>;
};

View File

@ -64,7 +64,6 @@ var<private> arr : array<tint_padded_array_element, 4u>;
TEST_F(PadArrayElementsTest, RuntimeArray) {
auto* src = R"(
[[block]]
struct S {
rta : [[stride(8)]] array<i32>;
};
@ -75,7 +74,6 @@ struct tint_padded_array_element {
el : i32;
};
[[block]]
struct S {
rta : array<tint_padded_array_element>;
};

View File

@ -173,7 +173,6 @@ fn f() {
TEST_F(RemovePhoniesTest, ForLoop) {
auto* src = R"(
[[block]]
struct S {
arr : array<i32>;
};
@ -203,7 +202,6 @@ fn f() {
)";
auto* expect = R"(
[[block]]
struct S {
arr : array<i32>;
};

View File

@ -174,7 +174,6 @@ fn f() {
// 0xffffffff. If WGSL supports 64-bit indexing, re-enable this test.
TEST_F(RobustnessTest, DISABLED_LargeArrays_Idx) {
auto* src = R"(
[[block]]
struct S {
a : array<f32, 0x7fffffff>;
b : array<f32>;
@ -213,7 +212,6 @@ fn f() {
)";
auto* expect = R"(
[[block]]
struct S {
a : array<f32, 2147483647>;
b : array<f32>;
@ -617,7 +615,6 @@ TEST_F(RobustnessTest, DISABLED_Matrix_Row_Constant_Id_Clamps) {
TEST_F(RobustnessTest, RuntimeArray_Clamps) {
auto* src = R"(
[[block]]
struct S {
a : f32;
b : array<f32>;
@ -630,7 +627,6 @@ fn f() {
)";
auto* expect = R"(
[[block]]
struct S {
a : f32;
b : array<f32>;
@ -778,7 +774,6 @@ TEST_F(RobustnessTest, DISABLED_Shadowed_Variable) {
// Check that existing use of min() and arrayLength() do not get renamed.
TEST_F(RobustnessTest, DontRenameSymbols) {
auto* src = R"(
[[block]]
struct S {
a : f32;
b : array<f32>;
@ -796,7 +791,6 @@ fn f() {
)";
auto* expect = R"(
[[block]]
struct S {
a : f32;
b : array<f32>;
@ -819,7 +813,6 @@ fn f() {
}
const char* kOmitSourceShader = R"(
[[block]]
struct S {
a : array<f32, 4>;
b : array<f32>;
@ -827,7 +820,7 @@ struct S {
[[group(0), binding(0)]] var<storage, read> s : S;
type UArr = [[stride(16)]] array<f32, 4>;
[[block]] struct U {
struct U {
a : UArr;
};
[[group(1), binding(0)]] var<uniform> u : U;
@ -878,7 +871,6 @@ fn f() {
TEST_F(RobustnessTest, OmitNone) {
auto* expect = R"(
[[block]]
struct S {
a : array<f32, 4>;
b : array<f32>;
@ -888,7 +880,6 @@ struct S {
type UArr = [[stride(16)]] array<f32, 4>;
[[block]]
struct U {
a : UArr;
};
@ -943,7 +934,6 @@ fn f() {
TEST_F(RobustnessTest, OmitStorage) {
auto* expect = R"(
[[block]]
struct S {
a : array<f32, 4>;
b : array<f32>;
@ -953,7 +943,6 @@ struct S {
type UArr = [[stride(16)]] array<f32, 4>;
[[block]]
struct U {
a : UArr;
};
@ -1010,7 +999,6 @@ fn f() {
TEST_F(RobustnessTest, OmitUniform) {
auto* expect = R"(
[[block]]
struct S {
a : array<f32, 4>;
b : array<f32>;
@ -1020,7 +1008,6 @@ struct S {
type UArr = [[stride(16)]] array<f32, 4>;
[[block]]
struct U {
a : UArr;
};
@ -1077,7 +1064,6 @@ fn f() {
TEST_F(RobustnessTest, OmitBoth) {
auto* expect = R"(
[[block]]
struct S {
a : array<f32, 4>;
b : array<f32>;
@ -1087,7 +1073,6 @@ struct S {
type UArr = [[stride(16)]] array<f32, 4>;
[[block]]
struct U {
a : UArr;
};

View File

@ -19,7 +19,6 @@
#include "src/ast/assignment_statement.h"
#include "src/ast/bitcast_expression.h"
#include "src/ast/struct_block_decoration.h"
#include "src/ast/variable_decl_statement.h"
#include "src/program_builder.h"
#include "src/sem/variable.h"
@ -260,9 +259,6 @@ struct State {
{
ctx.dst->Member(GetStructBufferName(),
ctx.dst->ty.array<ProgramBuilder::u32>(4)),
},
{
ctx.dst->create<ast::StructBlockDecoration>(),
});
for (uint32_t i = 0; i < cfg.vertex_state.size(); ++i) {
// The decorated variable with struct type

View File

@ -107,7 +107,6 @@ fn main() -> [[builtin(position)]] vec4<f32> {
)";
auto* expect = R"(
[[block]]
struct TintVertexData {
tint_vertex_data : [[stride(4)]] array<u32>;
};
@ -137,7 +136,6 @@ fn main([[location(0)]] var_a : f32) -> [[builtin(position)]] vec4<f32> {
)";
auto* expect = R"(
[[block]]
struct TintVertexData {
tint_vertex_data : [[stride(4)]] array<u32>;
};
@ -176,7 +174,6 @@ fn main([[location(0)]] var_a : f32) -> [[builtin(position)]] vec4<f32> {
)";
auto* expect = R"(
[[block]]
struct TintVertexData {
tint_vertex_data : [[stride(4)]] array<u32>;
};
@ -215,7 +212,6 @@ fn main([[location(0)]] var_a : f32) -> [[builtin(position)]] vec4<f32> {
)";
auto* expect = R"(
[[block]]
struct TintVertexData {
tint_vertex_data : [[stride(4)]] array<u32>;
};
@ -259,7 +255,6 @@ fn main(inputs : Inputs) -> [[builtin(position)]] vec4<f32> {
)";
auto* expect = R"(
[[block]]
struct TintVertexData {
tint_vertex_data : [[stride(4)]] array<u32>;
};
@ -308,7 +303,6 @@ fn main([[location(0)]] var_a : f32,
)";
auto* expect = R"(
[[block]]
struct TintVertexData {
tint_vertex_data : [[stride(4)]] array<u32>;
};
@ -369,7 +363,6 @@ fn main(inputs : Inputs) -> [[builtin(position)]] vec4<f32> {
)";
auto* expect = R"(
[[block]]
struct TintVertexData {
tint_vertex_data : [[stride(4)]] array<u32>;
};
@ -452,7 +445,6 @@ fn main(inputs : Inputs, indices : Indices) -> [[builtin(position)]] vec4<f32> {
)";
auto* expect = R"(
[[block]]
struct TintVertexData {
tint_vertex_data : [[stride(4)]] array<u32>;
};
@ -520,7 +512,6 @@ fn main([[location(0)]] var_a : f32,
)";
auto* expect = R"(
[[block]]
struct TintVertexData {
tint_vertex_data : [[stride(4)]] array<u32>;
};
@ -566,7 +557,6 @@ fn main([[location(0)]] var_a : vec2<f32>,
)";
auto* expect = R"(
[[block]]
struct TintVertexData {
tint_vertex_data : [[stride(4)]] array<u32>;
};
@ -623,7 +613,6 @@ fn main([[location(0)]] var_a : f32,
)";
auto* expect = R"(
[[block]]
struct TintVertexData {
tint_vertex_data_1 : [[stride(4)]] array<u32>;
};
@ -701,7 +690,6 @@ fn main(
)";
auto* expect = R"(
[[block]]
struct TintVertexData {
tint_vertex_data : [[stride(4)]] array<u32>;
};
@ -862,7 +850,6 @@ fn main(
auto* expect =
R"(
[[block]]
struct TintVertexData {
tint_vertex_data : [[stride(4)]] array<u32>;
};
@ -1022,7 +1009,6 @@ fn main(
)";
auto* expect = R"(
[[block]]
struct TintVertexData {
tint_vertex_data : [[stride(4)]] array<u32>;
};