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

@@ -103,13 +103,13 @@ void init() {
wgpu::ShaderModule vsModule = utils::CreateShaderModuleFromWGSL(device, R"(
[[block]] struct Camera {
[[offset(0)]] view : mat4x4<f32>;
[[offset(64)]] proj : mat4x4<f32>;
view : mat4x4<f32>;
proj : mat4x4<f32>;
};
[[group(0), binding(0)]] var<uniform> camera : Camera;
[[block]] struct Model {
[[offset(0)]] matrix : mat4x4<f32>;
matrix : mat4x4<f32>;
};
[[group(0), binding(1)]] var<uniform> model : Model;