blob: 71611618dfd8385dadfe67066889d305b7dbe05b [file] [log] [blame]
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 80
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %main "main" %GlobalInvocationID_1
OpExecutionMode %main LocalSize 1 1 1
OpName %GlobalInvocationID_1 "GlobalInvocationID_1"
OpName %constants_block "constants_block"
OpMemberName %constants_block 0 "inner"
OpName %Constants "Constants"
OpMemberName %Constants 0 "level"
OpName %constants "constants"
OpName %myTexture "myTexture"
OpName %Result "Result"
OpMemberName %Result 0 "values"
OpName %result "result"
OpName %main_inner "main_inner"
OpName %GlobalInvocationID "GlobalInvocationID"
OpName %flatIndex "flatIndex"
OpName %texel "texel"
OpName %i "i"
OpName %main "main"
OpDecorate %GlobalInvocationID_1 BuiltIn GlobalInvocationId
OpDecorate %constants_block Block
OpMemberDecorate %constants_block 0 Offset 0
OpMemberDecorate %Constants 0 Offset 0
OpDecorate %constants NonWritable
OpDecorate %constants DescriptorSet 0
OpDecorate %constants Binding 0
OpDecorate %myTexture DescriptorSet 0
OpDecorate %myTexture Binding 1
OpDecorate %Result Block
OpMemberDecorate %Result 0 Offset 0
OpDecorate %_runtimearr_float ArrayStride 4
OpDecorate %result DescriptorSet 0
OpDecorate %result Binding 3
%uint = OpTypeInt 32 0
%v3uint = OpTypeVector %uint 3
%_ptr_Input_v3uint = OpTypePointer Input %v3uint
%GlobalInvocationID_1 = OpVariable %_ptr_Input_v3uint Input
%int = OpTypeInt 32 1
%Constants = OpTypeStruct %int
%constants_block = OpTypeStruct %Constants
%_ptr_Uniform_constants_block = OpTypePointer Uniform %constants_block
%constants = OpVariable %_ptr_Uniform_constants_block Uniform
%float = OpTypeFloat 32
%12 = OpTypeImage %float 2D 0 1 0 1 Unknown
%_ptr_UniformConstant_12 = OpTypePointer UniformConstant %12
%myTexture = OpVariable %_ptr_UniformConstant_12 UniformConstant
%_runtimearr_float = OpTypeRuntimeArray %float
%Result = OpTypeStruct %_runtimearr_float
%_ptr_StorageBuffer_Result = OpTypePointer StorageBuffer %Result
%result = OpVariable %_ptr_StorageBuffer_Result StorageBuffer
%void = OpTypeVoid
%18 = OpTypeFunction %void %v3uint
%uint_4 = OpConstant %uint 4
%uint_2 = OpConstant %uint 2
%_ptr_Function_uint = OpTypePointer Function %uint
%34 = OpConstantNull %uint
%uint_1 = OpConstant %uint 1
%v4float = OpTypeVector %float 4
%v3int = OpTypeVector %int 3
%v2int = OpTypeVector %int 2
%v2uint = OpTypeVector %uint 2
%48 = OpConstantNull %int
%_ptr_Function_v4float = OpTypePointer Function %v4float
%52 = OpConstantNull %v4float
%bool = OpTypeBool
%uint_0 = OpConstant %uint 0
%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
%_ptr_Function_float = OpTypePointer Function %float
%75 = OpTypeFunction %void
%main_inner = OpFunction %void None %18
%GlobalInvocationID = OpFunctionParameter %v3uint
%22 = OpLabel
%flatIndex = OpVariable %_ptr_Function_uint Function %34
%texel = OpVariable %_ptr_Function_v4float Function %52
%i = OpVariable %_ptr_Function_uint Function %34
%24 = OpCompositeExtract %uint %GlobalInvocationID 2
%25 = OpIMul %uint %uint_4 %24
%27 = OpCompositeExtract %uint %GlobalInvocationID 1
%28 = OpIMul %uint %uint_2 %27
%29 = OpIAdd %uint %25 %28
%30 = OpCompositeExtract %uint %GlobalInvocationID 0
%31 = OpIAdd %uint %29 %30
OpStore %flatIndex %31
%35 = OpLoad %uint %flatIndex
%37 = OpIMul %uint %35 %uint_1
OpStore %flatIndex %37
%40 = OpLoad %12 %myTexture
%45 = OpVectorShuffle %v2uint %GlobalInvocationID %GlobalInvocationID 0 1
%42 = OpBitcast %v2int %45
%46 = OpCompositeExtract %int %42 0
%47 = OpCompositeExtract %int %42 1
%49 = OpCompositeConstruct %v3int %46 %47 %48
%38 = OpImageFetch %v4float %40 %49 Lod %48
OpStore %texel %38
OpStore %i %34
OpBranch %54
%54 = OpLabel
OpLoopMerge %55 %56 None
OpBranch %57
%57 = OpLabel
%59 = OpLoad %uint %i
%60 = OpULessThan %bool %59 %uint_1
%58 = OpLogicalNot %bool %60
OpSelectionMerge %62 None
OpBranchConditional %58 %63 %62
%63 = OpLabel
OpBranch %55
%62 = OpLabel
%65 = OpLoad %uint %flatIndex
%66 = OpLoad %uint %i
%67 = OpIAdd %uint %65 %66
%69 = OpAccessChain %_ptr_StorageBuffer_float %result %uint_0 %67
%71 = OpAccessChain %_ptr_Function_float %texel %uint_0
%72 = OpLoad %float %71
OpStore %69 %72
OpBranch %56
%56 = OpLabel
%73 = OpLoad %uint %i
%74 = OpIAdd %uint %73 %uint_1
OpStore %i %74
OpBranch %54
%55 = OpLabel
OpReturn
OpFunctionEnd
%main = OpFunction %void None %75
%77 = OpLabel
%79 = OpLoad %v3uint %GlobalInvocationID_1
%78 = OpFunctionCall %void %main_inner %79
OpReturn
OpFunctionEnd