Add more preamble tests

This commit is contained in:
Moritz Heinemann 2023-03-21 14:21:09 +01:00 committed by arcady-lunarg
parent 893145ead2
commit bdba39bae6
6 changed files with 120 additions and 0 deletions

View File

@ -0,0 +1,45 @@
glsl.-P.function.frag
Shader version: 450
0:? Sequence
-1:1 Function Definition: getColor( ( global 4-component vector of float)
-1:1 Function Parameters:
-1:1 Sequence
-1:1 Branch: Return with expression
-1:1 Constant:
-1:1 1.000000
-1:1 1.000000
-1:1 1.000000
-1:1 1.000000
0:5 Function Definition: main( ( global void)
0:5 Function Parameters:
0:7 Sequence
0:7 move second child to first child ( temp 4-component vector of float)
0:7 'color' (layout( location=0) out 4-component vector of float)
0:7 Function Call: getColor( ( global 4-component vector of float)
0:? Linker Objects
0:? 'color' (layout( location=0) out 4-component vector of float)
Linked fragment stage:
Shader version: 450
0:? Sequence
-1:1 Function Definition: getColor( ( global 4-component vector of float)
-1:1 Function Parameters:
-1:1 Sequence
-1:1 Branch: Return with expression
-1:1 Constant:
-1:1 1.000000
-1:1 1.000000
-1:1 1.000000
-1:1 1.000000
0:5 Function Definition: main( ( global void)
0:5 Function Parameters:
0:7 Sequence
0:7 move second child to first child ( temp 4-component vector of float)
0:7 'color' (layout( location=0) out 4-component vector of float)
0:7 Function Call: getColor( ( global 4-component vector of float)
0:? Linker Objects
0:? 'color' (layout( location=0) out 4-component vector of float)

View File

@ -0,0 +1,49 @@
glsl.-P.include.frag
Shader version: 450
Requested GL_GOOGLE_cpp_style_line_directive
Requested GL_GOOGLE_include_directive
0:? Sequence
0:1 Function Definition: getColor( ( global 4-component vector of float)
0:1 Function Parameters:
0:3 Sequence
0:3 Branch: Return with expression
0:3 Constant:
0:3 1.000000
0:3 1.000000
0:3 1.000000
0:3 1.000000
0:7 Function Definition: main( ( global void)
0:7 Function Parameters:
0:9 Sequence
0:9 move second child to first child ( temp 4-component vector of float)
0:9 'color' (layout( location=0) out 4-component vector of float)
0:9 Function Call: getColor( ( global 4-component vector of float)
0:? Linker Objects
0:? 'color' (layout( location=0) out 4-component vector of float)
Linked fragment stage:
Shader version: 450
Requested GL_GOOGLE_cpp_style_line_directive
Requested GL_GOOGLE_include_directive
0:? Sequence
0:1 Function Definition: getColor( ( global 4-component vector of float)
0:1 Function Parameters:
0:3 Sequence
0:3 Branch: Return with expression
0:3 Constant:
0:3 1.000000
0:3 1.000000
0:3 1.000000
0:3 1.000000
0:7 Function Definition: main( ( global void)
0:7 Function Parameters:
0:9 Sequence
0:9 move second child to first child ( temp 4-component vector of float)
0:9 'color' (layout( location=0) out 4-component vector of float)
0:9 Function Call: getColor( ( global 4-component vector of float)
0:? Linker Objects
0:? 'color' (layout( location=0) out 4-component vector of float)

View File

@ -0,0 +1,8 @@
#version 450
layout(location=0) out vec4 color;
void main()
{
color = getColor();
}

10
Test/glsl.-P.include.frag Normal file
View File

@ -0,0 +1,10 @@
#version 450
#include "glsl.-P.included.glsl"
layout(location=0) out vec4 color;
void main()
{
color = getColor();
}

View File

@ -0,0 +1,4 @@
vec4 getColor()
{
return vec4(1.0);
}

View File

@ -210,6 +210,10 @@ run -D -Od -e main -V -i -DUNDEFED -UIN_SHADER --D FOO=200 --undef-macro UNDEFED
diff -b $BASEDIR/hlsl.-D-U.frag.out $TARGETDIR/hlsl.-D-U.frag.out || HASERROR=1
run -P"#define TEST1" -i -l --preamble-text "#define TEST2" --p "#define TEST3" glsl.-P.frag > $TARGETDIR/glsl.-P.frag.out
diff -b $BASEDIR/glsl.-P.frag.out $TARGETDIR/glsl.-P.frag.out || HASERROR=1
run -i -l --preamble-text "vec4 getColor() { return vec4(1.0); }" glsl.-P.function.frag > $TARGETDIR/glsl.-P.function.frag.out
diff -b $BASEDIR/glsl.-P.function.frag.out $TARGETDIR/glsl.-P.function.frag.out || HASERROR=1
run -i -l --preamble-text "#extension GL_GOOGLE_include_directive : require" -I. glsl.-P.include.frag > $TARGETDIR/glsl.-P.include.frag.out
diff -b $BASEDIR/glsl.-P.include.frag.out $TARGETDIR/glsl.-P.include.frag.out || HASERROR=1
#
# Test --client and --target-env