blob: 4ad4cef2b45d339043cb02efcb743e5408cb8285 [file] [log] [blame]
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 79
; 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 "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
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
%_ptr_Uniform_Constants = OpTypePointer Uniform %Constants
%constants = OpVariable %_ptr_Uniform_Constants Uniform
%float = OpTypeFloat 32
%11 = OpTypeImage %float 2D 0 1 0 1 Unknown
%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
%myTexture = OpVariable %_ptr_UniformConstant_11 UniformConstant
%_runtimearr_float = OpTypeRuntimeArray %float
%Result = OpTypeStruct %_runtimearr_float
%_ptr_StorageBuffer_Result = OpTypePointer StorageBuffer %Result
%result = OpVariable %_ptr_StorageBuffer_Result StorageBuffer
%void = OpTypeVoid
%17 = OpTypeFunction %void %v3uint
%uint_2 = OpConstant %uint 2
%_ptr_Function_uint = OpTypePointer Function %uint
%33 = OpConstantNull %uint
%uint_1 = OpConstant %uint 1
%v4float = OpTypeVector %float 4
%v3int = OpTypeVector %int 3
%v2int = OpTypeVector %int 2
%v2uint = OpTypeVector %uint 2
%47 = OpConstantNull %int
%_ptr_Function_v4float = OpTypePointer Function %v4float
%51 = OpConstantNull %v4float
%bool = OpTypeBool
%uint_0 = OpConstant %uint 0
%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
%_ptr_Function_float = OpTypePointer Function %float
%74 = OpTypeFunction %void
%main_inner = OpFunction %void None %17
%GlobalInvocationID = OpFunctionParameter %v3uint
%21 = OpLabel
%flatIndex = OpVariable %_ptr_Function_uint Function %33
%texel = OpVariable %_ptr_Function_v4float Function %51
%i = OpVariable %_ptr_Function_uint Function %33
%23 = OpIMul %uint %uint_2 %uint_2
%24 = OpCompositeExtract %uint %GlobalInvocationID 2
%25 = OpIMul %uint %23 %24
%26 = OpCompositeExtract %uint %GlobalInvocationID 1
%27 = OpIMul %uint %uint_2 %26
%28 = OpIAdd %uint %25 %27
%29 = OpCompositeExtract %uint %GlobalInvocationID 0
%30 = OpIAdd %uint %28 %29
OpStore %flatIndex %30
%34 = OpLoad %uint %flatIndex
%36 = OpIMul %uint %34 %uint_1
OpStore %flatIndex %36
%39 = OpLoad %11 %myTexture
%44 = OpVectorShuffle %v2uint %GlobalInvocationID %GlobalInvocationID 0 1
%41 = OpBitcast %v2int %44
%45 = OpCompositeExtract %int %41 0
%46 = OpCompositeExtract %int %41 1
%48 = OpCompositeConstruct %v3int %45 %46 %47
%37 = OpImageFetch %v4float %39 %48 Lod %47
OpStore %texel %37
OpStore %i %33
OpBranch %53
%53 = OpLabel
OpLoopMerge %54 %55 None
OpBranch %56
%56 = OpLabel
%58 = OpLoad %uint %i
%59 = OpULessThan %bool %58 %uint_1
%57 = OpLogicalNot %bool %59
OpSelectionMerge %61 None
OpBranchConditional %57 %62 %61
%62 = OpLabel
OpBranch %54
%61 = OpLabel
%64 = OpLoad %uint %flatIndex
%65 = OpLoad %uint %i
%66 = OpIAdd %uint %64 %65
%68 = OpAccessChain %_ptr_StorageBuffer_float %result %uint_0 %66
%70 = OpAccessChain %_ptr_Function_float %texel %uint_0
%71 = OpLoad %float %70
OpStore %68 %71
OpBranch %55
%55 = OpLabel
%72 = OpLoad %uint %i
%73 = OpIAdd %uint %72 %uint_1
OpStore %i %73
OpBranch %53
%54 = OpLabel
OpReturn
OpFunctionEnd
%main = OpFunction %void None %74
%76 = OpLabel
%78 = OpLoad %v3uint %GlobalInvocationID_1
%77 = OpFunctionCall %void %main_inner %78
OpReturn
OpFunctionEnd