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:
parent
efa5d3e3d3
commit
644d23b3f8
|
@ -58,18 +58,18 @@ void init() {
|
||||||
|
|
||||||
wgpu::ShaderModule vsModule = utils::CreateShaderModule(device, R"(
|
wgpu::ShaderModule vsModule = utils::CreateShaderModule(device, R"(
|
||||||
struct Constants {
|
struct Constants {
|
||||||
scale : f32;
|
scale : f32,
|
||||||
time : f32;
|
time : f32,
|
||||||
offsetX : f32;
|
offsetX : f32,
|
||||||
offsetY : f32;
|
offsetY : f32,
|
||||||
scalar : f32;
|
scalar : f32,
|
||||||
scalarOffset : f32;
|
scalarOffset : f32,
|
||||||
};
|
};
|
||||||
@group(0) @binding(0) var<uniform> c : Constants;
|
@group(0) @binding(0) var<uniform> c : Constants;
|
||||||
|
|
||||||
struct VertexOut {
|
struct VertexOut {
|
||||||
@location(0) v_color : vec4<f32>;
|
@location(0) v_color : vec4<f32>,
|
||||||
@builtin(position) Position : vec4<f32>;
|
@builtin(position) Position : vec4<f32>,
|
||||||
};
|
};
|
||||||
|
|
||||||
@vertex fn main(@builtin(vertex_index) VertexIndex : u32) -> VertexOut {
|
@vertex fn main(@builtin(vertex_index) VertexIndex : u32) -> VertexOut {
|
||||||
|
|
|
@ -97,9 +97,9 @@ void initBuffers() {
|
||||||
void initRender() {
|
void initRender() {
|
||||||
wgpu::ShaderModule vsModule = utils::CreateShaderModule(device, R"(
|
wgpu::ShaderModule vsModule = utils::CreateShaderModule(device, R"(
|
||||||
struct VertexIn {
|
struct VertexIn {
|
||||||
@location(0) a_particlePos : vec2<f32>;
|
@location(0) a_particlePos : vec2<f32>,
|
||||||
@location(1) a_particleVel : vec2<f32>;
|
@location(1) a_particleVel : vec2<f32>,
|
||||||
@location(2) a_pos : vec2<f32>;
|
@location(2) a_pos : vec2<f32>,
|
||||||
};
|
};
|
||||||
|
|
||||||
@vertex
|
@vertex
|
||||||
|
@ -149,21 +149,21 @@ void initRender() {
|
||||||
void initSim() {
|
void initSim() {
|
||||||
wgpu::ShaderModule module = utils::CreateShaderModule(device, R"(
|
wgpu::ShaderModule module = utils::CreateShaderModule(device, R"(
|
||||||
struct Particle {
|
struct Particle {
|
||||||
pos : vec2<f32>;
|
pos : vec2<f32>,
|
||||||
vel : vec2<f32>;
|
vel : vec2<f32>,
|
||||||
};
|
};
|
||||||
struct SimParams {
|
struct SimParams {
|
||||||
deltaT : f32;
|
deltaT : f32,
|
||||||
rule1Distance : f32;
|
rule1Distance : f32,
|
||||||
rule2Distance : f32;
|
rule2Distance : f32,
|
||||||
rule3Distance : f32;
|
rule3Distance : f32,
|
||||||
rule1Scale : f32;
|
rule1Scale : f32,
|
||||||
rule2Scale : f32;
|
rule2Scale : f32,
|
||||||
rule3Scale : f32;
|
rule3Scale : f32,
|
||||||
particleCount : u32;
|
particleCount : u32,
|
||||||
};
|
};
|
||||||
struct Particles {
|
struct Particles {
|
||||||
particles : array<Particle>;
|
particles : array<Particle>,
|
||||||
};
|
};
|
||||||
@binding(0) @group(0) var<uniform> params : SimParams;
|
@binding(0) @group(0) var<uniform> params : SimParams;
|
||||||
@binding(1) @group(0) var<storage, read_write> particlesA : Particles;
|
@binding(1) @group(0) var<storage, read_write> particlesA : Particles;
|
||||||
|
|
Loading…
Reference in New Issue