| 1 |
; SPIR-V |
| 2 |
; Version: 1.3 |
| 3 |
; Generator: Khronos SPIR-V Tools Assembler; 0 |
| 4 |
; Bound: 40 |
| 5 |
; Schema: 0 |
| 6 |
OpCapability Shader |
| 7 |
OpCapability VariablePointers |
| 8 |
%1 = OpExtInstImport "GLSL.std.450" |
| 9 |
OpMemoryModel Logical GLSL450 |
| 10 |
OpEntryPoint GLCompute %main "main" %gl_GlobalInvocationID |
| 11 |
OpExecutionMode %main LocalSize 1 1 1 |
| 12 |
OpSource GLSL 450 |
| 13 |
OpName %main "main" |
| 14 |
OpName %foo "foo" |
| 15 |
OpMemberName %foo 0 "a" |
| 16 |
OpName %bar "bar" |
| 17 |
OpMemberName %bar 0 "b" |
| 18 |
OpName %x "x" |
| 19 |
OpName %y "y" |
| 20 |
OpName %a "a" |
| 21 |
OpName %b "b" |
| 22 |
OpMemberDecorate %foo 0 Offset 0 |
| 23 |
OpMemberDecorate %bar 0 Offset 0 |
| 24 |
OpDecorate %foo Block |
| 25 |
OpDecorate %bar Block |
| 26 |
OpDecorate %x DescriptorSet 0 |
| 27 |
OpDecorate %x Binding 0 |
| 28 |
OpDecorate %y DescriptorSet 0 |
| 29 |
OpDecorate %y Binding 1 |
| 30 |
OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId |
| 31 |
%void = OpTypeVoid |
| 32 |
%11 = OpTypeFunction %void |
| 33 |
%int = OpTypeInt 32 1 |
| 34 |
%uint = OpTypeInt 32 0 |
| 35 |
%v3uint = OpTypeVector %uint 3 |
| 36 |
%_ptr_Input_v3uint = OpTypePointer Input %v3uint |
| 37 |
%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input |
| 38 |
%foo = OpTypeStruct %int |
| 39 |
%_ptr_StorageBuffer_foo = OpTypePointer StorageBuffer %foo |
| 40 |
%x = OpVariable %_ptr_StorageBuffer_foo StorageBuffer |
| 41 |
%bar = OpTypeStruct %int |
| 42 |
%_ptr_StorageBuffer_bar = OpTypePointer StorageBuffer %bar |
| 43 |
%y = OpVariable %_ptr_StorageBuffer_bar StorageBuffer |
| 44 |
%uint_0 = OpConstant %uint 0 |
| 45 |
%int_0 = OpConstant %int 0 |
| 46 |
%bool = OpTypeBool |
| 47 |
%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int |
| 48 |
%22 = OpTypeFunction %_ptr_StorageBuffer_int %_ptr_StorageBuffer_foo %_ptr_StorageBuffer_bar |
| 49 |
%_ptr_Function__ptr_StorageBuffer_int = OpTypePointer Function %_ptr_StorageBuffer_int |
| 50 |
%24 = OpFunction %_ptr_StorageBuffer_int None %22 |
| 51 |
%a = OpFunctionParameter %_ptr_StorageBuffer_foo |
| 52 |
%b = OpFunctionParameter %_ptr_StorageBuffer_bar |
| 53 |
%25 = OpLabel |
| 54 |
%26 = OpLoad %v3uint %gl_GlobalInvocationID |
| 55 |
%27 = OpCompositeExtract %uint %26 0 |
| 56 |
%28 = OpINotEqual %bool %27 %uint_0 |
| 57 |
%29 = OpAccessChain %_ptr_StorageBuffer_int %a %uint_0 |
| 58 |
%30 = OpAccessChain %_ptr_StorageBuffer_int %b %uint_0 |
| 59 |
%31 = OpSelect %_ptr_StorageBuffer_int %28 %29 %30 |
| 60 |
OpReturnValue %31 |
| 61 |
OpFunctionEnd |
| 62 |
%main = OpFunction %void None %11 |
| 63 |
%32 = OpLabel |
| 64 |
%33 = OpVariable %_ptr_Function__ptr_StorageBuffer_int Function |
| 65 |
%34 = OpFunctionCall %_ptr_StorageBuffer_int %24 %x %y |
| 66 |
OpStore %33 %34 |
| 67 |
%35 = OpLoad %_ptr_StorageBuffer_int %33 |
| 68 |
%36 = OpAccessChain %_ptr_StorageBuffer_int %x %uint_0 |
| 69 |
%37 = OpLoad %int %36 |
| 70 |
OpStore %35 %int_0 |
| 71 |
%38 = OpIAdd %int %37 %37 |
| 72 |
%39 = OpAccessChain %_ptr_StorageBuffer_int %y %uint_0 |
| 73 |
OpStore %39 %38 |
| 74 |
OpReturn |
| 75 |
OpFunctionEnd |