Merge pull request #991 from LoopDawg/resource-set-binding-fix
HLSL: Fix crash with --resource-set-binding [n] (global form, not per-register form)
This commit is contained in:
66
Test/baseResults/hlsl.explicitDescriptorSet-2.frag.out
Normal file
66
Test/baseResults/hlsl.explicitDescriptorSet-2.frag.out
Normal file
@@ -0,0 +1,66 @@
|
||||
hlsl.explicitDescriptorSet.frag
|
||||
// Module Version 10000
|
||||
// Generated by (magic number): 80001
|
||||
// Id's are bound by 31
|
||||
|
||||
Capability Shader
|
||||
Capability Sampled1D
|
||||
Capability SampledBuffer
|
||||
1: ExtInstImport "GLSL.std.450"
|
||||
MemoryModel Logical GLSL450
|
||||
EntryPoint Fragment 4 "main" 19
|
||||
ExecutionMode 4 OriginUpperLeft
|
||||
Source HLSL 500
|
||||
Name 4 "main"
|
||||
Name 9 "@main("
|
||||
Name 13 "g_sSamp2_amb"
|
||||
Name 19 "@entryPointOutput"
|
||||
Name 21 "g_sSamp"
|
||||
Name 24 "g_tTex1df4"
|
||||
Name 25 "$Global"
|
||||
MemberName 25($Global) 0 "floatval_amb"
|
||||
Name 27 ""
|
||||
Name 30 "floatbuff"
|
||||
Decorate 13(g_sSamp2_amb) DescriptorSet 3
|
||||
Decorate 13(g_sSamp2_amb) Binding 10
|
||||
Decorate 19(@entryPointOutput) Location 0
|
||||
Decorate 21(g_sSamp) DescriptorSet 3
|
||||
Decorate 21(g_sSamp) Binding 11
|
||||
Decorate 24(g_tTex1df4) DescriptorSet 3
|
||||
Decorate 24(g_tTex1df4) Binding 20
|
||||
MemberDecorate 25($Global) 0 Offset 0
|
||||
Decorate 25($Global) Block
|
||||
Decorate 27 DescriptorSet 3
|
||||
Decorate 30(floatbuff) DescriptorSet 3
|
||||
2: TypeVoid
|
||||
3: TypeFunction 2
|
||||
6: TypeFloat 32
|
||||
7: TypeVector 6(float) 4
|
||||
8: TypeFunction 7(fvec4)
|
||||
11: TypeSampler
|
||||
12: TypePointer UniformConstant 11
|
||||
13(g_sSamp2_amb): 12(ptr) Variable UniformConstant
|
||||
14: 6(float) Constant 0
|
||||
15: 7(fvec4) ConstantComposite 14 14 14 14
|
||||
18: TypePointer Output 7(fvec4)
|
||||
19(@entryPointOutput): 18(ptr) Variable Output
|
||||
21(g_sSamp): 12(ptr) Variable UniformConstant
|
||||
22: TypeImage 6(float) 1D sampled format:Unknown
|
||||
23: TypePointer UniformConstant 22
|
||||
24(g_tTex1df4): 23(ptr) Variable UniformConstant
|
||||
25($Global): TypeStruct 6(float)
|
||||
26: TypePointer Uniform 25($Global)
|
||||
27: 26(ptr) Variable Uniform
|
||||
28: TypeImage 6(float) Buffer sampled format:R32f
|
||||
29: TypePointer UniformConstant 28
|
||||
30(floatbuff): 29(ptr) Variable UniformConstant
|
||||
4(main): 2 Function None 3
|
||||
5: Label
|
||||
20: 7(fvec4) FunctionCall 9(@main()
|
||||
Store 19(@entryPointOutput) 20
|
||||
Return
|
||||
FunctionEnd
|
||||
9(@main(): 7(fvec4) Function None 8
|
||||
10: Label
|
||||
ReturnValue 15
|
||||
FunctionEnd
|
||||
66
Test/baseResults/hlsl.explicitDescriptorSet.frag.out
Normal file
66
Test/baseResults/hlsl.explicitDescriptorSet.frag.out
Normal file
@@ -0,0 +1,66 @@
|
||||
hlsl.explicitDescriptorSet.frag
|
||||
// Module Version 10000
|
||||
// Generated by (magic number): 80001
|
||||
// Id's are bound by 31
|
||||
|
||||
Capability Shader
|
||||
Capability Sampled1D
|
||||
Capability SampledBuffer
|
||||
1: ExtInstImport "GLSL.std.450"
|
||||
MemoryModel Logical GLSL450
|
||||
EntryPoint Fragment 4 "main" 19
|
||||
ExecutionMode 4 OriginUpperLeft
|
||||
Source HLSL 500
|
||||
Name 4 "main"
|
||||
Name 9 "@main("
|
||||
Name 13 "g_sSamp2_amb"
|
||||
Name 19 "@entryPointOutput"
|
||||
Name 21 "g_sSamp"
|
||||
Name 24 "g_tTex1df4"
|
||||
Name 25 "$Global"
|
||||
MemberName 25($Global) 0 "floatval_amb"
|
||||
Name 27 ""
|
||||
Name 30 "floatbuff"
|
||||
Decorate 13(g_sSamp2_amb) DescriptorSet 4
|
||||
Decorate 13(g_sSamp2_amb) Binding 10
|
||||
Decorate 19(@entryPointOutput) Location 0
|
||||
Decorate 21(g_sSamp) DescriptorSet 4
|
||||
Decorate 21(g_sSamp) Binding 11
|
||||
Decorate 24(g_tTex1df4) DescriptorSet 4
|
||||
Decorate 24(g_tTex1df4) Binding 20
|
||||
MemberDecorate 25($Global) 0 Offset 0
|
||||
Decorate 25($Global) Block
|
||||
Decorate 27 DescriptorSet 4
|
||||
Decorate 30(floatbuff) DescriptorSet 4
|
||||
2: TypeVoid
|
||||
3: TypeFunction 2
|
||||
6: TypeFloat 32
|
||||
7: TypeVector 6(float) 4
|
||||
8: TypeFunction 7(fvec4)
|
||||
11: TypeSampler
|
||||
12: TypePointer UniformConstant 11
|
||||
13(g_sSamp2_amb): 12(ptr) Variable UniformConstant
|
||||
14: 6(float) Constant 0
|
||||
15: 7(fvec4) ConstantComposite 14 14 14 14
|
||||
18: TypePointer Output 7(fvec4)
|
||||
19(@entryPointOutput): 18(ptr) Variable Output
|
||||
21(g_sSamp): 12(ptr) Variable UniformConstant
|
||||
22: TypeImage 6(float) 1D sampled format:Unknown
|
||||
23: TypePointer UniformConstant 22
|
||||
24(g_tTex1df4): 23(ptr) Variable UniformConstant
|
||||
25($Global): TypeStruct 6(float)
|
||||
26: TypePointer Uniform 25($Global)
|
||||
27: 26(ptr) Variable Uniform
|
||||
28: TypeImage 6(float) Buffer sampled format:R32f
|
||||
29: TypePointer UniformConstant 28
|
||||
30(floatbuff): 29(ptr) Variable UniformConstant
|
||||
4(main): 2 Function None 3
|
||||
5: Label
|
||||
20: 7(fvec4) FunctionCall 9(@main()
|
||||
Store 19(@entryPointOutput) 20
|
||||
Return
|
||||
FunctionEnd
|
||||
9(@main(): 7(fvec4) Function None 8
|
||||
10: Label
|
||||
ReturnValue 15
|
||||
FunctionEnd
|
||||
15
Test/hlsl.explicitDescriptorSet.frag
Normal file
15
Test/hlsl.explicitDescriptorSet.frag
Normal file
@@ -0,0 +1,15 @@
|
||||
SamplerState g_sSamp : register(s1);
|
||||
|
||||
Texture1D <float4> g_tTex1df4 : register(t0);
|
||||
|
||||
SamplerState g_sSamp2_amb;
|
||||
uniform float floatval_amb;
|
||||
|
||||
Buffer<float> floatbuff;
|
||||
|
||||
float4 main() : SV_Target0
|
||||
{
|
||||
g_sSamp2_amb;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -97,6 +97,12 @@ echo Configuring HLSL descriptor set and binding number manually
|
||||
$EXE -V -D -e main -H 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 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 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 location error
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user