Add option to glslangValidator to inject preamble
This commit is contained in:
parent
1aefd184a6
commit
893145ead2
4 changed files with 84 additions and 4 deletions
35
Test/baseResults/glsl.-P.frag.out
Normal file
35
Test/baseResults/glsl.-P.frag.out
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
glsl.-P.frag
|
||||
Shader version: 450
|
||||
0:? Sequence
|
||||
0:5 Function Definition: main( ( global void)
|
||||
0:5 Function Parameters:
|
||||
0:19 Sequence
|
||||
0:19 move second child to first child ( temp 4-component vector of float)
|
||||
0:19 'color' (layout( location=0) out 4-component vector of float)
|
||||
0:19 Constant:
|
||||
0:19 1.000000
|
||||
0:19 1.000000
|
||||
0:19 1.000000
|
||||
0:19 1.000000
|
||||
0:? Linker Objects
|
||||
0:? 'color' (layout( location=0) out 4-component vector of float)
|
||||
|
||||
|
||||
Linked fragment stage:
|
||||
|
||||
|
||||
Shader version: 450
|
||||
0:? Sequence
|
||||
0:5 Function Definition: main( ( global void)
|
||||
0:5 Function Parameters:
|
||||
0:19 Sequence
|
||||
0:19 move second child to first child ( temp 4-component vector of float)
|
||||
0:19 'color' (layout( location=0) out 4-component vector of float)
|
||||
0:19 Constant:
|
||||
0:19 1.000000
|
||||
0:19 1.000000
|
||||
0:19 1.000000
|
||||
0:19 1.000000
|
||||
0:? Linker Objects
|
||||
0:? 'color' (layout( location=0) out 4-component vector of float)
|
||||
|
||||
20
Test/glsl.-P.frag
Normal file
20
Test/glsl.-P.frag
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
#version 450
|
||||
|
||||
layout(location=0) out vec4 color;
|
||||
|
||||
void main()
|
||||
{
|
||||
#ifndef TEST1
|
||||
#error TEST1 is not defined
|
||||
#endif
|
||||
|
||||
#ifndef TEST2
|
||||
#error TEST2 is not defined
|
||||
#endif
|
||||
|
||||
#ifndef TEST3
|
||||
#error TEST3 is not defined
|
||||
#endif
|
||||
|
||||
color = vec4(1.0);
|
||||
}
|
||||
|
|
@ -18,7 +18,7 @@ if [ -d "${LIBPATH}" ]; then
|
|||
fi
|
||||
|
||||
function run {
|
||||
$EXE $@
|
||||
$EXE "$@"
|
||||
result=$?
|
||||
case "$result" in
|
||||
[0-6]) # Valid success and error codes
|
||||
|
|
@ -201,13 +201,15 @@ run -D -Od -e main -H --depfile $TARGETDIR/hlsl.dashI.vert.d.out -Od -Iinc1/path
|
|||
diff -b $BASEDIR/hlsl.dashI.vert.d.out $TARGETDIR/hlsl.dashI.vert.d.out || HASERROR=1
|
||||
|
||||
#
|
||||
# Testing -D and -U
|
||||
# Testing -D, -U and -P
|
||||
#
|
||||
echo "Testing -D and -U"
|
||||
echo "Testing -D, -U and -P"
|
||||
run -DUNDEFED -UIN_SHADER -DFOO=200 -i -l --U UNDEFED --define-macro MUL=FOO*2 glsl.-D-U.frag > $TARGETDIR/glsl.-D-U.frag.out
|
||||
diff -b $BASEDIR/glsl.-D-U.frag.out $TARGETDIR/glsl.-D-U.frag.out || HASERROR=1
|
||||
run -D -Od -e main -V -i -DUNDEFED -UIN_SHADER --D FOO=200 --undef-macro UNDEFED -Od hlsl.-D-U.frag > $TARGETDIR/hlsl.-D-U.frag.out
|
||||
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
|
||||
|
||||
#
|
||||
# Test --client and --target-env
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue