mirror of
https://github.com/RPCS3/glslang.git
synced 2024-12-01 07:01:12 +00:00
8ffc36aecc
- Add new queries: TProgram::getUniformTType and getUniformBlockTType, which return a const TType*, or nullptr on a bad index. These are valid for any source language. - Interface name for HLSL cbuffers is taken from the (only) available declaration name, whereas before it was always an empty string, which caused some troubles with reflection mapping them all to the same index slot. This also makes it appear in the SPIR-V binary instead of an empty string. - Print the binding as part of the reflection textual dump. - TType::clone becomes const. Needed to call it from a const method, and anyway it doesn't change the object it's called on. - Because the TObjectReflection constructor is called with a TType *reference* (not pointer) so that it's guaranteed to pass in a type, and the "badReflection" value should use a nullptr there, that now has a dedicated static method to obtain the bad value. It uses a private constructor, so external users can't create one with a nullptr type.
56 lines
1.5 KiB
Bash
Executable File
56 lines
1.5 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
TARGETDIR=localResults
|
|
BASEDIR=baseResults
|
|
EXE=../build/install/bin/glslangValidator
|
|
HASERROR=0
|
|
mkdir -p localResults
|
|
|
|
if [ -a localtestlist ]
|
|
then
|
|
while read t; do
|
|
echo Running $t...
|
|
b=`basename $t`
|
|
$EXE -i -l $t > $TARGETDIR/$b.out
|
|
diff -b $BASEDIR/$b.out $TARGETDIR/$b.out || HASERROR=1
|
|
done < localtestlist
|
|
fi
|
|
|
|
rm -f comp.spv frag.spv geom.spv tesc.spv tese.spv vert.spv
|
|
|
|
#
|
|
# special tests
|
|
#
|
|
|
|
$EXE badMacroArgs.frag > $TARGETDIR/badMacroArgs.frag.out
|
|
diff -b $BASEDIR/badMacroArgs.frag.out $TARGETDIR/badMacroArgs.frag.out || HASERROR=1
|
|
|
|
#
|
|
# reflection tests
|
|
#
|
|
echo Running reflection...
|
|
$EXE -l -q -C reflection.vert > $TARGETDIR/reflection.vert.out
|
|
diff -b $BASEDIR/reflection.vert.out $TARGETDIR/reflection.vert.out || HASERROR=1
|
|
$EXE -D -e flizv -l -q -C -V hlsl.reflection.vert > $TARGETDIR/hlsl.reflection.vert.out
|
|
diff -b $BASEDIR/hlsl.reflection.vert.out $TARGETDIR/hlsl.reflection.vert.out || HASERROR=1
|
|
$EXE -D -e main -l -q -C -V hlsl.reflection.binding.frag > $TARGETDIR/hlsl.reflection.binding.frag.out
|
|
diff -b $BASEDIR/hlsl.reflection.binding.frag.out $TARGETDIR/hlsl.reflection.binding.frag.out || HASERROR=1
|
|
|
|
|
|
#
|
|
# multi-threaded test
|
|
#
|
|
echo Comparing single thread to multithread for all tests in current directory...
|
|
$EXE -i -C *.vert *.geom *.frag *.tes* *.comp > singleThread.out
|
|
$EXE -i -C *.vert *.geom *.frag *.tes* *.comp -t > multiThread.out
|
|
diff singleThread.out multiThread.out || HASERROR=1
|
|
|
|
if [ $HASERROR -eq 0 ]
|
|
then
|
|
echo Tests Succeeded.
|
|
else
|
|
echo Tests Failed.
|
|
fi
|
|
|
|
exit $HASERROR
|