blob: 09c1dd69637e0f5f9c7d9fa08662705a85ee793e [file] [log] [blame]
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 64
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %main "main" %x_2_param_1 %x_3_param_1 %x_4_1_1
OpExecutionMode %main OriginUpperLeft
OpName %x_2_param_1 "x_2_param_1"
OpName %x_3_param_1 "x_3_param_1"
OpName %x_4_1_1 "x_4_1_1"
OpName %x_2 "x_2"
OpName %x_3 "x_3"
OpName %x_4 "x_4"
OpName %S "S"
OpMemberName %S 0 "field0"
OpName %x_5 "x_5"
OpName %main_1 "main_1"
OpName %main_out "main_out"
OpMemberName %main_out 0 "x_4_1"
OpName %main_inner "main_inner"
OpName %x_2_param "x_2_param"
OpName %x_3_param "x_3_param"
OpName %main "main"
OpDecorate %x_2_param_1 BuiltIn FragCoord
OpDecorate %x_3_param_1 Location 0
OpDecorate %x_3_param_1 Flat
OpDecorate %x_4_1_1 Location 0
OpDecorate %S Block
OpMemberDecorate %S 0 Offset 0
OpDecorate %_runtimearr_int ArrayStride 4
OpDecorate %x_5 DescriptorSet 0
OpDecorate %x_5 Binding 0
OpMemberDecorate %main_out 0 Offset 0
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%_ptr_Input_v4float = OpTypePointer Input %v4float
%x_2_param_1 = OpVariable %_ptr_Input_v4float Input
%int = OpTypeInt 32 1
%_ptr_Input_int = OpTypePointer Input %int
%x_3_param_1 = OpVariable %_ptr_Input_int Input
%_ptr_Output_int = OpTypePointer Output %int
%10 = OpConstantNull %int
%x_4_1_1 = OpVariable %_ptr_Output_int Output %10
%_ptr_Private_v4float = OpTypePointer Private %v4float
%13 = OpConstantNull %v4float
%x_2 = OpVariable %_ptr_Private_v4float Private %13
%_ptr_Private_int = OpTypePointer Private %int
%x_3 = OpVariable %_ptr_Private_int Private %10
%x_4 = OpVariable %_ptr_Private_int Private %10
%_runtimearr_int = OpTypeRuntimeArray %int
%S = OpTypeStruct %_runtimearr_int
%_ptr_StorageBuffer_S = OpTypePointer StorageBuffer %S
%x_5 = OpVariable %_ptr_StorageBuffer_S StorageBuffer
%void = OpTypeVoid
%21 = OpTypeFunction %void
%int_1 = OpConstant %int 1
%bool = OpTypeBool
%uint = OpTypeInt 32 0
%uint_0 = OpConstant %uint 0
%int_8 = OpConstant %int 8
%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
%main_out = OpTypeStruct %int
%49 = OpTypeFunction %main_out %v4float %int
%main_1 = OpFunction %void None %21
%24 = OpLabel
OpStore %x_4 %int_1
%26 = OpLoad %v4float %x_2
%28 = OpCompositeExtract %float %26 0
%27 = OpConvertFToS %int %28
%30 = OpCompositeExtract %float %26 1
%29 = OpConvertFToS %int %30
%31 = OpLoad %int %x_3
%32 = OpBitwiseAnd %int %27 %int_1
%33 = OpBitwiseAnd %int %29 %int_1
%34 = OpIAdd %int %32 %33
%35 = OpIAdd %int %34 %31
%37 = OpCompositeExtract %float %26 2
%36 = OpConvertFToS %int %37
%38 = OpIEqual %bool %35 %36
OpSelectionMerge %40 None
OpBranchConditional %38 %41 %40
%41 = OpLabel
OpBranch %40
%40 = OpLabel
%45 = OpIMul %int %29 %int_8
%46 = OpIAdd %int %27 %45
%48 = OpAccessChain %_ptr_StorageBuffer_int %x_5 %uint_0 %46
OpStore %48 %27
OpReturn
OpFunctionEnd
%main_inner = OpFunction %main_out None %49
%x_2_param = OpFunctionParameter %v4float
%x_3_param = OpFunctionParameter %int
%54 = OpLabel
OpStore %x_2 %x_2_param
OpStore %x_3 %x_3_param
%55 = OpFunctionCall %void %main_1
%56 = OpLoad %int %x_4
%57 = OpCompositeConstruct %main_out %56
OpReturnValue %57
OpFunctionEnd
%main = OpFunction %void None %21
%59 = OpLabel
%61 = OpLoad %v4float %x_2_param_1
%62 = OpLoad %int %x_3_param_1
%60 = OpFunctionCall %main_out %main_inner %61 %62
%63 = OpCompositeExtract %int %60 0
OpStore %x_4_1_1 %63
OpReturn
OpFunctionEnd