glslang SPV tests: Add a set of SPV tests.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@31212 e7fa87d3-cd2b-0410-9028-fcbf551c1848
This commit is contained in:
44
Test/spv.functionCall.frag
Normal file
44
Test/spv.functionCall.frag
Normal file
@@ -0,0 +1,44 @@
|
||||
#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;
|
||||
}
|
||||
Reference in New Issue
Block a user