Update sample code WGSL.

This CL fixes up the sample code to use ',' instead of ';' for
struct members. This allows the Animometer and ComputeBoids samples
to execute again after the Tint change.

Change-Id: I96fae4fe3b96b0a6cc596edfd73013f2aa6ef0da
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/101060
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
dan sinclair 2022-09-01 18:19:19 +00:00 committed by Dawn LUCI CQ
parent efa5d3e3d3
commit 644d23b3f8
2 changed files with 22 additions and 22 deletions

View File

@ -58,18 +58,18 @@ void init() {
wgpu::ShaderModule vsModule = utils::CreateShaderModule(device, R"(
struct Constants {
scale : f32;
time : f32;
offsetX : f32;
offsetY : f32;
scalar : f32;
scalarOffset : f32;
scale : f32,
time : f32,
offsetX : f32,
offsetY : f32,
scalar : f32,
scalarOffset : f32,
};
@group(0) @binding(0) var<uniform> c : Constants;
struct VertexOut {
@location(0) v_color : vec4<f32>;
@builtin(position) Position : vec4<f32>;
@location(0) v_color : vec4<f32>,
@builtin(position) Position : vec4<f32>,
};
@vertex fn main(@builtin(vertex_index) VertexIndex : u32) -> VertexOut {

View File

@ -97,9 +97,9 @@ void initBuffers() {
void initRender() {
wgpu::ShaderModule vsModule = utils::CreateShaderModule(device, R"(
struct VertexIn {
@location(0) a_particlePos : vec2<f32>;
@location(1) a_particleVel : vec2<f32>;
@location(2) a_pos : vec2<f32>;
@location(0) a_particlePos : vec2<f32>,
@location(1) a_particleVel : vec2<f32>,
@location(2) a_pos : vec2<f32>,
};
@vertex
@ -149,21 +149,21 @@ void initRender() {
void initSim() {
wgpu::ShaderModule module = utils::CreateShaderModule(device, R"(
struct Particle {
pos : vec2<f32>;
vel : vec2<f32>;
pos : vec2<f32>,
vel : vec2<f32>,
};
struct SimParams {
deltaT : f32;
rule1Distance : f32;
rule2Distance : f32;
rule3Distance : f32;
rule1Scale : f32;
rule2Scale : f32;
rule3Scale : f32;
particleCount : u32;
deltaT : f32,
rule1Distance : f32,
rule2Distance : f32,
rule3Distance : f32,
rule1Scale : f32,
rule2Scale : f32,
rule3Scale : f32,
particleCount : u32,
};
struct Particles {
particles : array<Particle>;
particles : array<Particle>,
};
@binding(0) @group(0) var<uniform> params : SimParams;
@binding(1) @group(0) var<storage, read_write> particlesA : Particles;