skia2/tests/sksl/shared/Structs.glsl
Brian Osman 02bc52284d Emit top-level StructDefinition for every struct
Previously, structs that were defined as part of a variable declaration
would end up declared similarly in the generated code. Now, global
variable declarations that include a struct definition generate two
separate program elements.

Bug: skia:11228
Change-Id: Id7ddde6931fe07a250c2c9c46153879005535fb3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/361359
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2021-01-28 19:50:09 +00:00

19 lines
232 B
GLSL

out vec4 sk_FragColor;
struct A {
int x;
int y;
};
A a1;
struct B {
float x;
float[2] y;
layout (binding = 1) A z;
};
B b1;
void main() {
a1.x = 0;
b1.x = 0.0;
sk_FragColor.x = float(a1.x) + b1.x;
}