glsl: Always emit structures

Skipping those that are block-decorated is not correct, as
block-decorated structures can also have non-buffer usages. This is
even clearer now that WGSL has removed the block attribute.

Bug: tint:1324
Change-Id: I6484766a5c541d39e2dc08beb3ae7b889759a3fb
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/72083
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
This commit is contained in:
James Price
2021-12-09 15:45:03 +00:00
parent 3a4443a681
commit c7c80c053d
76 changed files with 515 additions and 4 deletions

View File

@@ -23,6 +23,18 @@ struct Particle {
vec2 pos;
vec2 vel;
};
struct SimParams {
float deltaT;
float rule1Distance;
float rule2Distance;
float rule3Distance;
float rule1Scale;
float rule2Scale;
float rule3Scale;
};
struct Particles {
Particle particles[5];
};
struct tint_symbol_6 {
uvec3 tint_symbol;
};
@@ -71,6 +83,18 @@ struct Particle {
vec2 pos;
vec2 vel;
};
struct SimParams {
float deltaT;
float rule1Distance;
float rule2Distance;
float rule3Distance;
float rule1Scale;
float rule2Scale;
float rule3Scale;
};
struct Particles {
Particle particles[5];
};
struct tint_symbol_6 {
uvec3 tint_symbol;
};
@@ -107,6 +131,18 @@ struct Particle {
vec2 pos;
vec2 vel;
};
struct SimParams {
float deltaT;
float rule1Distance;
float rule2Distance;
float rule3Distance;
float rule1Scale;
float rule2Scale;
float rule3Scale;
};
struct Particles {
Particle particles[5];
};
layout (binding = 0) uniform SimParams_1 {
float deltaT;

View File

@@ -1,6 +1,9 @@
#version 310 es
precision mediump float;
struct Uniforms {
mat4 modelViewProjectionMatrix;
};
layout (binding = 0) uniform Uniforms_1 {
mat4 modelViewProjectionMatrix;
@@ -63,6 +66,9 @@ void main() {
#version 310 es
precision mediump float;
struct Uniforms {
mat4 modelViewProjectionMatrix;
};
struct VertexInput {
vec4 cur_position;
vec4 color;