Unverified Commit 5cd155f0 by John Kessenich Committed by GitHub

Merge pull request #1343 from KhronosGroup/uint-counter-bufs

HLSL: Fix #1332: consistently use uint for counter buf typing.
parents c3a370db 6ae18707
hlsl.noSemantic.functionality1.comp hlsl.noSemantic.functionality1.comp
// Module Version 10000 // Module Version 10000
// Generated by (magic number): 80006 // Generated by (magic number): 80006
// Id's are bound by 31 // Id's are bound by 30
Capability Shader Capability Shader
Extension "SPV_GOOGLE_hlsl_functionality1" Extension "SPV_GOOGLE_hlsl_functionality1"
...@@ -15,18 +15,18 @@ hlsl.noSemantic.functionality1.comp ...@@ -15,18 +15,18 @@ hlsl.noSemantic.functionality1.comp
Name 11 "Buf" Name 11 "Buf"
MemberName 11(Buf) 0 "@data" MemberName 11(Buf) 0 "@data"
Name 13 "Buf" Name 13 "Buf"
Name 16 "Buf@count" Name 17 "Buf@count"
MemberName 16(Buf@count) 0 "@count" MemberName 17(Buf@count) 0 "@count"
Name 18 "Buf@count" Name 19 "Buf@count"
Decorate 10 ArrayStride 16 Decorate 10 ArrayStride 16
MemberDecorate 11(Buf) 0 Offset 0 MemberDecorate 11(Buf) 0 Offset 0
Decorate 11(Buf) BufferBlock Decorate 11(Buf) BufferBlock
Decorate 13(Buf) DescriptorSet 0 Decorate 13(Buf) DescriptorSet 0
Decorate 13(Buf) Binding 0 Decorate 13(Buf) Binding 0
MemberDecorate 16(Buf@count) 0 Offset 0 MemberDecorate 17(Buf@count) 0 Offset 0
Decorate 16(Buf@count) BufferBlock Decorate 17(Buf@count) BufferBlock
Decorate 18(Buf@count) DescriptorSet 0 Decorate 19(Buf@count) DescriptorSet 0
DecorateId 13(Buf) DecorationHlslCounterBufferGOOGLE 18(Buf@count) DecorateId 13(Buf) DecorationHlslCounterBufferGOOGLE 19(Buf@count)
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2
8: TypeFloat 32 8: TypeFloat 32
...@@ -37,27 +37,26 @@ hlsl.noSemantic.functionality1.comp ...@@ -37,27 +37,26 @@ hlsl.noSemantic.functionality1.comp
13(Buf): 12(ptr) Variable Uniform 13(Buf): 12(ptr) Variable Uniform
14: TypeInt 32 1 14: TypeInt 32 1
15: 14(int) Constant 0 15: 14(int) Constant 0
16(Buf@count): TypeStruct 14(int) 16: TypeInt 32 0
17: TypePointer Uniform 16(Buf@count) 17(Buf@count): TypeStruct 16(int)
18(Buf@count): 17(ptr) Variable Uniform 18: TypePointer Uniform 17(Buf@count)
19: TypePointer Uniform 14(int) 19(Buf@count): 18(ptr) Variable Uniform
21: 14(int) Constant 1 20: TypePointer Uniform 16(int)
22: TypeInt 32 0 22: 16(int) Constant 1
23: 22(int) Constant 1 23: 16(int) Constant 0
24: 22(int) Constant 0 25: 8(float) Constant 1065353216
26: 8(float) Constant 1065353216 26: 9(fvec4) ConstantComposite 25 25 25 25
27: 9(fvec4) ConstantComposite 26 26 26 26 27: TypePointer Uniform 9(fvec4)
28: TypePointer Uniform 9(fvec4)
4(main): 2 Function None 3 4(main): 2 Function None 3
5: Label 5: Label
30: 2 FunctionCall 6(@main() 29: 2 FunctionCall 6(@main()
Return Return
FunctionEnd FunctionEnd
6(@main(): 2 Function None 3 6(@main(): 2 Function None 3
7: Label 7: Label
20: 19(ptr) AccessChain 18(Buf@count) 15 21: 20(ptr) AccessChain 19(Buf@count) 15
25: 22(int) AtomicIAdd 20 23 24 21 24: 16(int) AtomicIAdd 21 22 23 22
29: 28(ptr) AccessChain 13(Buf) 15 25 28: 27(ptr) AccessChain 13(Buf) 15 24
Store 29 27 Store 28 26
Return Return
FunctionEnd FunctionEnd
...@@ -13,12 +13,12 @@ gl_FragCoord origin is upper left ...@@ -13,12 +13,12 @@ gl_FragCoord origin is upper left
0:8 Constant: 0:8 Constant:
0:8 0 (const uint) 0:8 0 (const uint)
0:8 AtomicAdd ( temp uint) 0:8 AtomicAdd ( temp uint)
0:8 @count: direct index for structure ( temp int) 0:8 @count: direct index for structure ( temp uint)
0:8 'sbuf_a@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer int @count}) 0:8 'sbuf_a@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer uint @count})
0:8 Constant: 0:8 Constant:
0:8 0 (const int) 0:8 0 (const int)
0:8 Constant: 0:8 Constant:
0:8 1 (const int) 0:8 1 (const uint)
0:? Constant: 0:? Constant:
0:? 1.000000 0:? 1.000000
0:? 2.000000 0:? 2.000000
...@@ -32,12 +32,12 @@ gl_FragCoord origin is upper left ...@@ -32,12 +32,12 @@ gl_FragCoord origin is upper left
0:10 0 (const uint) 0:10 0 (const uint)
0:10 add ( temp uint) 0:10 add ( temp uint)
0:10 AtomicAdd ( temp uint) 0:10 AtomicAdd ( temp uint)
0:10 @count: direct index for structure ( temp int) 0:10 @count: direct index for structure ( temp uint)
0:10 'sbuf_c@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer int @count}) 0:10 'sbuf_c@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer uint @count})
0:10 Constant: 0:10 Constant:
0:10 0 (const int) 0:10 0 (const int)
0:10 Constant: 0:10 Constant:
0:10 -1 (const int) 0:10 4294967295 (const uint)
0:10 Constant: 0:10 Constant:
0:10 -1 (const int) 0:10 -1 (const int)
0:7 Function Definition: main( ( temp void) 0:7 Function Definition: main( ( temp void)
...@@ -52,9 +52,9 @@ gl_FragCoord origin is upper left ...@@ -52,9 +52,9 @@ gl_FragCoord origin is upper left
0:? 'pos' ( temp uint) 0:? 'pos' ( temp uint)
0:? Linker Objects 0:? Linker Objects
0:? 'sbuf_a' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of float @data}) 0:? 'sbuf_a' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of float @data})
0:? 'sbuf_a@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer int @count}) 0:? 'sbuf_a@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer uint @count})
0:? 'sbuf_c' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of float @data}) 0:? 'sbuf_c' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of float @data})
0:? 'sbuf_c@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer int @count}) 0:? 'sbuf_c@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer uint @count})
0:? 'sbuf_unused' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of float @data}) 0:? 'sbuf_unused' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of float @data})
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) 0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
0:? 'pos' (layout( location=0) flat in uint) 0:? 'pos' (layout( location=0) flat in uint)
...@@ -77,12 +77,12 @@ gl_FragCoord origin is upper left ...@@ -77,12 +77,12 @@ gl_FragCoord origin is upper left
0:8 Constant: 0:8 Constant:
0:8 0 (const uint) 0:8 0 (const uint)
0:8 AtomicAdd ( temp uint) 0:8 AtomicAdd ( temp uint)
0:8 @count: direct index for structure ( temp int) 0:8 @count: direct index for structure ( temp uint)
0:8 'sbuf_a@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer int @count}) 0:8 'sbuf_a@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer uint @count})
0:8 Constant: 0:8 Constant:
0:8 0 (const int) 0:8 0 (const int)
0:8 Constant: 0:8 Constant:
0:8 1 (const int) 0:8 1 (const uint)
0:? Constant: 0:? Constant:
0:? 1.000000 0:? 1.000000
0:? 2.000000 0:? 2.000000
...@@ -96,12 +96,12 @@ gl_FragCoord origin is upper left ...@@ -96,12 +96,12 @@ gl_FragCoord origin is upper left
0:10 0 (const uint) 0:10 0 (const uint)
0:10 add ( temp uint) 0:10 add ( temp uint)
0:10 AtomicAdd ( temp uint) 0:10 AtomicAdd ( temp uint)
0:10 @count: direct index for structure ( temp int) 0:10 @count: direct index for structure ( temp uint)
0:10 'sbuf_c@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer int @count}) 0:10 'sbuf_c@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer uint @count})
0:10 Constant: 0:10 Constant:
0:10 0 (const int) 0:10 0 (const int)
0:10 Constant: 0:10 Constant:
0:10 -1 (const int) 0:10 4294967295 (const uint)
0:10 Constant: 0:10 Constant:
0:10 -1 (const int) 0:10 -1 (const int)
0:7 Function Definition: main( ( temp void) 0:7 Function Definition: main( ( temp void)
...@@ -116,9 +116,9 @@ gl_FragCoord origin is upper left ...@@ -116,9 +116,9 @@ gl_FragCoord origin is upper left
0:? 'pos' ( temp uint) 0:? 'pos' ( temp uint)
0:? Linker Objects 0:? Linker Objects
0:? 'sbuf_a' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of float @data}) 0:? 'sbuf_a' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of float @data})
0:? 'sbuf_a@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer int @count}) 0:? 'sbuf_a@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer uint @count})
0:? 'sbuf_c' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of float @data}) 0:? 'sbuf_c' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of float @data})
0:? 'sbuf_c@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer int @count}) 0:? 'sbuf_c@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer uint @count})
0:? 'sbuf_unused' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of float @data}) 0:? 'sbuf_unused' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of float @data})
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) 0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
0:? 'pos' (layout( location=0) flat in uint) 0:? 'pos' (layout( location=0) flat in uint)
...@@ -142,8 +142,8 @@ gl_FragCoord origin is upper left ...@@ -142,8 +142,8 @@ gl_FragCoord origin is upper left
Name 20 "sbuf_a@count" Name 20 "sbuf_a@count"
MemberName 20(sbuf_a@count) 0 "@count" MemberName 20(sbuf_a@count) 0 "@count"
Name 22 "sbuf_a@count" Name 22 "sbuf_a@count"
Name 36 "sbuf_c" Name 35 "sbuf_c"
Name 37 "sbuf_c@count" Name 36 "sbuf_c@count"
Name 46 "pos" Name 46 "pos"
Name 48 "pos" Name 48 "pos"
Name 51 "@entryPointOutput" Name 51 "@entryPointOutput"
...@@ -156,8 +156,8 @@ gl_FragCoord origin is upper left ...@@ -156,8 +156,8 @@ gl_FragCoord origin is upper left
MemberDecorate 20(sbuf_a@count) 0 Offset 0 MemberDecorate 20(sbuf_a@count) 0 Offset 0
Decorate 20(sbuf_a@count) BufferBlock Decorate 20(sbuf_a@count) BufferBlock
Decorate 22(sbuf_a@count) DescriptorSet 0 Decorate 22(sbuf_a@count) DescriptorSet 0
Decorate 36(sbuf_c) DescriptorSet 0 Decorate 35(sbuf_c) DescriptorSet 0
Decorate 37(sbuf_c@count) DescriptorSet 0 Decorate 36(sbuf_c@count) DescriptorSet 0
Decorate 48(pos) Flat Decorate 48(pos) Flat
Decorate 48(pos) Location 0 Decorate 48(pos) Location 0
Decorate 51(@entryPointOutput) Location 0 Decorate 51(@entryPointOutput) Location 0
...@@ -175,22 +175,22 @@ gl_FragCoord origin is upper left ...@@ -175,22 +175,22 @@ gl_FragCoord origin is upper left
17(sbuf_a): 16(ptr) Variable Uniform 17(sbuf_a): 16(ptr) Variable Uniform
18: TypeInt 32 1 18: TypeInt 32 1
19: 18(int) Constant 0 19: 18(int) Constant 0
20(sbuf_a@count): TypeStruct 18(int) 20(sbuf_a@count): TypeStruct 6(int)
21: TypePointer Uniform 20(sbuf_a@count) 21: TypePointer Uniform 20(sbuf_a@count)
22(sbuf_a@count): 21(ptr) Variable Uniform 22(sbuf_a@count): 21(ptr) Variable Uniform
23: TypePointer Uniform 18(int) 23: TypePointer Uniform 6(int)
25: 18(int) Constant 1 25: 6(int) Constant 1
26: 6(int) Constant 1 26: 6(int) Constant 0
27: 6(int) Constant 0 28: 8(float) Constant 1065353216
29: 8(float) Constant 1065353216 29: 8(float) Constant 1073741824
30: 8(float) Constant 1073741824 30: 8(float) Constant 1077936128
31: 8(float) Constant 1077936128 31: 8(float) Constant 1082130432
32: 8(float) Constant 1082130432 32: 9(fvec4) ConstantComposite 28 29 30 31
33: 9(fvec4) ConstantComposite 29 30 31 32 33: TypePointer Uniform 9(fvec4)
34: TypePointer Uniform 9(fvec4) 35(sbuf_c): 16(ptr) Variable Uniform
36(sbuf_c): 16(ptr) Variable Uniform 36(sbuf_c@count): 21(ptr) Variable Uniform
37(sbuf_c@count): 21(ptr) Variable Uniform 38: 6(int) Constant 4294967295
39: 18(int) Constant 4294967295 40: 18(int) Constant 4294967295
47: TypePointer Input 6(int) 47: TypePointer Input 6(int)
48(pos): 47(ptr) Variable Input 48(pos): 47(ptr) Variable Input
50: TypePointer Output 9(fvec4) 50: TypePointer Output 9(fvec4)
...@@ -212,13 +212,13 @@ gl_FragCoord origin is upper left ...@@ -212,13 +212,13 @@ gl_FragCoord origin is upper left
11(pos): 7(ptr) FunctionParameter 11(pos): 7(ptr) FunctionParameter
13: Label 13: Label
24: 23(ptr) AccessChain 22(sbuf_a@count) 19 24: 23(ptr) AccessChain 22(sbuf_a@count) 19
28: 6(int) AtomicIAdd 24 26 27 25 27: 6(int) AtomicIAdd 24 25 26 25
35: 34(ptr) AccessChain 17(sbuf_a) 19 28 34: 33(ptr) AccessChain 17(sbuf_a) 19 27
Store 35 33 Store 34 32
38: 23(ptr) AccessChain 37(sbuf_c@count) 19 37: 23(ptr) AccessChain 36(sbuf_c@count) 19
40: 6(int) AtomicIAdd 38 26 27 39 39: 6(int) AtomicIAdd 37 25 26 38
41: 6(int) IAdd 40 39 41: 6(int) IAdd 39 40
42: 34(ptr) AccessChain 36(sbuf_c) 19 41 42: 33(ptr) AccessChain 35(sbuf_c) 19 41
43: 9(fvec4) Load 42 43: 9(fvec4) Load 42
ReturnValue 43 ReturnValue 43
FunctionEnd FunctionEnd
...@@ -23,8 +23,8 @@ hlsl.structbuffer.incdec.frag ...@@ -23,8 +23,8 @@ hlsl.structbuffer.incdec.frag
Name 34 "sbuf_rw_i@count" Name 34 "sbuf_rw_i@count"
MemberName 34(sbuf_rw_i@count) 0 "@count" MemberName 34(sbuf_rw_i@count) 0 "@count"
Name 36 "sbuf_rw_i@count" Name 36 "sbuf_rw_i@count"
Name 42 "c2" Name 41 "c2"
Name 43 "sbuf_rw_d@count" Name 42 "sbuf_rw_d@count"
Name 61 "pos" Name 61 "pos"
Name 63 "pos" Name 63 "pos"
Name 66 "@entryPointOutput" Name 66 "@entryPointOutput"
...@@ -38,14 +38,14 @@ hlsl.structbuffer.incdec.frag ...@@ -38,14 +38,14 @@ hlsl.structbuffer.incdec.frag
MemberDecorate 34(sbuf_rw_i@count) 0 Offset 0 MemberDecorate 34(sbuf_rw_i@count) 0 Offset 0
Decorate 34(sbuf_rw_i@count) BufferBlock Decorate 34(sbuf_rw_i@count) BufferBlock
Decorate 36(sbuf_rw_i@count) DescriptorSet 0 Decorate 36(sbuf_rw_i@count) DescriptorSet 0
Decorate 43(sbuf_rw_d@count) DescriptorSet 0 Decorate 42(sbuf_rw_d@count) DescriptorSet 0
Decorate 63(pos) Flat Decorate 63(pos) Flat
Decorate 63(pos) Location 0 Decorate 63(pos) Location 0
DecorateStringGOOGLE 63(pos) DecorationHlslSemanticGOOGLE "FOO" DecorateStringGOOGLE 63(pos) DecorationHlslSemanticGOOGLE "FOO"
Decorate 66(@entryPointOutput) Location 0 Decorate 66(@entryPointOutput) Location 0
DecorateStringGOOGLE 66(@entryPointOutput) DecorationHlslSemanticGOOGLE "SV_TARGET0" DecorateStringGOOGLE 66(@entryPointOutput) DecorationHlslSemanticGOOGLE "SV_TARGET0"
DecorateId 22(sbuf_rw_i) DecorationHlslCounterBufferGOOGLE 36(sbuf_rw_i@count) DecorateId 22(sbuf_rw_i) DecorationHlslCounterBufferGOOGLE 36(sbuf_rw_i@count)
DecorateId 26(sbuf_rw_d) DecorationHlslCounterBufferGOOGLE 43(sbuf_rw_d@count) DecorateId 26(sbuf_rw_d) DecorationHlslCounterBufferGOOGLE 42(sbuf_rw_d@count)
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2
6: TypeInt 32 0 6: TypeInt 32 0
...@@ -70,14 +70,14 @@ hlsl.structbuffer.incdec.frag ...@@ -70,14 +70,14 @@ hlsl.structbuffer.incdec.frag
29: 6(int) Constant 2 29: 6(int) Constant 2
30: 14(ivec4) ConstantComposite 29 29 29 29 30: 14(ivec4) ConstantComposite 29 29 29 29
31: TypePointer Uniform 14(ivec4) 31: TypePointer Uniform 14(ivec4)
34(sbuf_rw_i@count): TypeStruct 23(int) 34(sbuf_rw_i@count): TypeStruct 6(int)
35: TypePointer Uniform 34(sbuf_rw_i@count) 35: TypePointer Uniform 34(sbuf_rw_i@count)
36(sbuf_rw_i@count): 35(ptr) Variable Uniform 36(sbuf_rw_i@count): 35(ptr) Variable Uniform
37: TypePointer Uniform 23(int) 37: TypePointer Uniform 6(int)
39: 23(int) Constant 1 39: 6(int) Constant 1
40: 6(int) Constant 1 42(sbuf_rw_d@count): 35(ptr) Variable Uniform
43(sbuf_rw_d@count): 35(ptr) Variable Uniform 44: 6(int) Constant 4294967295
45: 23(int) Constant 4294967295 46: 23(int) Constant 4294967295
62: TypePointer Input 6(int) 62: TypePointer Input 6(int)
63(pos): 62(ptr) Variable Input 63(pos): 62(ptr) Variable Input
65: TypePointer Output 9(fvec4) 65: TypePointer Output 9(fvec4)
...@@ -99,26 +99,26 @@ hlsl.structbuffer.incdec.frag ...@@ -99,26 +99,26 @@ hlsl.structbuffer.incdec.frag
13: Label 13: Label
16(result): 15(ptr) Variable Function 16(result): 15(ptr) Variable Function
33(c1): 7(ptr) Variable Function 33(c1): 7(ptr) Variable Function
42(c2): 7(ptr) Variable Function 41(c2): 7(ptr) Variable Function
Store 16(result) 18 Store 16(result) 18
32: 31(ptr) AccessChain 27(sbuf_rw_nocounter) 24 28 32: 31(ptr) AccessChain 27(sbuf_rw_nocounter) 24 28
Store 32 30 Store 32 30
38: 37(ptr) AccessChain 36(sbuf_rw_i@count) 24 38: 37(ptr) AccessChain 36(sbuf_rw_i@count) 24
41: 6(int) AtomicIAdd 38 40 17 39 40: 6(int) AtomicIAdd 38 39 17 39
Store 33(c1) 41 Store 33(c1) 40
44: 37(ptr) AccessChain 43(sbuf_rw_d@count) 24 43: 37(ptr) AccessChain 42(sbuf_rw_d@count) 24
46: 6(int) AtomicIAdd 44 40 17 45 45: 6(int) AtomicIAdd 43 39 17 44
47: 6(int) IAdd 46 45 47: 6(int) IAdd 45 46
Store 42(c2) 47 Store 41(c2) 47
48: 7(ptr) AccessChain 16(result) 17 48: 7(ptr) AccessChain 16(result) 17
49: 6(int) Load 48 49: 6(int) Load 48
50: 8(float) ConvertUToF 49 50: 8(float) ConvertUToF 49
51: 7(ptr) AccessChain 16(result) 40 51: 7(ptr) AccessChain 16(result) 39
52: 6(int) Load 51 52: 6(int) Load 51
53: 8(float) ConvertUToF 52 53: 8(float) ConvertUToF 52
54: 6(int) Load 33(c1) 54: 6(int) Load 33(c1)
55: 8(float) ConvertUToF 54 55: 8(float) ConvertUToF 54
56: 6(int) Load 42(c2) 56: 6(int) Load 41(c2)
57: 8(float) ConvertUToF 56 57: 8(float) ConvertUToF 56
58: 9(fvec4) CompositeConstruct 50 53 55 57 58: 9(fvec4) CompositeConstruct 50 53 55 57
ReturnValue 58 ReturnValue 58
......
...@@ -45,23 +45,23 @@ gl_FragCoord origin is upper left ...@@ -45,23 +45,23 @@ gl_FragCoord origin is upper left
0:15 move second child to first child ( temp uint) 0:15 move second child to first child ( temp uint)
0:15 'c1' ( temp uint) 0:15 'c1' ( temp uint)
0:15 AtomicAdd ( temp uint) 0:15 AtomicAdd ( temp uint)
0:15 @count: direct index for structure ( temp int) 0:15 @count: direct index for structure ( temp uint)
0:15 'sbuf_rw_i@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer int @count}) 0:15 'sbuf_rw_i@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer uint @count})
0:15 Constant: 0:15 Constant:
0:15 0 (const int) 0:15 0 (const int)
0:15 Constant: 0:15 Constant:
0:15 1 (const int) 0:15 1 (const uint)
0:16 Sequence 0:16 Sequence
0:16 move second child to first child ( temp uint) 0:16 move second child to first child ( temp uint)
0:16 'c2' ( temp uint) 0:16 'c2' ( temp uint)
0:16 add ( temp uint) 0:16 add ( temp uint)
0:16 AtomicAdd ( temp uint) 0:16 AtomicAdd ( temp uint)
0:16 @count: direct index for structure ( temp int) 0:16 @count: direct index for structure ( temp uint)
0:16 'sbuf_rw_d@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer int @count}) 0:16 'sbuf_rw_d@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer uint @count})
0:16 Constant: 0:16 Constant:
0:16 0 (const int) 0:16 0 (const int)
0:16 Constant: 0:16 Constant:
0:16 -1 (const int) 0:16 4294967295 (const uint)
0:16 Constant: 0:16 Constant:
0:16 -1 (const int) 0:16 -1 (const int)
0:18 Branch: Return with expression 0:18 Branch: Return with expression
...@@ -92,9 +92,9 @@ gl_FragCoord origin is upper left ...@@ -92,9 +92,9 @@ gl_FragCoord origin is upper left
0:? 'pos' ( temp uint) 0:? 'pos' ( temp uint)
0:? Linker Objects 0:? Linker Objects
0:? 'sbuf_rw_i' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of uint @data}) 0:? 'sbuf_rw_i' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of uint @data})
0:? 'sbuf_rw_i@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer int @count}) 0:? 'sbuf_rw_i@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer uint @count})
0:? 'sbuf_rw_d' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of uint @data}) 0:? 'sbuf_rw_d' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of uint @data})
0:? 'sbuf_rw_d@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer int @count}) 0:? 'sbuf_rw_d@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer uint @count})
0:? 'sbuf_rw_nocounter' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of uint @data}) 0:? 'sbuf_rw_nocounter' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of uint @data})
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) 0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
0:? 'pos' (layout( location=0) flat in uint) 0:? 'pos' (layout( location=0) flat in uint)
...@@ -149,23 +149,23 @@ gl_FragCoord origin is upper left ...@@ -149,23 +149,23 @@ gl_FragCoord origin is upper left
0:15 move second child to first child ( temp uint) 0:15 move second child to first child ( temp uint)
0:15 'c1' ( temp uint) 0:15 'c1' ( temp uint)
0:15 AtomicAdd ( temp uint) 0:15 AtomicAdd ( temp uint)
0:15 @count: direct index for structure ( temp int) 0:15 @count: direct index for structure ( temp uint)
0:15 'sbuf_rw_i@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer int @count}) 0:15 'sbuf_rw_i@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer uint @count})
0:15 Constant: 0:15 Constant:
0:15 0 (const int) 0:15 0 (const int)
0:15 Constant: 0:15 Constant:
0:15 1 (const int) 0:15 1 (const uint)
0:16 Sequence 0:16 Sequence
0:16 move second child to first child ( temp uint) 0:16 move second child to first child ( temp uint)
0:16 'c2' ( temp uint) 0:16 'c2' ( temp uint)
0:16 add ( temp uint) 0:16 add ( temp uint)
0:16 AtomicAdd ( temp uint) 0:16 AtomicAdd ( temp uint)
0:16 @count: direct index for structure ( temp int) 0:16 @count: direct index for structure ( temp uint)
0:16 'sbuf_rw_d@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer int @count}) 0:16 'sbuf_rw_d@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer uint @count})
0:16 Constant: 0:16 Constant:
0:16 0 (const int) 0:16 0 (const int)
0:16 Constant: 0:16 Constant:
0:16 -1 (const int) 0:16 4294967295 (const uint)
0:16 Constant: 0:16 Constant:
0:16 -1 (const int) 0:16 -1 (const int)
0:18 Branch: Return with expression 0:18 Branch: Return with expression
...@@ -196,9 +196,9 @@ gl_FragCoord origin is upper left ...@@ -196,9 +196,9 @@ gl_FragCoord origin is upper left
0:? 'pos' ( temp uint) 0:? 'pos' ( temp uint)
0:? Linker Objects 0:? Linker Objects
0:? 'sbuf_rw_i' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of uint @data}) 0:? 'sbuf_rw_i' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of uint @data})
0:? 'sbuf_rw_i@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer int @count}) 0:? 'sbuf_rw_i@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer uint @count})
0:? 'sbuf_rw_d' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of uint @data}) 0:? 'sbuf_rw_d' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of uint @data})
0:? 'sbuf_rw_d@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer int @count}) 0:? 'sbuf_rw_d@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer uint @count})
0:? 'sbuf_rw_nocounter' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of uint @data}) 0:? 'sbuf_rw_nocounter' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of uint @data})
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) 0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
0:? 'pos' (layout( location=0) flat in uint) 0:? 'pos' (layout( location=0) flat in uint)
...@@ -226,8 +226,8 @@ gl_FragCoord origin is upper left ...@@ -226,8 +226,8 @@ gl_FragCoord origin is upper left
Name 34 "sbuf_rw_i@count" Name 34 "sbuf_rw_i@count"
MemberName 34(sbuf_rw_i@count) 0 "@count" MemberName 34(sbuf_rw_i@count) 0 "@count"
Name 36 "sbuf_rw_i@count" Name 36 "sbuf_rw_i@count"
Name 42 "c2" Name 41 "c2"
Name 43 "sbuf_rw_d@count" Name 42 "sbuf_rw_d@count"
Name 61 "pos" Name 61 "pos"
Name 63 "pos" Name 63 "pos"
Name 66 "@entryPointOutput" Name 66 "@entryPointOutput"
...@@ -241,7 +241,7 @@ gl_FragCoord origin is upper left ...@@ -241,7 +241,7 @@ gl_FragCoord origin is upper left
MemberDecorate 34(sbuf_rw_i@count) 0 Offset 0 MemberDecorate 34(sbuf_rw_i@count) 0 Offset 0
Decorate 34(sbuf_rw_i@count) BufferBlock Decorate 34(sbuf_rw_i@count) BufferBlock
Decorate 36(sbuf_rw_i@count) DescriptorSet 0 Decorate 36(sbuf_rw_i@count) DescriptorSet 0
Decorate 43(sbuf_rw_d@count) DescriptorSet 0 Decorate 42(sbuf_rw_d@count) DescriptorSet 0
Decorate 63(pos) Flat Decorate 63(pos) Flat
Decorate 63(pos) Location 0 Decorate 63(pos) Location 0
Decorate 66(@entryPointOutput) Location 0 Decorate 66(@entryPointOutput) Location 0
...@@ -269,14 +269,14 @@ gl_FragCoord origin is upper left ...@@ -269,14 +269,14 @@ gl_FragCoord origin is upper left
29: 6(int) Constant 2 29: 6(int) Constant 2
30: 14(ivec4) ConstantComposite 29 29 29 29 30: 14(ivec4) ConstantComposite 29 29 29 29
31: TypePointer Uniform 14(ivec4) 31: TypePointer Uniform 14(ivec4)
34(sbuf_rw_i@count): TypeStruct 23(int) 34(sbuf_rw_i@count): TypeStruct 6(int)
35: TypePointer Uniform 34(sbuf_rw_i@count) 35: TypePointer Uniform 34(sbuf_rw_i@count)
36(sbuf_rw_i@count): 35(ptr) Variable Uniform 36(sbuf_rw_i@count): 35(ptr) Variable Uniform
37: TypePointer Uniform 23(int) 37: TypePointer Uniform 6(int)
39: 23(int) Constant 1 39: 6(int) Constant 1
40: 6(int) Constant 1 42(sbuf_rw_d@count): 35(ptr) Variable Uniform
43(sbuf_rw_d@count): 35(ptr) Variable Uniform 44: 6(int) Constant 4294967295
45: 23(int) Constant 4294967295 46: 23(int) Constant 4294967295
62: TypePointer Input 6(int) 62: TypePointer Input 6(int)
63(pos): 62(ptr) Variable Input 63(pos): 62(ptr) Variable Input
65: TypePointer Output 9(fvec4) 65: TypePointer Output 9(fvec4)
...@@ -298,26 +298,26 @@ gl_FragCoord origin is upper left ...@@ -298,26 +298,26 @@ gl_FragCoord origin is upper left
13: Label 13: Label
16(result): 15(ptr) Variable Function 16(result): 15(ptr) Variable Function
33(c1): 7(ptr) Variable Function 33(c1): 7(ptr) Variable Function
42(c2): 7(ptr) Variable Function 41(c2): 7(ptr) Variable Function
Store 16(result) 18 Store 16(result) 18
32: 31(ptr) AccessChain 27(sbuf_rw_nocounter) 24 28 32: 31(ptr) AccessChain 27(sbuf_rw_nocounter) 24 28
Store 32 30 Store 32 30
38: 37(ptr) AccessChain 36(sbuf_rw_i@count) 24 38: 37(ptr) AccessChain 36(sbuf_rw_i@count) 24
41: 6(int) AtomicIAdd 38 40 17 39 40: 6(int) AtomicIAdd 38 39 17 39
Store 33(c1) 41 Store 33(c1) 40
44: 37(ptr) AccessChain 43(sbuf_rw_d@count) 24 43: 37(ptr) AccessChain 42(sbuf_rw_d@count) 24
46: 6(int) AtomicIAdd 44 40 17 45 45: 6(int) AtomicIAdd 43 39 17 44
47: 6(int) IAdd 46 45 47: 6(int) IAdd 45 46
Store 42(c2) 47 Store 41(c2) 47
48: 7(ptr) AccessChain 16(result) 17 48: 7(ptr) AccessChain 16(result) 17
49: 6(int) Load 48 49: 6(int) Load 48
50: 8(float) ConvertUToF 49 50: 8(float) ConvertUToF 49
51: 7(ptr) AccessChain 16(result) 40 51: 7(ptr) AccessChain 16(result) 39
52: 6(int) Load 51 52: 6(int) Load 51
53: 8(float) ConvertUToF 52 53: 8(float) ConvertUToF 52
54: 6(int) Load 33(c1) 54: 6(int) Load 33(c1)
55: 8(float) ConvertUToF 54 55: 8(float) ConvertUToF 54
56: 6(int) Load 42(c2) 56: 6(int) Load 41(c2)
57: 8(float) ConvertUToF 56 57: 8(float) ConvertUToF 56
58: 9(fvec4) CompositeConstruct 50 53 55 57 58: 9(fvec4) CompositeConstruct 50 53 55 57
ReturnValue 58 ReturnValue 58
......
spv.ssboAlias.frag spv.ssboAlias.frag
// Module Version 10000 // Module Version 10000
// Generated by (magic number): 80006 // Generated by (magic number): 80006
// Id's are bound by 46 // Id's are bound by 44
Capability Shader Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 43 EntryPoint Fragment 4 "main" 41
ExecutionMode 4 OriginUpperLeft ExecutionMode 4 OriginUpperLeft
Source HLSL 500 Source HLSL 500
Name 4 "main" Name 4 "main"
...@@ -17,10 +17,10 @@ spv.ssboAlias.frag ...@@ -17,10 +17,10 @@ spv.ssboAlias.frag
Name 18 "Buf1@count" Name 18 "Buf1@count"
MemberName 18(Buf1@count) 0 "@count" MemberName 18(Buf1@count) 0 "@count"
Name 20 "Buf1@count" Name 20 "Buf1@count"
Name 30 "Buf2" Name 28 "Buf2"
Name 31 "Buf2@count" Name 29 "Buf2@count"
Name 43 "@entryPointOutput" Name 41 "@entryPointOutput"
Name 45 "Buf3" Name 43 "Buf3"
Decorate 12 ArrayStride 4 Decorate 12 ArrayStride 4
MemberDecorate 13(Buf1) 0 Offset 0 MemberDecorate 13(Buf1) 0 Offset 0
Decorate 13(Buf1) BufferBlock Decorate 13(Buf1) BufferBlock
...@@ -30,13 +30,13 @@ spv.ssboAlias.frag ...@@ -30,13 +30,13 @@ spv.ssboAlias.frag
Decorate 18(Buf1@count) BufferBlock Decorate 18(Buf1@count) BufferBlock
Decorate 20(Buf1@count) DescriptorSet 0 Decorate 20(Buf1@count) DescriptorSet 0
Decorate 20(Buf1@count) Binding 83 Decorate 20(Buf1@count) Binding 83
Decorate 30(Buf2) DescriptorSet 0 Decorate 28(Buf2) DescriptorSet 0
Decorate 30(Buf2) Binding 85 Decorate 28(Buf2) Binding 85
Decorate 31(Buf2@count) DescriptorSet 0 Decorate 29(Buf2@count) DescriptorSet 0
Decorate 31(Buf2@count) Binding 86 Decorate 29(Buf2@count) Binding 86
Decorate 43(@entryPointOutput) Location 0 Decorate 41(@entryPointOutput) Location 0
Decorate 45(Buf3) DescriptorSet 0 Decorate 43(Buf3) DescriptorSet 0
Decorate 45(Buf3) Binding 84 Decorate 43(Buf3) Binding 84
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2
6: TypeFloat 32 6: TypeFloat 32
...@@ -49,40 +49,38 @@ spv.ssboAlias.frag ...@@ -49,40 +49,38 @@ spv.ssboAlias.frag
15(Buf1): 14(ptr) Variable Uniform 15(Buf1): 14(ptr) Variable Uniform
16: TypeInt 32 1 16: TypeInt 32 1
17: 16(int) Constant 0 17: 16(int) Constant 0
18(Buf1@count): TypeStruct 16(int) 18(Buf1@count): TypeStruct 11(int)
19: TypePointer Uniform 18(Buf1@count) 19: TypePointer Uniform 18(Buf1@count)
20(Buf1@count): 19(ptr) Variable Uniform 20(Buf1@count): 19(ptr) Variable Uniform
21: TypePointer Uniform 16(int) 21: TypePointer Uniform 11(int)
23: 16(int) Constant 1 23: 11(int) Constant 1
24: 11(int) Constant 1 24: 11(int) Constant 0
25: 11(int) Constant 0 26: 11(int) Constant 10
27: 11(int) Constant 10 28(Buf2): 14(ptr) Variable Uniform
28: TypePointer Uniform 11(int) 29(Buf2@count): 19(ptr) Variable Uniform
30(Buf2): 14(ptr) Variable Uniform 32: 11(int) Constant 20
31(Buf2@count): 19(ptr) Variable Uniform 34: 6(float) Constant 1065353216
34: 11(int) Constant 20 35: 6(float) Constant 1077936128
36: 6(float) Constant 1065353216 36: 6(float) Constant 1084227584
37: 6(float) Constant 1077936128 37: 7(fvec4) ConstantComposite 34 35 36 34
38: 6(float) Constant 1084227584 40: TypePointer Output 7(fvec4)
39: 7(fvec4) ConstantComposite 36 37 38 36 41(@entryPointOutput): 40(ptr) Variable Output
42: TypePointer Output 7(fvec4) 43(Buf3): 14(ptr) Variable Uniform
43(@entryPointOutput): 42(ptr) Variable Output
45(Buf3): 14(ptr) Variable Uniform
4(main): 2 Function None 3 4(main): 2 Function None 3
5: Label 5: Label
44: 7(fvec4) FunctionCall 9(@main() 42: 7(fvec4) FunctionCall 9(@main()
Store 43(@entryPointOutput) 44 Store 41(@entryPointOutput) 42
Return Return
FunctionEnd FunctionEnd
9(@main(): 7(fvec4) Function None 8 9(@main(): 7(fvec4) Function None 8
10: Label 10: Label
22: 21(ptr) AccessChain 20(Buf1@count) 17 22: 21(ptr) AccessChain 20(Buf1@count) 17
26: 11(int) AtomicIAdd 22 24 25 23 25: 11(int) AtomicIAdd 22 23 24 23
29: 28(ptr) AccessChain 15(Buf1) 17 26 27: 21(ptr) AccessChain 15(Buf1) 17 25
Store 29 27 Store 27 26
32: 21(ptr) AccessChain 31(Buf2@count) 17 30: 21(ptr) AccessChain 29(Buf2@count) 17
33: 11(int) AtomicIAdd 32 24 25 23 31: 11(int) AtomicIAdd 30 23 24 23
35: 28(ptr) AccessChain 30(Buf2) 17 33 33: 21(ptr) AccessChain 28(Buf2) 17 31
Store 35 34 Store 33 32
ReturnValue 39 ReturnValue 37
FunctionEnd FunctionEnd
...@@ -3164,7 +3164,7 @@ bool HlslParseContext::hasStructBuffCounter(const TType& type) const ...@@ -3164,7 +3164,7 @@ bool HlslParseContext::hasStructBuffCounter(const TType& type) const
void HlslParseContext::counterBufferType(const TSourceLoc& loc, TType& type) void HlslParseContext::counterBufferType(const TSourceLoc& loc, TType& type)
{ {
// Counter type // Counter type
TType* counterType = new TType(EbtInt, EvqBuffer); TType* counterType = new TType(EbtUint, EvqBuffer);
counterType->setFieldName(intermediate.implicitCounterName); counterType->setFieldName(intermediate.implicitCounterName);
TTypeList* blockStruct = new TTypeList; TTypeList* blockStruct = new TTypeList;
...@@ -3216,7 +3216,7 @@ TIntermTyped* HlslParseContext::getStructBufferCounter(const TSourceLoc& loc, TI ...@@ -3216,7 +3216,7 @@ TIntermTyped* HlslParseContext::getStructBufferCounter(const TSourceLoc& loc, TI
TIntermTyped* index = intermediate.addConstantUnion(0, loc); // index to counter inside block struct TIntermTyped* index = intermediate.addConstantUnion(0, loc); // index to counter inside block struct
TIntermTyped* counterMember = intermediate.addIndex(EOpIndexDirectStruct, counterVar, index, loc); TIntermTyped* counterMember = intermediate.addIndex(EOpIndexDirectStruct, counterVar, index, loc);
counterMember->setType(TType(EbtInt)); counterMember->setType(TType(EbtUint));
return counterMember; return counterMember;
} }
...@@ -3249,7 +3249,7 @@ void HlslParseContext::decomposeStructBufferMethods(const TSourceLoc& loc, TInte ...@@ -3249,7 +3249,7 @@ void HlslParseContext::decomposeStructBufferMethods(const TSourceLoc& loc, TInte
// Some methods require a hidden internal counter, obtained via getStructBufferCounter(). // Some methods require a hidden internal counter, obtained via getStructBufferCounter().
// This lambda adds something to it and returns the old value. // This lambda adds something to it and returns the old value.
const auto incDecCounter = [&](int incval) -> TIntermTyped* { const auto incDecCounter = [&](int incval) -> TIntermTyped* {
TIntermTyped* incrementValue = intermediate.addConstantUnion(incval, loc, true); TIntermTyped* incrementValue = intermediate.addConstantUnion(static_cast<unsigned int>(incval), loc, true);
TIntermTyped* counter = getStructBufferCounter(loc, bufferObj); // obtain the counter member TIntermTyped* counter = getStructBufferCounter(loc, bufferObj); // obtain the counter member
if (counter == nullptr) if (counter == nullptr)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment