mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-08 13:14:56 +00:00
[wgsl-reader][wgsl-writer] Update struct decorations to new syntax.
This CL updates the parsing of struct decorations to require ()'s around parameters. Bug: tint:238 Change-Id: Ia35ca5c260c3c57b5fc95788bd1aef07f75edc39 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/28600 Reviewed-by: Sarah Mashayekhi <sarahmashay@google.com> Commit-Queue: Sarah Mashayekhi <sarahmashay@google.com>
This commit is contained in:
committed by
Commit Bot service account
parent
d3f75ca0e8
commit
8b685866cd
@@ -42,22 +42,22 @@ entry_point fragment as "frag_main" = frag_main;
|
||||
|
||||
# compute shader
|
||||
type Particle = [[block]] struct {
|
||||
[[offset 0]] pos : vec2<f32>;
|
||||
[[offset 8]] vel : vec2<f32>;
|
||||
[[offset(0)]] pos : vec2<f32>;
|
||||
[[offset(8)]] vel : vec2<f32>;
|
||||
};
|
||||
|
||||
type SimParams = [[block]] struct {
|
||||
[[offset 0]] deltaT : f32;
|
||||
[[offset 4]] rule1Distance : f32;
|
||||
[[offset 8]] rule2Distance : f32;
|
||||
[[offset 12]] rule3Distance : f32;
|
||||
[[offset 16]] rule1Scale : f32;
|
||||
[[offset 20]] rule2Scale : f32;
|
||||
[[offset 24]] rule3Scale : f32;
|
||||
[[offset(0)]] deltaT : f32;
|
||||
[[offset(4)]] rule1Distance : f32;
|
||||
[[offset(8)]] rule2Distance : f32;
|
||||
[[offset(12)]] rule3Distance : f32;
|
||||
[[offset(16)]] rule1Scale : f32;
|
||||
[[offset(20)]] rule2Scale : f32;
|
||||
[[offset(24)]] rule3Scale : f32;
|
||||
};
|
||||
|
||||
type Particles = [[block]] struct {
|
||||
[[offset 0]] particles : [[stride 16]] array<Particle, 5>;
|
||||
[[offset(0)]] particles : [[stride 16]] array<Particle, 5>;
|
||||
};
|
||||
|
||||
[[binding 0, set 0]] var<uniform> params : SimParams;
|
||||
|
||||
@@ -17,7 +17,7 @@ entry_point fragment = frag_main;
|
||||
|
||||
# Vertex shader
|
||||
type Uniforms = [[block]] struct {
|
||||
[[offset 0]] modelViewProjectionMatrix : mat4x4<f32>;
|
||||
[[offset(0)]] modelViewProjectionMatrix : mat4x4<f32>;
|
||||
};
|
||||
|
||||
[[binding 0, set 0]] var<uniform> uniforms : Uniforms;
|
||||
|
||||
Reference in New Issue
Block a user