Add a forward reference function call test.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@20945 e7fa87d3-cd2b-0410-9028-fcbf551c1848
This commit is contained in:
parent
a067b588aa
commit
7d58d655c2
35
Test/forwardRef.frag
Normal file
35
Test/forwardRef.frag
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
uniform vec4 bigColor;
|
||||||
|
varying vec4 BaseColor;
|
||||||
|
uniform float d;
|
||||||
|
|
||||||
|
void bar();
|
||||||
|
float foo(vec4);
|
||||||
|
float unreachableReturn();
|
||||||
|
|
||||||
|
void main()
|
||||||
|
{
|
||||||
|
vec4 color = vec4(foo(BaseColor));
|
||||||
|
|
||||||
|
bar();
|
||||||
|
float f = unreachableReturn();
|
||||||
|
|
||||||
|
gl_FragColor = color * f;
|
||||||
|
}
|
||||||
|
|
||||||
|
void bar()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
float unreachableReturn()
|
||||||
|
{
|
||||||
|
bar();
|
||||||
|
if (d < 4.2)
|
||||||
|
return 1.2;
|
||||||
|
else
|
||||||
|
return 4.5;
|
||||||
|
}
|
||||||
|
|
||||||
|
float foo(vec4 bar)
|
||||||
|
{
|
||||||
|
return bar.x + bar.y;
|
||||||
|
}
|
||||||
@ -28,3 +28,4 @@ comment.frag
|
|||||||
constErrors.frag
|
constErrors.frag
|
||||||
constFold.frag
|
constFold.frag
|
||||||
errors.frag
|
errors.frag
|
||||||
|
forwardRef.frag
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user