Files
filament/third_party/glslang/Test/functionCall.frag
Romain Guy 9f2592ed9d Update SPIRV libraries (#99)
* Update SPIRV libraries

- Update `spirv-cross`
- Update `spirv-tools`
- Update `glslang`

`spirv-tools` contains a fix for an issue we reported (unnecessary promotions to highp in certain expressions).

* Add SPIRV-Tools dependency to matinfo
2018-08-15 12:59:17 -07:00

45 lines
643 B
GLSL

#version 130
uniform vec4 bigColor;
varying vec4 BaseColor;
uniform float d;
float h = 0.0;
float foo(vec4 bar)
{
return bar.x + bar.y;
}
void bar()
{
}
float unreachableReturn()
{
if (d < 4.2)
return 1.2;
else
return 4.5;
// might be another return inserted here by builders, has to be correct type
}
float missingReturn()
{
if (d < 4.5) {
h = d;
return 3.9;
}
}
void main()
{
vec4 color = vec4(foo(BaseColor));
bar();
float f = unreachableReturn();
float g = missingReturn();
gl_FragColor = color * f * h;
}