yum-mirror/glslang

git clone https://git.yummers.dev/yum-mirror/glslang

jvronFix relaxed Vulkan access chain traversal for buffer referencese61c8f2e

main
14.8 KiB260 linesraw
1vk.relaxed.buffer_reference.frag
2Shader version: 460
3Requested GL_EXT_buffer_reference
4Requested GL_EXT_buffer_reference2
5Requested GL_EXT_nonuniform_qualifier
6Requested GL_EXT_samplerless_texture_functions
7Requested GL_EXT_scalar_block_layout
8Requested GL_EXT_shader_explicit_arithmetic_types_int64
9gl_FragCoord origin is upper left
100:? Sequence
110:35  Function Definition: SampleMaterial(u1;u1;vf2; ( global highp 4-component vector of float)
120:35    Function Parameters: 
130:35      'material_index' ( in highp uint)
140:35      'texture_index' ( in highp uint)
150:35      'uv' ( in highp 2-component vector of float)
160:37    Sequence
170:37      Branch: Return with expression
180:43        texture ( global highp 4-component vector of float)
190:41          Construct combined texture-sampler ( temp sampler2D)
200:39            indirect index (layout( set=0 binding=0) temp highp texture2D)
210:39              'global_textures_2d' (layout( set=0 binding=0) uniform runtime-sized array of highp texture2D)
220:39              indirect index (layout( std430) temp highp uint)
230:39                textures: direct index for structure (layout( std430) global 4-element array of highp uint)
240:39                  indirect index (layout( column_major std430 offset=0 buffer_reference_align=16) temp structure{layout( std430) global 4-element array of highp uint textures})
250:39                    materials: direct index for structure (layout( column_major std430 offset=0 buffer_reference_align=16) buffer runtime-sized array of structure{layout( std430) global 4-element array of highp uint textures})
260:39                      Convert uint64_t to pointer ( temp reference)
270:39                        materials: direct index for structure ( global uint64_t)
280:39                          global_uniform: direct index for structure (layout( column_major std430 offset=0) uniform structure{ global uint64_t materials})
290:39                            'anon@0' (layout( set=1 binding=0 column_major std430) uniform block{layout( column_major std430 offset=0) uniform structure{ global uint64_t materials} global_uniform})
300:39                            Constant:
310:39                              0 (const uint)
320:39                          Constant:
330:39                            0 (const int)
340:39                      Constant:
350:39                        0 (const int)
360:39                    'material_index' ( in highp uint)
370:39                  Constant:
380:39                    0 (const int)
390:39                'texture_index' ( in highp uint)
400:40            direct index (layout( set=0 binding=2) temp highp sampler)
410:40              'global_samplers' (layout( set=0 binding=2) uniform unsized 1-element array of highp sampler)
420:40              Constant:
430:40                0 (const int)
440:42          'uv' ( in highp 2-component vector of float)
450:46  Function Definition: main( ( global void)
460:46    Function Parameters: 
470:48    Sequence
480:48      move second child to first child ( temp highp 4-component vector of float)
490:48        'out_color' (layout( location=0) out highp 4-component vector of float)
500:48        Function Call: SampleMaterial(u1;u1;vf2; ( global highp 4-component vector of float)
510:48          Constant:
520:48            0 (const uint)
530:48          Constant:
540:48            0 (const uint)
550:48          Constant:
560:48            0.500000
570:48            0.500000
580:?   Linker Objects
590:?     'anon@0' (layout( set=1 binding=0 column_major std430) uniform block{layout( column_major std430 offset=0) uniform structure{ global uint64_t materials} global_uniform})
600:?     'global_textures_2d' (layout( set=0 binding=0) uniform runtime-sized array of highp texture2D)
610:?     'global_samplers' (layout( set=0 binding=2) uniform unsized 1-element array of highp sampler)
620:?     'out_color' (layout( location=0) out highp 4-component vector of float)
63
64
65Linked fragment stage:
66
67
68Shader version: 460
69Requested GL_EXT_buffer_reference
70Requested GL_EXT_buffer_reference2
71Requested GL_EXT_nonuniform_qualifier
72Requested GL_EXT_samplerless_texture_functions
73Requested GL_EXT_scalar_block_layout
74Requested GL_EXT_shader_explicit_arithmetic_types_int64
75gl_FragCoord origin is upper left
760:? Sequence
770:35  Function Definition: SampleMaterial(u1;u1;vf2; ( global highp 4-component vector of float)
780:35    Function Parameters: 
790:35      'material_index' ( in highp uint)
800:35      'texture_index' ( in highp uint)
810:35      'uv' ( in highp 2-component vector of float)
820:37    Sequence
830:37      Branch: Return with expression
840:43        texture ( global highp 4-component vector of float)
850:41          Construct combined texture-sampler ( temp sampler2D)
860:39            indirect index (layout( set=0 binding=0) temp highp texture2D)
870:39              'global_textures_2d' (layout( set=0 binding=0) uniform runtime-sized array of highp texture2D)
880:39              indirect index (layout( std430) temp highp uint)
890:39                textures: direct index for structure (layout( std430) global 4-element array of highp uint)
900:39                  indirect index (layout( column_major std430 offset=0 buffer_reference_align=16) temp structure{layout( std430) global 4-element array of highp uint textures})
910:39                    materials: direct index for structure (layout( column_major std430 offset=0 buffer_reference_align=16) buffer runtime-sized array of structure{layout( std430) global 4-element array of highp uint textures})
920:39                      Convert uint64_t to pointer ( temp reference)
930:39                        materials: direct index for structure ( global uint64_t)
940:39                          global_uniform: direct index for structure (layout( column_major std430 offset=0) uniform structure{ global uint64_t materials})
950:39                            'anon@0' (layout( set=1 binding=0 column_major std430) uniform block{layout( column_major std430 offset=0) uniform structure{ global uint64_t materials} global_uniform})
960:39                            Constant:
970:39                              0 (const uint)
980:39                          Constant:
990:39                            0 (const int)
1000:39                      Constant:
1010:39                        0 (const int)
1020:39                    'material_index' ( in highp uint)
1030:39                  Constant:
1040:39                    0 (const int)
1050:39                'texture_index' ( in highp uint)
1060:40            direct index (layout( set=0 binding=2) temp highp sampler)
1070:40              'global_samplers' (layout( set=0 binding=2) uniform 1-element array of highp sampler)
1080:40              Constant:
1090:40                0 (const int)
1100:42          'uv' ( in highp 2-component vector of float)
1110:46  Function Definition: main( ( global void)
1120:46    Function Parameters: 
1130:48    Sequence
1140:48      move second child to first child ( temp highp 4-component vector of float)
1150:48        'out_color' (layout( location=0) out highp 4-component vector of float)
1160:48        Function Call: SampleMaterial(u1;u1;vf2; ( global highp 4-component vector of float)
1170:48          Constant:
1180:48            0 (const uint)
1190:48          Constant:
1200:48            0 (const uint)
1210:48          Constant:
1220:48            0.500000
1230:48            0.500000
1240:?   Linker Objects
1250:?     'anon@0' (layout( set=1 binding=0 column_major std430) uniform block{layout( column_major std430 offset=0) uniform structure{ global uint64_t materials} global_uniform})
1260:?     'global_textures_2d' (layout( set=0 binding=0) uniform runtime-sized array of highp texture2D)
1270:?     'global_samplers' (layout( set=0 binding=2) uniform 1-element array of highp sampler)
1280:?     'out_color' (layout( location=0) out highp 4-component vector of float)
129
130// Module Version 10000
131// Generated by (magic number): 8000b
132// Id's are bound by 70
133
134                              Capability Shader
135                              Capability Int64
136                              Capability RuntimeDescriptorArrayEXT
137                              Capability PhysicalStorageBufferAddressesEXT
138                              Extension  "SPV_EXT_descriptor_indexing"
139                              Extension  "SPV_KHR_physical_storage_buffer"
140               1:             ExtInstImport  "GLSL.std.450"
141                              MemoryModel PhysicalStorageBuffer64EXT GLSL450
142                              EntryPoint Fragment 4  "main" 62
143                              ExecutionMode 4 OriginUpperLeft
144                              Source GLSL 460
145                              SourceExtension  "GL_EXT_buffer_reference"
146                              SourceExtension  "GL_EXT_buffer_reference2"
147                              SourceExtension  "GL_EXT_nonuniform_qualifier"
148                              SourceExtension  "GL_EXT_samplerless_texture_functions"
149                              SourceExtension  "GL_EXT_scalar_block_layout"
150                              SourceExtension  "GL_EXT_shader_explicit_arithmetic_types_int64"
151                              Name 4  "main"
152                              Name 16  "SampleMaterial(u1;u1;vf2;"
153                              Name 13  "material_index"
154                              Name 14  "texture_index"
155                              Name 15  "uv"
156                              Name 21  "global_textures_2d"
157                              Name 23  "GlobalUniformBufferData"
158                              MemberName 23(GlobalUniformBufferData) 0  "materials"
159                              Name 24  "GlobalUniformBufferDesc"
160                              MemberName 24(GlobalUniformBufferDesc) 0  "global_uniform"
161                              Name 26  ""
162                              Name 35  "Material"
163                              MemberName 35(Material) 0  "textures"
164                              Name 37  "MaterialBuffer"
165                              MemberName 37(MaterialBuffer) 0  "materials"
166                              Name 51  "global_samplers"
167                              Name 62  "out_color"
168                              Name 66  "param"
169                              Name 67  "param"
170                              Name 68  "param"
171                              Decorate 21(global_textures_2d) Binding 0
172                              Decorate 21(global_textures_2d) DescriptorSet 0
173                              MemberDecorate 23(GlobalUniformBufferData) 0 Offset 0
174                              Decorate 24(GlobalUniformBufferDesc) Block
175                              MemberDecorate 24(GlobalUniformBufferDesc) 0 Offset 0
176                              Decorate 26 Binding 0
177                              Decorate 26 DescriptorSet 1
178                              Decorate 34 ArrayStride 4
179                              MemberDecorate 35(Material) 0 Offset 0
180                              Decorate 36 ArrayStride 16
181                              Decorate 37(MaterialBuffer) Block
182                              MemberDecorate 37(MaterialBuffer) 0 Offset 0
183                              Decorate 51(global_samplers) Binding 2
184                              Decorate 51(global_samplers) DescriptorSet 0
185                              Decorate 62(out_color) Location 0
186               2:             TypeVoid
187               3:             TypeFunction 2
188               6:             TypeInt 32 0
189               7:             TypePointer Function 6(int)
190               8:             TypeFloat 32
191               9:             TypeVector 8(float) 2
192              10:             TypePointer Function 9(fvec2)
193              11:             TypeVector 8(float) 4
194              12:             TypeFunction 11(fvec4) 7(ptr) 7(ptr) 10(ptr)
195              18:             TypeImage 8(float) 2D sampled format:Unknown
196              19:             TypeRuntimeArray 18
197              20:             TypePointer UniformConstant 19
19821(global_textures_2d):     20(ptr) Variable UniformConstant
199              22:             TypeInt 64 0
20023(GlobalUniformBufferData):             TypeStruct 22(int64_t)
20124(GlobalUniformBufferDesc):             TypeStruct 23(GlobalUniformBufferData)
202              25:             TypePointer Uniform 24(GlobalUniformBufferDesc)
203              26:     25(ptr) Variable Uniform
204              27:             TypeInt 32 1
205              28:     27(int) Constant 0
206              29:             TypePointer Uniform 22(int64_t)
207                              TypeForwardPointer 32 PhysicalStorageBufferEXT
208              33:      6(int) Constant 4
209              34:             TypeArray 6(int) 33
210    35(Material):             TypeStruct 34
211              36:             TypeRuntimeArray 35(Material)
21237(MaterialBuffer):             TypeStruct 36
213              32:             TypePointer PhysicalStorageBufferEXT 37(MaterialBuffer)
214              41:             TypePointer PhysicalStorageBufferEXT 6(int)
215              44:             TypePointer UniformConstant 18
216              47:             TypeSampler
217              48:      6(int) Constant 1
218              49:             TypeArray 47 48
219              50:             TypePointer UniformConstant 49
22051(global_samplers):     50(ptr) Variable UniformConstant
221              52:             TypePointer UniformConstant 47
222              55:             TypeSampledImage 18
223              61:             TypePointer Output 11(fvec4)
224   62(out_color):     61(ptr) Variable Output
225              63:      6(int) Constant 0
226              64:    8(float) Constant 1056964608
227              65:    9(fvec2) ConstantComposite 64 64
228         4(main):           2 Function None 3
229               5:             Label
230       66(param):      7(ptr) Variable Function
231       67(param):      7(ptr) Variable Function
232       68(param):     10(ptr) Variable Function
233                              Store 66(param) 63
234                              Store 67(param) 63
235                              Store 68(param) 65
236              69:   11(fvec4) FunctionCall 16(SampleMaterial(u1;u1;vf2;) 66(param) 67(param) 68(param)
237                              Store 62(out_color) 69
238                              Return
239                              FunctionEnd
24016(SampleMaterial(u1;u1;vf2;):   11(fvec4) Function None 12
24113(material_index):      7(ptr) FunctionParameter
24214(texture_index):      7(ptr) FunctionParameter
243          15(uv):     10(ptr) FunctionParameter
244              17:             Label
245              30:     29(ptr) AccessChain 26 28 28
246              31: 22(int64_t) Load 30
247              38:     32(ptr) ConvertUToPtr 31
248              39:      6(int) Load 13(material_index)
249              40:      6(int) Load 14(texture_index)
250              42:     41(ptr) AccessChain 38 28 39 28 40
251              43:      6(int) Load 42 Aligned 4
252              45:     44(ptr) AccessChain 21(global_textures_2d) 43
253              46:          18 Load 45
254              53:     52(ptr) AccessChain 51(global_samplers) 28
255              54:          47 Load 53
256              56:          55 SampledImage 46 54
257              57:    9(fvec2) Load 15(uv)
258              58:   11(fvec4) ImageSampleImplicitLod 56 57
259                              ReturnValue 58
260                              FunctionEnd