From 644d23b3f8eec03e7f6a4fad39a9354740ede0a6 Mon Sep 17 00:00:00 2001 From: dan sinclair Date: Thu, 1 Sep 2022 18:19:19 +0000 Subject: [PATCH] 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 Commit-Queue: Dan Sinclair Reviewed-by: Corentin Wallez Auto-Submit: Dan Sinclair Commit-Queue: Corentin Wallez --- src/dawn/samples/Animometer.cpp | 16 ++++++++-------- src/dawn/samples/ComputeBoids.cpp | 28 ++++++++++++++-------------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/dawn/samples/Animometer.cpp b/src/dawn/samples/Animometer.cpp index 2138bb9b62..d19f84d5a6 100644 --- a/src/dawn/samples/Animometer.cpp +++ b/src/dawn/samples/Animometer.cpp @@ -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 c : Constants; struct VertexOut { - @location(0) v_color : vec4; - @builtin(position) Position : vec4; + @location(0) v_color : vec4, + @builtin(position) Position : vec4, }; @vertex fn main(@builtin(vertex_index) VertexIndex : u32) -> VertexOut { diff --git a/src/dawn/samples/ComputeBoids.cpp b/src/dawn/samples/ComputeBoids.cpp index 8237db41e3..bd57147e15 100644 --- a/src/dawn/samples/ComputeBoids.cpp +++ b/src/dawn/samples/ComputeBoids.cpp @@ -97,9 +97,9 @@ void initBuffers() { void initRender() { wgpu::ShaderModule vsModule = utils::CreateShaderModule(device, R"( struct VertexIn { - @location(0) a_particlePos : vec2; - @location(1) a_particleVel : vec2; - @location(2) a_pos : vec2; + @location(0) a_particlePos : vec2, + @location(1) a_particleVel : vec2, + @location(2) a_pos : vec2, }; @vertex @@ -149,21 +149,21 @@ void initRender() { void initSim() { wgpu::ShaderModule module = utils::CreateShaderModule(device, R"( struct Particle { - pos : vec2; - vel : vec2; + pos : vec2, + vel : vec2, }; 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; + particles : array, }; @binding(0) @group(0) var params : SimParams; @binding(1) @group(0) var particlesA : Particles;