HLSL Tests: Remove optimization from tests that don't need it.

This is to create more stable test results.
This commit is contained in:
John Kessenich 2017-12-21 12:17:25 -07:00
parent 3b2dc1a756
commit b3cff2f297
4 changed files with 118 additions and 40 deletions

View File

@ -73,7 +73,7 @@ Shader version: 500
// Module Version 10000
// Generated by (magic number): 80003
// Id's are bound by 41
// Id's are bound by 34
Capability Shader
1: ExtInstImport "GLSL.std.450"
@ -81,9 +81,11 @@ Shader version: 500
EntryPoint Vertex 4 "main" 32
Source HLSL 500
Name 4 "main"
Name 9 "@main("
Name 11 "$Global"
MemberName 11($Global) 0 "pos"
Name 13 ""
Name 22 "@position"
Name 32 "@entryPointOutput"
MemberDecorate 11($Global) 0 Offset 0
Decorate 11($Global) Block
@ -93,21 +95,36 @@ Shader version: 500
3: TypeFunction 2
6: TypeFloat 32
7: TypeVector 6(float) 4
8: TypeFunction 7(fvec4)
11($Global): TypeStruct 7(fvec4)
12: TypePointer Uniform 11($Global)
13: 12(ptr) Variable Uniform
14: TypeInt 32 1
15: 14(int) Constant 0
16: TypePointer Uniform 7(fvec4)
21: TypePointer Function 7(fvec4)
24: TypeInt 32 0
25: 24(int) Constant 1
26: TypePointer Function 6(float)
31: TypePointer Output 7(fvec4)
32(@entryPointOutput): 31(ptr) Variable Output
4(main): 2 Function None 3
5: Label
35: 16(ptr) AccessChain 13 15
36: 7(fvec4) Load 35
38: 6(float) CompositeExtract 36 1
29: 6(float) FNegate 38
40: 7(fvec4) CompositeInsert 29 36 1
Store 32(@entryPointOutput) 40
22(@position): 21(ptr) Variable Function
23: 7(fvec4) FunctionCall 9(@main()
Store 22(@position) 23
27: 26(ptr) AccessChain 22(@position) 25
28: 6(float) Load 27
29: 6(float) FNegate 28
30: 26(ptr) AccessChain 22(@position) 25
Store 30 29
33: 7(fvec4) Load 22(@position)
Store 32(@entryPointOutput) 33
Return
FunctionEnd
9(@main(): 7(fvec4) Function None 8
10: Label
17: 16(ptr) AccessChain 13 15
18: 7(fvec4) Load 17
ReturnValue 18
FunctionEnd

View File

@ -81,7 +81,7 @@ Shader version: 500
// Module Version 10000
// Generated by (magic number): 80003
// Id's are bound by 43
// Id's are bound by 37
Capability Shader
1: ExtInstImport "GLSL.std.450"
@ -89,9 +89,14 @@ Shader version: 500
EntryPoint Vertex 4 "main" 35
Source HLSL 500
Name 4 "main"
Name 11 "@main(vf4;"
Name 10 "position"
Name 13 "$Global"
MemberName 13($Global) 0 "pos"
Name 15 ""
Name 21 "position"
Name 22 "param"
Name 25 "@position"
Name 35 "position"
MemberDecorate 13($Global) 0 Offset 0
Decorate 13($Global) Block
@ -101,21 +106,43 @@ Shader version: 500
3: TypeFunction 2
6: TypeFloat 32
7: TypeVector 6(float) 4
8: TypePointer Function 7(fvec4)
9: TypeFunction 2 8(ptr)
13($Global): TypeStruct 7(fvec4)
14: TypePointer Uniform 13($Global)
15: 14(ptr) Variable Uniform
16: TypeInt 32 1
17: 16(int) Constant 0
18: TypePointer Uniform 7(fvec4)
27: TypeInt 32 0
28: 27(int) Constant 1
29: TypePointer Function 6(float)
34: TypePointer Output 7(fvec4)
35(position): 34(ptr) Variable Output
4(main): 2 Function None 3
5: Label
37: 18(ptr) AccessChain 15 17
38: 7(fvec4) Load 37
40: 6(float) CompositeExtract 38 1
32: 6(float) FNegate 40
42: 7(fvec4) CompositeInsert 32 38 1
Store 35(position) 42
21(position): 8(ptr) Variable Function
22(param): 8(ptr) Variable Function
25(@position): 8(ptr) Variable Function
23: 2 FunctionCall 11(@main(vf4;) 22(param)
24: 7(fvec4) Load 22(param)
Store 21(position) 24
26: 7(fvec4) Load 21(position)
Store 25(@position) 26
30: 29(ptr) AccessChain 25(@position) 28
31: 6(float) Load 30
32: 6(float) FNegate 31
33: 29(ptr) AccessChain 25(@position) 28
Store 33 32
36: 7(fvec4) Load 25(@position)
Store 35(position) 36
Return
FunctionEnd
11(@main(vf4;): 2 Function None 9
10(position): 8(ptr) FunctionParameter
12: Label
19: 18(ptr) AccessChain 15 17
20: 7(fvec4) Load 19
Store 10(position) 20
Return
FunctionEnd

View File

@ -127,7 +127,7 @@ Shader version: 500
// Module Version 10000
// Generated by (magic number): 80003
// Id's are bound by 67
// Id's are bound by 50
Capability Shader
1: ExtInstImport "GLSL.std.450"
@ -138,9 +138,13 @@ Shader version: 500
Name 9 "VS_OUT"
MemberName 9(VS_OUT) 0 "pos"
MemberName 9(VS_OUT) 1 "somethingelse"
Name 11 "@main("
Name 14 "vsout"
Name 16 "$Global"
MemberName 16($Global) 0 "position"
Name 18 ""
Name 31 "flattenTemp"
Name 33 "@position"
Name 44 "@entryPointOutput.pos"
Name 47 "@entryPointOutput.somethingelse"
MemberDecorate 16($Global) 0 Offset 0
@ -154,24 +158,54 @@ Shader version: 500
7: TypeVector 6(float) 4
8: TypeInt 32 1
9(VS_OUT): TypeStruct 7(fvec4) 8(int)
10: TypeFunction 9(VS_OUT)
13: TypePointer Function 9(VS_OUT)
15: 8(int) Constant 0
16($Global): TypeStruct 7(fvec4)
17: TypePointer Uniform 16($Global)
18: 17(ptr) Variable Uniform
19: TypePointer Uniform 7(fvec4)
22: TypePointer Function 7(fvec4)
24: 8(int) Constant 1
25: 8(int) Constant 42
26: TypePointer Function 8(int)
36: TypeInt 32 0
37: 36(int) Constant 1
38: TypePointer Function 6(float)
43: TypePointer Output 7(fvec4)
44(@entryPointOutput.pos): 43(ptr) Variable Output
46: TypePointer Output 8(int)
47(@entryPointOutput.somethingelse): 46(ptr) Variable Output
4(main): 2 Function None 3
5: Label
52: 19(ptr) AccessChain 18 15
53: 7(fvec4) Load 52
64: 6(float) CompositeExtract 53 1
41: 6(float) FNegate 64
66: 7(fvec4) CompositeInsert 41 53 1
Store 44(@entryPointOutput.pos) 66
Store 47(@entryPointOutput.somethingelse) 25
31(flattenTemp): 13(ptr) Variable Function
33(@position): 22(ptr) Variable Function
32: 9(VS_OUT) FunctionCall 11(@main()
Store 31(flattenTemp) 32
34: 22(ptr) AccessChain 31(flattenTemp) 15
35: 7(fvec4) Load 34
Store 33(@position) 35
39: 38(ptr) AccessChain 33(@position) 37
40: 6(float) Load 39
41: 6(float) FNegate 40
42: 38(ptr) AccessChain 33(@position) 37
Store 42 41
45: 7(fvec4) Load 33(@position)
Store 44(@entryPointOutput.pos) 45
48: 26(ptr) AccessChain 31(flattenTemp) 24
49: 8(int) Load 48
Store 47(@entryPointOutput.somethingelse) 49
Return
FunctionEnd
11(@main(): 9(VS_OUT) Function None 10
12: Label
14(vsout): 13(ptr) Variable Function
20: 19(ptr) AccessChain 18 15
21: 7(fvec4) Load 20
23: 22(ptr) AccessChain 14(vsout) 15
Store 23 21
27: 26(ptr) AccessChain 14(vsout) 24
Store 27 25
28: 9(VS_OUT) Load 14(vsout)
ReturnValue 28
FunctionEnd

View File

@ -32,11 +32,11 @@ diff -b $BASEDIR/badMacroArgs.frag.out $TARGETDIR/badMacroArgs.frag.out || HASER
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 -Od hlsl.reflection.vert > $TARGETDIR/hlsl.reflection.vert.out
$EXE -D -Od -e flizv -l -q -C -V -Od 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 -Od hlsl.reflection.binding.frag > $TARGETDIR/hlsl.reflection.binding.frag.out
$EXE -D -Od -e main -l -q -C -V -Od 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
$EXE -D -e main -l -q --hlsl-iomap --auto-map-bindings --stb 10 --sbb 20 --ssb 30 --suavb 40 --scb 50 -D -V -e main -Od hlsl.automap.frag > $TARGETDIR/hlsl.automap.frag.out
$EXE -D -Od -e main -l -q --hlsl-iomap --auto-map-bindings --stb 10 --sbb 20 --ssb 30 --suavb 40 --scb 50 -D -V -e main -Od hlsl.automap.frag > $TARGETDIR/hlsl.automap.frag.out
diff -b $BASEDIR/hlsl.automap.frag.out $TARGETDIR/hlsl.automap.frag.out || HASERROR=1
#
@ -56,14 +56,14 @@ fi
# entry point renaming tests
#
echo Running entry-point renaming tests
$EXE -i -H -V -D -e main_in_spv --ku --source-entrypoint main -Od hlsl.entry.rename.frag > $TARGETDIR/hlsl.entry.rename.frag.out
$EXE -i -H -V -D -Od -e main_in_spv --ku --source-entrypoint main -Od hlsl.entry.rename.frag > $TARGETDIR/hlsl.entry.rename.frag.out
diff -b $BASEDIR/hlsl.entry.rename.frag.out $TARGETDIR/hlsl.entry.rename.frag.out || HASERROR=1
#
# Testing ill-defined uncalled function
#
echo Running ill-defined uncalled function
$EXE -D -e main -H -Od hlsl.deadFunctionMissingBody.vert > $TARGETDIR/hlsl.deadFunctionMissingBody.vert.out
$EXE -D -Od -e main -H -Od hlsl.deadFunctionMissingBody.vert > $TARGETDIR/hlsl.deadFunctionMissingBody.vert.out
diff -b $BASEDIR/hlsl.deadFunctionMissingBody.vert.out $TARGETDIR/hlsl.deadFunctionMissingBody.vert.out || HASERROR=1
if [ $HASERROR -eq 0 ]
@ -88,27 +88,27 @@ $EXE -i --hlsl-offsets -H spv.hlslOffsets.vert > $TARGETDIR/spv.hlslOffsets.vert
diff -b $BASEDIR/spv.hlslOffsets.vert.out $TARGETDIR/spv.hlslOffsets.vert.out || HASERROR=1
echo Running hlsl offsets
$EXE -i --hlsl-offsets -D -e main -H -Od hlsl.hlslOffset.vert > $TARGETDIR/hlsl.hlslOffset.vert.out
$EXE -i --hlsl-offsets -D -Od -e main -H -Od hlsl.hlslOffset.vert > $TARGETDIR/hlsl.hlslOffset.vert.out
diff -b $BASEDIR/hlsl.hlslOffset.vert.out $TARGETDIR/hlsl.hlslOffset.vert.out || HASERROR=1
#
# Testing --resource-set-binding
#
echo Configuring HLSL descriptor set and binding number manually
$EXE -V -D -e main -H -Od hlsl.multiDescriptorSet.frag --rsb frag t0 0 0 t1 1 0 s0 0 1 s1 1 1 b0 2 0 b1 2 1 b2 2 2 > $TARGETDIR/hlsl.multiDescriptorSet.frag.out
$EXE -V -D -Od -e main -H -Od hlsl.multiDescriptorSet.frag --rsb frag t0 0 0 t1 1 0 s0 0 1 s1 1 1 b0 2 0 b1 2 1 b2 2 2 > $TARGETDIR/hlsl.multiDescriptorSet.frag.out
diff -b $BASEDIR/hlsl.multiDescriptorSet.frag.out $TARGETDIR/hlsl.multiDescriptorSet.frag.out || HASERROR=1
$EXE -V -D -e main -H -Od hlsl.explicitDescriptorSet.frag --hlsl-iomap --amb --ssb 10 --stb 20 --rsb 4 > $TARGETDIR/hlsl.explicitDescriptorSet.frag.out
$EXE -V -D -Od -e main -H -Od hlsl.explicitDescriptorSet.frag --hlsl-iomap --amb --ssb 10 --stb 20 --rsb 4 > $TARGETDIR/hlsl.explicitDescriptorSet.frag.out
diff -b $BASEDIR/hlsl.explicitDescriptorSet.frag.out $TARGETDIR/hlsl.explicitDescriptorSet.frag.out || HASERROR=1
$EXE -V -D -e main -H -Od hlsl.explicitDescriptorSet.frag --hlsl-iomap --amb --ssb 10 --stb 20 --rsb frag 3 > $TARGETDIR/hlsl.explicitDescriptorSet-2.frag.out
$EXE -V -D -Od -e main -H -Od hlsl.explicitDescriptorSet.frag --hlsl-iomap --amb --ssb 10 --stb 20 --rsb frag 3 > $TARGETDIR/hlsl.explicitDescriptorSet-2.frag.out
diff -b $BASEDIR/hlsl.explicitDescriptorSet-2.frag.out $TARGETDIR/hlsl.explicitDescriptorSet-2.frag.out || HASERROR=1
#
# Testing per-descriptor-set IO map shift
#
echo 'Testing per-descriptor-set IO map shift'
$EXE -e main --hlsl-iomap --ssb 10 1 15 2 --stb 20 --stb 25 2 --suavb 30 --suavb 40 2 --sub 50 6 -i -q -D -V hlsl.shift.per-set.frag > $TARGETDIR/hlsl.shift.per-set.frag.out || HASERROR=1
$EXE -e main --hlsl-iomap --ssb 10 1 15 2 --stb 20 --stb 25 2 --suavb 30 --suavb 40 2 --sub 50 6 -i -q -D -Od -V hlsl.shift.per-set.frag > $TARGETDIR/hlsl.shift.per-set.frag.out || HASERROR=1
diff -b $BASEDIR/hlsl.shift.per-set.frag.out $TARGETDIR/hlsl.shift.per-set.frag.out || HASERROR=1
#
@ -129,7 +129,7 @@ echo Testing SPV Debug Information
$EXE -g --relaxed-errors --suppress-warnings --aml --hlsl-offsets --nsf \
-G -H spv.debugInfo.frag --rsb frag 3 > $TARGETDIR/spv.debugInfo.frag.out
diff -b $BASEDIR/spv.debugInfo.frag.out $TARGETDIR/spv.debugInfo.frag.out || HASERROR=1
$EXE -g -D -e newMain -g --amb --aml --fua --hlsl-iomap --nsf --sib 1 --ssb 2 --sbb 3 --stb 4 --suavb 5 --sub 6 \
$EXE -g -D -Od -e newMain -g --amb --aml --fua --hlsl-iomap --nsf --sib 1 --ssb 2 --sbb 3 --stb 4 --suavb 5 --sub 6 \
--sep origMain -H -Od spv.hlslDebugInfo.vert --rsb vert t0 0 0 > $TARGETDIR/spv.hlslDebugInfo.frag.out
diff -b $BASEDIR/spv.hlslDebugInfo.frag.out $TARGETDIR/spv.hlslDebugInfo.frag.out || HASERROR=1
@ -137,13 +137,13 @@ diff -b $BASEDIR/spv.hlslDebugInfo.frag.out $TARGETDIR/spv.hlslDebugInfo.frag.ou
# Testing Includer
#
echo Testing Includer
$EXE -D -e main -H -Od ../Test/hlsl.include.vert > $TARGETDIR/hlsl.include.vert.out
$EXE -D -Od -e main -H -Od ../Test/hlsl.include.vert > $TARGETDIR/hlsl.include.vert.out
diff -b $BASEDIR/hlsl.include.vert.out $TARGETDIR/hlsl.include.vert.out || HASERROR=1
$EXE -D -e main -H -Od hlsl.includeNegative.vert > $TARGETDIR/hlsl.includeNegative.vert.out
$EXE -D -Od -e main -H -Od hlsl.includeNegative.vert > $TARGETDIR/hlsl.includeNegative.vert.out
diff -b $BASEDIR/hlsl.includeNegative.vert.out $TARGETDIR/hlsl.includeNegative.vert.out || HASERROR=1
$EXE -l -i include.vert > $TARGETDIR/include.vert.out
diff -b $BASEDIR/include.vert.out $TARGETDIR/include.vert.out || HASERROR=1
$EXE -D -e main -H -Od -Iinc1/path1 -Iinc1/path2 hlsl.dashI.vert > $TARGETDIR/hlsl.dashI.vert.out
$EXE -D -Od -e main -H -Od -Iinc1/path1 -Iinc1/path2 hlsl.dashI.vert > $TARGETDIR/hlsl.dashI.vert.out
diff -b $BASEDIR/hlsl.dashI.vert.out $TARGETDIR/hlsl.dashI.vert.out || HASERROR=1
#
@ -152,7 +152,7 @@ diff -b $BASEDIR/hlsl.dashI.vert.out $TARGETDIR/hlsl.dashI.vert.out || HASERROR=
echo "Testing -D and -U"
$EXE -DUNDEFED -UIN_SHADER -DFOO=200 -i -l -UUNDEFED -DMUL=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
$EXE -D -e main -V -i -DUNDEFED -UIN_SHADER -DFOO=200 -UUNDEFED -Od hlsl.-D-U.frag > $TARGETDIR/hlsl.-D-U.frag.out
$EXE -D -Od -e main -V -i -DUNDEFED -UIN_SHADER -DFOO=200 -UUNDEFED -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
#
@ -190,11 +190,11 @@ diff -b $BASEDIR/remap.invalid-spirv-2.out $TARGETDIR/remap.invalid-spirv-2.out
# Testing position Y inversion
#
echo "Testing position Y inversion"
$EXE -H -e main -V -D -H -i --iy hlsl.y-negate-1.vert > $TARGETDIR/hlsl.y-negate-1.vert.out
$EXE -H -e main -V -D -Od -H -i --iy hlsl.y-negate-1.vert > $TARGETDIR/hlsl.y-negate-1.vert.out
diff -b $BASEDIR/hlsl.y-negate-1.vert.out $TARGETDIR/hlsl.y-negate-1.vert.out || HASERROR=1
$EXE -H -e main -V -D -H -i --invert-y hlsl.y-negate-2.vert > $TARGETDIR/hlsl.y-negate-2.vert.out
$EXE -H -e main -V -D -Od -H -i --invert-y hlsl.y-negate-2.vert > $TARGETDIR/hlsl.y-negate-2.vert.out
diff -b $BASEDIR/hlsl.y-negate-2.vert.out $TARGETDIR/hlsl.y-negate-2.vert.out || HASERROR=1
$EXE -H -e main -V -D -H -i --invert-y hlsl.y-negate-3.vert > $TARGETDIR/hlsl.y-negate-3.vert.out
$EXE -H -e main -V -D -Od -H -i --invert-y hlsl.y-negate-3.vert > $TARGETDIR/hlsl.y-negate-3.vert.out
diff -b $BASEDIR/hlsl.y-negate-3.vert.out $TARGETDIR/hlsl.y-negate-3.vert.out || HASERROR=1
#