SPIRV-Cross/reference/opt/shaders/legacy/vert/struct-varying.legacy.vert
Hans-Kristian Arntzen 18bcc9b790 Do not disable temporary forwarding when we suppress usage tracking.
This subtle bug removed any expression validation for trivially swizzled
variables. Make usage suppression a more explicit concept rather than
just hacking off forwarded_temporaries.

There is some fallout here with loop generation since our expression
invalidation is currently a bit too naive to handle loops properly.
The forwarding bug masked this problem until now.

If part of the loop condition is also used in the body, we end up
reading an invalid expression, which in turn forces a temporary to be
generated in the condition block, not good. We'll need to be smarter
here ...
2019-07-23 19:18:44 +02:00

31 lines
469 B
GLSL

#version 100
struct Output
{
vec4 a;
vec2 b;
};
varying vec4 vout_a;
varying vec2 vout_b;
void main()
{
{
Output vout = Output(vec4(0.5), vec2(0.25));
vout_a = vout.a;
vout_b = vout.b;
}
{
Output vout = Output(vec4(0.5), vec2(0.25));
vout_a = vout.a;
vout_b = vout.b;
}
Output _22 = Output(vout_a, vout_b);
vout_a = _22.a;
vout_b = _22.b;
vout_a.x = 1.0;
vout_b.y = 1.0;
}