diff --git a/Test/baseResults/glsl.-P.function.frag.out b/Test/baseResults/glsl.-P.function.frag.out new file mode 100644 index 00000000..b753cd1f --- /dev/null +++ b/Test/baseResults/glsl.-P.function.frag.out @@ -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) + diff --git a/Test/baseResults/glsl.-P.include.frag.out b/Test/baseResults/glsl.-P.include.frag.out new file mode 100644 index 00000000..1ac63f5e --- /dev/null +++ b/Test/baseResults/glsl.-P.include.frag.out @@ -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) + diff --git a/Test/glsl.-P.function.frag b/Test/glsl.-P.function.frag new file mode 100644 index 00000000..086bb4dc --- /dev/null +++ b/Test/glsl.-P.function.frag @@ -0,0 +1,8 @@ +#version 450 + +layout(location=0) out vec4 color; + +void main() +{ + color = getColor(); +} diff --git a/Test/glsl.-P.include.frag b/Test/glsl.-P.include.frag new file mode 100644 index 00000000..fdadc717 --- /dev/null +++ b/Test/glsl.-P.include.frag @@ -0,0 +1,10 @@ +#version 450 + +#include "glsl.-P.included.glsl" + +layout(location=0) out vec4 color; + +void main() +{ + color = getColor(); +} diff --git a/Test/glsl.-P.included.glsl b/Test/glsl.-P.included.glsl new file mode 100644 index 00000000..d870f9f9 --- /dev/null +++ b/Test/glsl.-P.included.glsl @@ -0,0 +1,4 @@ +vec4 getColor() +{ + return vec4(1.0); +} diff --git a/Test/runtests b/Test/runtests index 75acef1a..112e29ed 100755 --- a/Test/runtests +++ b/Test/runtests @@ -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