blob: 1802700d17f79393d992cfb5fa9731968e10c1d6 [file] [log] [blame]
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 78
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %main "main" %tint_symbol
OpExecutionMode %main LocalSize 1 1 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 %tint_symbol "tint_symbol"
OpName %main "main"
OpName %flatIndex "flatIndex"
OpName %texel "texel"
OpName %i "i"
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
OpDecorate %tint_symbol BuiltIn GlobalInvocationId
%int = OpTypeInt 32 1
%Constants = OpTypeStruct %int
%_ptr_Uniform_Constants = OpTypePointer Uniform %Constants
%constants = OpVariable %_ptr_Uniform_Constants Uniform
%float = OpTypeFloat 32
%7 = OpTypeImage %float 2D 0 1 0 1 Unknown
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%myTexture = OpVariable %_ptr_UniformConstant_7 UniformConstant
%_runtimearr_float = OpTypeRuntimeArray %float
%Result = OpTypeStruct %_runtimearr_float
%_ptr_StorageBuffer_Result = OpTypePointer StorageBuffer %Result
%result = OpVariable %_ptr_StorageBuffer_Result StorageBuffer
%uint = OpTypeInt 32 0
%v3uint = OpTypeVector %uint 3
%_ptr_Input_v3uint = OpTypePointer Input %v3uint
%tint_symbol = OpVariable %_ptr_Input_v3uint Input
%void = OpTypeVoid
%17 = OpTypeFunction %void
%uint_2 = OpConstant %uint 2
%_ptr_Input_uint = OpTypePointer Input %uint
%uint_1 = OpConstant %uint 1
%uint_0 = OpConstant %uint 0
%_ptr_Function_uint = OpTypePointer Function %uint
%38 = OpConstantNull %uint
%v4float = OpTypeVector %float 4
%v3int = OpTypeVector %int 3
%v2int = OpTypeVector %int 2
%v2uint = OpTypeVector %uint 2
%int_0 = OpConstant %int 0
%_ptr_Function_v4float = OpTypePointer Function %v4float
%56 = OpConstantNull %v4float
%bool = OpTypeBool
%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
%_ptr_Function_float = OpTypePointer Function %float
%main = OpFunction %void None %17
%20 = OpLabel
%flatIndex = OpVariable %_ptr_Function_uint Function %38
%texel = OpVariable %_ptr_Function_v4float Function %56
%i = OpVariable %_ptr_Function_uint Function %38
%22 = OpIMul %uint %uint_2 %uint_2
%24 = OpAccessChain %_ptr_Input_uint %tint_symbol %uint_2
%25 = OpLoad %uint %24
%26 = OpIMul %uint %22 %25
%28 = OpAccessChain %_ptr_Input_uint %tint_symbol %uint_1
%29 = OpLoad %uint %28
%30 = OpIMul %uint %uint_2 %29
%31 = OpIAdd %uint %26 %30
%33 = OpAccessChain %_ptr_Input_uint %tint_symbol %uint_0
%34 = OpLoad %uint %33
%35 = OpIAdd %uint %31 %34
OpStore %flatIndex %35
%39 = OpLoad %uint %flatIndex
%40 = OpIMul %uint %39 %uint_1
OpStore %flatIndex %40
%43 = OpLoad %7 %myTexture
%48 = OpLoad %v3uint %tint_symbol
%49 = OpVectorShuffle %v2uint %48 %48 0 1
%45 = OpBitcast %v2int %49
%50 = OpCompositeExtract %int %45 0
%51 = OpCompositeExtract %int %45 1
%53 = OpCompositeConstruct %v3int %50 %51 %int_0
%41 = OpImageFetch %v4float %43 %53 Lod %int_0
OpStore %texel %41
OpStore %i %uint_0
OpBranch %58
%58 = OpLabel
OpLoopMerge %59 %60 None
OpBranch %61
%61 = OpLabel
%63 = OpLoad %uint %i
%64 = OpULessThan %bool %63 %uint_1
%62 = OpLogicalNot %bool %64
OpSelectionMerge %66 None
OpBranchConditional %62 %67 %66
%67 = OpLabel
OpBranch %59
%66 = OpLabel
%68 = OpLoad %uint %flatIndex
%69 = OpLoad %uint %i
%70 = OpIAdd %uint %68 %69
%72 = OpAccessChain %_ptr_StorageBuffer_float %result %uint_0 %70
%74 = OpAccessChain %_ptr_Function_float %texel %uint_0
%75 = OpLoad %float %74
OpStore %72 %75
OpBranch %60
%60 = OpLabel
%76 = OpLoad %uint %i
%77 = OpIAdd %uint %76 %uint_1
OpStore %i %77
OpBranch %58
%59 = OpLabel
OpReturn
OpFunctionEnd