skia2/tests/sksl/shared/Offset.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

13 lines
188 B
GLSL

out vec4 sk_FragColor;
struct Test {
layout (offset = 0) int x;
layout (offset = 4) int y;
int z;
};
void main() {
Test t;
t.x = 0;
sk_FragColor.x = float(t.x);
}