WIP: HLSL: Buffer types should be unsampled.

RWBuffer objects were generating (properly) unsampled resoures, while
Buffer objects were not.  This fixes that.
This commit is contained in:
steve-lunarg
2017-03-17 13:19:42 -06:00
parent e751bca75c
commit cf2e7275e8
6 changed files with 429 additions and 443 deletions

View File

@@ -9,8 +9,8 @@ gl_FragCoord origin is upper left
0:28 move second child to first child ( temp float)
0:28 'r00' ( temp float)
0:28 Construct float ( temp float)
0:? textureFetch ( temp 4-component vector of float)
0:28 'g_tTexbfs' (layout( r32f) uniform samplerBuffer)
0:? imageLoad ( temp 4-component vector of float)
0:28 'g_tTexbfs' (layout( r32f) uniform imageBuffer)
0:28 c1: direct index for structure (layout( offset=0) uniform int)
0:28 'anon@0' (layout( row_major std140) uniform block{layout( offset=0) uniform int c1, layout( offset=8) uniform 2-component vector of int c2, layout( offset=16) uniform 3-component vector of int c3, layout( offset=32) uniform 4-component vector of int c4, layout( offset=48) uniform int o1, layout( offset=56) uniform 2-component vector of int o2, layout( offset=64) uniform 3-component vector of int o3, layout( offset=80) uniform 4-component vector of int o4})
0:28 Constant:
@@ -19,8 +19,8 @@ gl_FragCoord origin is upper left
0:29 move second child to first child ( temp int)
0:29 'r01' ( temp int)
0:29 Construct int ( temp int)
0:? textureFetch ( temp 4-component vector of int)
0:29 'g_tTexbis' (layout( r32i) uniform isamplerBuffer)
0:? imageLoad ( temp 4-component vector of int)
0:29 'g_tTexbis' (layout( r32i) uniform iimageBuffer)
0:29 c1: direct index for structure (layout( offset=0) uniform int)
0:29 'anon@0' (layout( row_major std140) uniform block{layout( offset=0) uniform int c1, layout( offset=8) uniform 2-component vector of int c2, layout( offset=16) uniform 3-component vector of int c3, layout( offset=32) uniform 4-component vector of int c4, layout( offset=48) uniform int o1, layout( offset=56) uniform 2-component vector of int o2, layout( offset=64) uniform 3-component vector of int o3, layout( offset=80) uniform 4-component vector of int o4})
0:29 Constant:
@@ -29,8 +29,8 @@ gl_FragCoord origin is upper left
0:30 move second child to first child ( temp uint)
0:30 'r02' ( temp uint)
0:30 Construct uint ( temp uint)
0:? textureFetch ( temp 4-component vector of uint)
0:30 'g_tTexbus' (layout( r32ui) uniform usamplerBuffer)
0:? imageLoad ( temp 4-component vector of uint)
0:30 'g_tTexbus' (layout( r32ui) uniform uimageBuffer)
0:30 c1: direct index for structure (layout( offset=0) uniform int)
0:30 'anon@0' (layout( row_major std140) uniform block{layout( offset=0) uniform int c1, layout( offset=8) uniform 2-component vector of int c2, layout( offset=16) uniform 3-component vector of int c3, layout( offset=32) uniform 4-component vector of int c4, layout( offset=48) uniform int o1, layout( offset=56) uniform 2-component vector of int o2, layout( offset=64) uniform 3-component vector of int o3, layout( offset=80) uniform 4-component vector of int o4})
0:30 Constant:
@@ -74,10 +74,10 @@ gl_FragCoord origin is upper left
0:24 Constant:
0:24 1 (const int)
0:? Linker Objects
0:? 'g_tTexbfs_test' (layout( binding=0 r32f) uniform samplerBuffer)
0:? 'g_tTexbfs' (layout( r32f) uniform samplerBuffer)
0:? 'g_tTexbis' (layout( r32i) uniform isamplerBuffer)
0:? 'g_tTexbus' (layout( r32ui) uniform usamplerBuffer)
0:? 'g_tTexbfs_test' (layout( binding=0 r32f) uniform imageBuffer)
0:? 'g_tTexbfs' (layout( r32f) uniform imageBuffer)
0:? 'g_tTexbis' (layout( r32i) uniform iimageBuffer)
0:? 'g_tTexbus' (layout( r32ui) uniform uimageBuffer)
0:? 'Color' (layout( location=0) out 4-component vector of float)
0:? 'Depth' ( out float FragDepth)
0:? 'anon@0' (layout( row_major std140) uniform block{layout( offset=0) uniform int c1, layout( offset=8) uniform 2-component vector of int c2, layout( offset=16) uniform 3-component vector of int c3, layout( offset=32) uniform 4-component vector of int c4, layout( offset=48) uniform int o1, layout( offset=56) uniform 2-component vector of int o2, layout( offset=64) uniform 3-component vector of int o3, layout( offset=80) uniform 4-component vector of int o4})
@@ -96,8 +96,8 @@ gl_FragCoord origin is upper left
0:28 move second child to first child ( temp float)
0:28 'r00' ( temp float)
0:28 Construct float ( temp float)
0:? textureFetch ( temp 4-component vector of float)
0:28 'g_tTexbfs' (layout( r32f) uniform samplerBuffer)
0:? imageLoad ( temp 4-component vector of float)
0:28 'g_tTexbfs' (layout( r32f) uniform imageBuffer)
0:28 c1: direct index for structure (layout( offset=0) uniform int)
0:28 'anon@0' (layout( row_major std140) uniform block{layout( offset=0) uniform int c1, layout( offset=8) uniform 2-component vector of int c2, layout( offset=16) uniform 3-component vector of int c3, layout( offset=32) uniform 4-component vector of int c4, layout( offset=48) uniform int o1, layout( offset=56) uniform 2-component vector of int o2, layout( offset=64) uniform 3-component vector of int o3, layout( offset=80) uniform 4-component vector of int o4})
0:28 Constant:
@@ -106,8 +106,8 @@ gl_FragCoord origin is upper left
0:29 move second child to first child ( temp int)
0:29 'r01' ( temp int)
0:29 Construct int ( temp int)
0:? textureFetch ( temp 4-component vector of int)
0:29 'g_tTexbis' (layout( r32i) uniform isamplerBuffer)
0:? imageLoad ( temp 4-component vector of int)
0:29 'g_tTexbis' (layout( r32i) uniform iimageBuffer)
0:29 c1: direct index for structure (layout( offset=0) uniform int)
0:29 'anon@0' (layout( row_major std140) uniform block{layout( offset=0) uniform int c1, layout( offset=8) uniform 2-component vector of int c2, layout( offset=16) uniform 3-component vector of int c3, layout( offset=32) uniform 4-component vector of int c4, layout( offset=48) uniform int o1, layout( offset=56) uniform 2-component vector of int o2, layout( offset=64) uniform 3-component vector of int o3, layout( offset=80) uniform 4-component vector of int o4})
0:29 Constant:
@@ -116,8 +116,8 @@ gl_FragCoord origin is upper left
0:30 move second child to first child ( temp uint)
0:30 'r02' ( temp uint)
0:30 Construct uint ( temp uint)
0:? textureFetch ( temp 4-component vector of uint)
0:30 'g_tTexbus' (layout( r32ui) uniform usamplerBuffer)
0:? imageLoad ( temp 4-component vector of uint)
0:30 'g_tTexbus' (layout( r32ui) uniform uimageBuffer)
0:30 c1: direct index for structure (layout( offset=0) uniform int)
0:30 'anon@0' (layout( row_major std140) uniform block{layout( offset=0) uniform int c1, layout( offset=8) uniform 2-component vector of int c2, layout( offset=16) uniform 3-component vector of int c3, layout( offset=32) uniform 4-component vector of int c4, layout( offset=48) uniform int o1, layout( offset=56) uniform 2-component vector of int o2, layout( offset=64) uniform 3-component vector of int o3, layout( offset=80) uniform 4-component vector of int o4})
0:30 Constant:
@@ -161,23 +161,23 @@ gl_FragCoord origin is upper left
0:24 Constant:
0:24 1 (const int)
0:? Linker Objects
0:? 'g_tTexbfs_test' (layout( binding=0 r32f) uniform samplerBuffer)
0:? 'g_tTexbfs' (layout( r32f) uniform samplerBuffer)
0:? 'g_tTexbis' (layout( r32i) uniform isamplerBuffer)
0:? 'g_tTexbus' (layout( r32ui) uniform usamplerBuffer)
0:? 'g_tTexbfs_test' (layout( binding=0 r32f) uniform imageBuffer)
0:? 'g_tTexbfs' (layout( r32f) uniform imageBuffer)
0:? 'g_tTexbis' (layout( r32i) uniform iimageBuffer)
0:? 'g_tTexbus' (layout( r32ui) uniform uimageBuffer)
0:? 'Color' (layout( location=0) out 4-component vector of float)
0:? 'Depth' ( out float FragDepth)
0:? 'anon@0' (layout( row_major std140) uniform block{layout( offset=0) uniform int c1, layout( offset=8) uniform 2-component vector of int c2, layout( offset=16) uniform 3-component vector of int c3, layout( offset=32) uniform 4-component vector of int c4, layout( offset=48) uniform int o1, layout( offset=56) uniform 2-component vector of int o2, layout( offset=64) uniform 3-component vector of int o3, layout( offset=80) uniform 4-component vector of int o4})
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 81
// Id's are bound by 75
Capability Shader
Capability SampledBuffer
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 73 77
EntryPoint Fragment 4 "main" 67 71
ExecutionMode 4 OriginUpperLeft
Name 4 "main"
Name 8 "PS_OUTPUT"
@@ -185,43 +185,43 @@ gl_FragCoord origin is upper left
MemberName 8(PS_OUTPUT) 1 "Depth"
Name 10 "@main("
Name 13 "r00"
Name 17 "g_tTexbfs"
Name 23 "$Global"
MemberName 23($Global) 0 "c1"
MemberName 23($Global) 1 "c2"
MemberName 23($Global) 2 "c3"
MemberName 23($Global) 3 "c4"
MemberName 23($Global) 4 "o1"
MemberName 23($Global) 5 "o2"
MemberName 23($Global) 6 "o3"
MemberName 23($Global) 7 "o4"
Name 25 ""
Name 34 "r01"
Name 38 "g_tTexbis"
Name 47 "r02"
Name 51 "g_tTexbus"
Name 60 "psout"
Name 70 "flattenTemp"
Name 73 "Color"
Name 77 "Depth"
Name 80 "g_tTexbfs_test"
Decorate 17(g_tTexbfs) DescriptorSet 0
MemberDecorate 23($Global) 0 Offset 0
MemberDecorate 23($Global) 1 Offset 8
MemberDecorate 23($Global) 2 Offset 16
MemberDecorate 23($Global) 3 Offset 32
MemberDecorate 23($Global) 4 Offset 48
MemberDecorate 23($Global) 5 Offset 56
MemberDecorate 23($Global) 6 Offset 64
MemberDecorate 23($Global) 7 Offset 80
Decorate 23($Global) Block
Decorate 25 DescriptorSet 0
Decorate 38(g_tTexbis) DescriptorSet 0
Decorate 51(g_tTexbus) DescriptorSet 0
Decorate 73(Color) Location 0
Decorate 77(Depth) BuiltIn FragDepth
Decorate 80(g_tTexbfs_test) DescriptorSet 0
Decorate 80(g_tTexbfs_test) Binding 0
Name 16 "g_tTexbfs"
Name 22 "$Global"
MemberName 22($Global) 0 "c1"
MemberName 22($Global) 1 "c2"
MemberName 22($Global) 2 "c3"
MemberName 22($Global) 3 "c4"
MemberName 22($Global) 4 "o1"
MemberName 22($Global) 5 "o2"
MemberName 22($Global) 6 "o3"
MemberName 22($Global) 7 "o4"
Name 24 ""
Name 32 "r01"
Name 35 "g_tTexbis"
Name 43 "r02"
Name 46 "g_tTexbus"
Name 54 "psout"
Name 64 "flattenTemp"
Name 67 "Color"
Name 71 "Depth"
Name 74 "g_tTexbfs_test"
Decorate 16(g_tTexbfs) DescriptorSet 0
MemberDecorate 22($Global) 0 Offset 0
MemberDecorate 22($Global) 1 Offset 8
MemberDecorate 22($Global) 2 Offset 16
MemberDecorate 22($Global) 3 Offset 32
MemberDecorate 22($Global) 4 Offset 48
MemberDecorate 22($Global) 5 Offset 56
MemberDecorate 22($Global) 6 Offset 64
MemberDecorate 22($Global) 7 Offset 80
Decorate 22($Global) Block
Decorate 24 DescriptorSet 0
Decorate 35(g_tTexbis) DescriptorSet 0
Decorate 46(g_tTexbus) DescriptorSet 0
Decorate 67(Color) Location 0
Decorate 71(Depth) BuiltIn FragDepth
Decorate 74(g_tTexbfs_test) DescriptorSet 0
Decorate 74(g_tTexbfs_test) Binding 0
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
@@ -229,85 +229,79 @@ gl_FragCoord origin is upper left
8(PS_OUTPUT): TypeStruct 7(fvec4) 6(float)
9: TypeFunction 8(PS_OUTPUT)
12: TypePointer Function 6(float)
14: TypeImage 6(float) Buffer sampled format:R32f
15: TypeSampledImage 14
16: TypePointer UniformConstant 15
17(g_tTexbfs): 16(ptr) Variable UniformConstant
19: TypeInt 32 1
20: TypeVector 19(int) 2
21: TypeVector 19(int) 3
22: TypeVector 19(int) 4
23($Global): TypeStruct 19(int) 20(ivec2) 21(ivec3) 22(ivec4) 19(int) 20(ivec2) 21(ivec3) 22(ivec4)
24: TypePointer Uniform 23($Global)
25: 24(ptr) Variable Uniform
26: 19(int) Constant 0
27: TypePointer Uniform 19(int)
33: TypePointer Function 19(int)
35: TypeImage 19(int) Buffer sampled format:R32i
36: TypeSampledImage 35
37: TypePointer UniformConstant 36
38(g_tTexbis): 37(ptr) Variable UniformConstant
45: TypeInt 32 0
46: TypePointer Function 45(int)
48: TypeImage 45(int) Buffer sampled format:R32ui
49: TypeSampledImage 48
50: TypePointer UniformConstant 49
51(g_tTexbus): 50(ptr) Variable UniformConstant
56: TypeVector 45(int) 4
59: TypePointer Function 8(PS_OUTPUT)
61: 6(float) Constant 1065353216
62: 7(fvec4) ConstantComposite 61 61 61 61
63: TypePointer Function 7(fvec4)
65: 19(int) Constant 1
72: TypePointer Output 7(fvec4)
73(Color): 72(ptr) Variable Output
76: TypePointer Output 6(float)
77(Depth): 76(ptr) Variable Output
80(g_tTexbfs_test): 16(ptr) Variable UniformConstant
14: TypeImage 6(float) Buffer nonsampled format:R32f
15: TypePointer UniformConstant 14
16(g_tTexbfs): 15(ptr) Variable UniformConstant
18: TypeInt 32 1
19: TypeVector 18(int) 2
20: TypeVector 18(int) 3
21: TypeVector 18(int) 4
22($Global): TypeStruct 18(int) 19(ivec2) 20(ivec3) 21(ivec4) 18(int) 19(ivec2) 20(ivec3) 21(ivec4)
23: TypePointer Uniform 22($Global)
24: 23(ptr) Variable Uniform
25: 18(int) Constant 0
26: TypePointer Uniform 18(int)
31: TypePointer Function 18(int)
33: TypeImage 18(int) Buffer nonsampled format:R32i
34: TypePointer UniformConstant 33
35(g_tTexbis): 34(ptr) Variable UniformConstant
41: TypeInt 32 0
42: TypePointer Function 41(int)
44: TypeImage 41(int) Buffer nonsampled format:R32ui
45: TypePointer UniformConstant 44
46(g_tTexbus): 45(ptr) Variable UniformConstant
50: TypeVector 41(int) 4
53: TypePointer Function 8(PS_OUTPUT)
55: 6(float) Constant 1065353216
56: 7(fvec4) ConstantComposite 55 55 55 55
57: TypePointer Function 7(fvec4)
59: 18(int) Constant 1
66: TypePointer Output 7(fvec4)
67(Color): 66(ptr) Variable Output
70: TypePointer Output 6(float)
71(Depth): 70(ptr) Variable Output
74(g_tTexbfs_test): 15(ptr) Variable UniformConstant
4(main): 2 Function None 3
5: Label
70(flattenTemp): 59(ptr) Variable Function
71:8(PS_OUTPUT) FunctionCall 10(@main()
Store 70(flattenTemp) 71
74: 63(ptr) AccessChain 70(flattenTemp) 26
75: 7(fvec4) Load 74
Store 73(Color) 75
78: 12(ptr) AccessChain 70(flattenTemp) 65
79: 6(float) Load 78
Store 77(Depth) 79
64(flattenTemp): 53(ptr) Variable Function
65:8(PS_OUTPUT) FunctionCall 10(@main()
Store 64(flattenTemp) 65
68: 57(ptr) AccessChain 64(flattenTemp) 25
69: 7(fvec4) Load 68
Store 67(Color) 69
72: 12(ptr) AccessChain 64(flattenTemp) 59
73: 6(float) Load 72
Store 71(Depth) 73
Return
FunctionEnd
10(@main():8(PS_OUTPUT) Function None 9
11: Label
13(r00): 12(ptr) Variable Function
34(r01): 33(ptr) Variable Function
47(r02): 46(ptr) Variable Function
60(psout): 59(ptr) Variable Function
18: 15 Load 17(g_tTexbfs)
28: 27(ptr) AccessChain 25 26
29: 19(int) Load 28
30: 14 Image 18
31: 7(fvec4) ImageFetch 30 29
32: 6(float) CompositeExtract 31 0
Store 13(r00) 32
39: 36 Load 38(g_tTexbis)
40: 27(ptr) AccessChain 25 26
41: 19(int) Load 40
42: 35 Image 39
43: 22(ivec4) ImageFetch 42 41
44: 19(int) CompositeExtract 43 0
Store 34(r01) 44
52: 49 Load 51(g_tTexbus)
53: 27(ptr) AccessChain 25 26
54: 19(int) Load 53
55: 48 Image 52
57: 56(ivec4) ImageFetch 55 54
58: 45(int) CompositeExtract 57 0
Store 47(r02) 58
64: 63(ptr) AccessChain 60(psout) 26
Store 64 62
66: 12(ptr) AccessChain 60(psout) 65
Store 66 61
67:8(PS_OUTPUT) Load 60(psout)
ReturnValue 67
32(r01): 31(ptr) Variable Function
43(r02): 42(ptr) Variable Function
54(psout): 53(ptr) Variable Function
17: 14 Load 16(g_tTexbfs)
27: 26(ptr) AccessChain 24 25
28: 18(int) Load 27
29: 7(fvec4) ImageRead 17 28
30: 6(float) CompositeExtract 29 0
Store 13(r00) 30
36: 33 Load 35(g_tTexbis)
37: 26(ptr) AccessChain 24 25
38: 18(int) Load 37
39: 21(ivec4) ImageRead 36 38
40: 18(int) CompositeExtract 39 0
Store 32(r01) 40
47: 44 Load 46(g_tTexbus)
48: 26(ptr) AccessChain 24 25
49: 18(int) Load 48
51: 50(ivec4) ImageRead 47 49
52: 41(int) CompositeExtract 51 0
Store 43(r02) 52
58: 57(ptr) AccessChain 54(psout) 25
Store 58 56
60: 12(ptr) AccessChain 54(psout) 59
Store 60 55
61:8(PS_OUTPUT) Load 54(psout)
ReturnValue 61
FunctionEnd