Migrate all tests over to using Default Struct Layout

The WGSL spec has been updated with 'Default Struct Layouts':
https://github.com/gpuweb/gpuweb/pull/1447

This removes the `[[offset(n)]]` decoration, and replaces it with two optional decorations: `[[size(n)]]` and `[[align(n)]]`, and a sensible set of sizes and alignments for each type.

Most `[[stride(n)]]` decorations have also been removed from arrays.

Bug: tint:626
Bug: tint:629
Change-Id: Ib0d2741f61ea943e6fb99d00cbb5cab2f97ae7be
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/44280
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
Ben Clayton
2021-03-17 09:48:19 +00:00
committed by Commit Bot service account
parent 0008432827
commit c56868420d
34 changed files with 168 additions and 169 deletions

View File

@@ -486,7 +486,7 @@ TEST_F(RenderPipelineValidationTest, TextureViewDimensionCompatibility) {
TEST_F(RenderPipelineValidationTest, StorageBufferInVertexShaderNoLayout) {
wgpu::ShaderModule vsModuleWithStorageBuffer = utils::CreateShaderModuleFromWGSL(device, R"(
[[block]] struct Dst {
[[offset(0)]] data : [[stride(4)]] array<u32, 100>;
data : array<u32, 100>;
};
[[group(0), binding(0)]] var<storage_buffer> dst : [[access(read_write)]] Dst;
[[builtin(vertex_index)]] var<in> VertexIndex : u32;
@@ -703,7 +703,7 @@ TEST_F(RenderPipelineValidationTest, DISABLED_BindingsFromCorrectEntryPoint) {
wgpu::ShaderModule module = utils::CreateShaderModuleFromWGSL(device, R"(
[[block]] struct Uniforms {
[[offset 0]] data : vec4<f32>;
data : vec4<f32>;
};
[[binding 0, set 0]] var<uniform> var0 : Uniforms;
[[binding 1, set 0]] var<uniform> var1 : Uniforms;