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

@@ -7,6 +7,18 @@ struct Inner {
struct tint_padded_array_element {
Inner el;
};
struct S {
ivec3 a;
int b;
uvec3 c;
uint d;
vec3 e;
float f;
mat2x3 g;
mat3x2 h;
Inner i;
tint_padded_array_element j[4];
};
layout (binding = 0) buffer S_1 {
ivec3 a;

View File

@@ -7,6 +7,18 @@ struct Inner {
struct tint_padded_array_element {
Inner el;
};
struct S {
ivec3 a;
int b;
uvec3 c;
uint d;
vec3 e;
float f;
mat2x3 g;
mat3x2 h;
Inner i;
tint_padded_array_element j[4];
};
layout (binding = 0) buffer S_1 {
ivec3 a;

View File

@@ -14,6 +14,9 @@ struct Inner {
mat3x2 j;
ivec4 k[4];
};
struct S {
Inner arr[8];
};
layout (binding = 0) uniform S_1 {
Inner arr[8];

View File

@@ -7,6 +7,20 @@ struct Inner {
struct tint_padded_array_element {
Inner el;
};
struct S {
ivec3 a;
int b;
uvec3 c;
uint d;
vec3 e;
float f;
ivec2 g;
ivec2 h;
mat2x3 i;
mat3x2 j;
Inner k;
tint_padded_array_element l[4];
};
layout (binding = 0) uniform S_1 {
ivec3 a;