blob: 04622ada74517a5a7c069ec18f26206732598906 [file] [log] [blame]
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 153
; Schema: 0
OpCapability Shader
%61 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %main "main" %gl_FragCoord_param_1 %x_GLF_color_1_1
OpExecutionMode %main OriginUpperLeft
OpName %gl_FragCoord_param_1 "gl_FragCoord_param_1"
OpName %x_GLF_color_1_1 "x_GLF_color_1_1"
OpName %buf0 "buf0"
OpMemberName %buf0 0 "x_GLF_uniform_float_values"
OpName %x_7 "x_7"
OpName %buf1 "buf1"
OpMemberName %buf1 0 "x_GLF_uniform_int_values"
OpName %x_10 "x_10"
OpName %gl_FragCoord "gl_FragCoord"
OpName %x_GLF_color "x_GLF_color"
OpName %main_1 "main_1"
OpName %data "data"
OpName %b "b"
OpName %y "y"
OpName %i "i"
OpName %x_82 "x_82"
OpName %x_83_phi "x_83_phi"
OpName %main_out "main_out"
OpMemberName %main_out 0 "x_GLF_color_1"
OpName %main_inner "main_inner"
OpName %gl_FragCoord_param "gl_FragCoord_param"
OpName %main "main"
OpDecorate %gl_FragCoord_param_1 BuiltIn FragCoord
OpDecorate %x_GLF_color_1_1 Location 0
OpDecorate %buf0 Block
OpMemberDecorate %buf0 0 Offset 0
OpDecorate %_arr_float_uint_1 ArrayStride 16
OpDecorate %x_7 NonWritable
OpDecorate %x_7 DescriptorSet 0
OpDecorate %x_7 Binding 0
OpDecorate %buf1 Block
OpMemberDecorate %buf1 0 Offset 0
OpDecorate %_arr_int_uint_4 ArrayStride 16
OpDecorate %x_10 NonWritable
OpDecorate %x_10 DescriptorSet 0
OpDecorate %x_10 Binding 1
OpDecorate %_arr_v4float_uint_2 ArrayStride 16
OpMemberDecorate %main_out 0 Offset 0
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%_ptr_Input_v4float = OpTypePointer Input %v4float
%gl_FragCoord_param_1 = OpVariable %_ptr_Input_v4float Input
%_ptr_Output_v4float = OpTypePointer Output %v4float
%7 = OpConstantNull %v4float
%x_GLF_color_1_1 = OpVariable %_ptr_Output_v4float Output %7
%uint = OpTypeInt 32 0
%uint_1 = OpConstant %uint 1
%_arr_float_uint_1 = OpTypeArray %float %uint_1
%buf0 = OpTypeStruct %_arr_float_uint_1
%_ptr_Uniform_buf0 = OpTypePointer Uniform %buf0
%x_7 = OpVariable %_ptr_Uniform_buf0 Uniform
%int = OpTypeInt 32 1
%uint_4 = OpConstant %uint 4
%_arr_int_uint_4 = OpTypeArray %int %uint_4
%buf1 = OpTypeStruct %_arr_int_uint_4
%_ptr_Uniform_buf1 = OpTypePointer Uniform %buf1
%x_10 = OpVariable %_ptr_Uniform_buf1 Uniform
%_ptr_Private_v4float = OpTypePointer Private %v4float
%gl_FragCoord = OpVariable %_ptr_Private_v4float Private %7
%x_GLF_color = OpVariable %_ptr_Private_v4float Private %7
%void = OpTypeVoid
%23 = OpTypeFunction %void
%uint_2 = OpConstant %uint 2
%_arr_v4float_uint_2 = OpTypeArray %v4float %uint_2
%_ptr_Function__arr_v4float_uint_2 = OpTypePointer Function %_arr_v4float_uint_2
%31 = OpConstantNull %_arr_v4float_uint_2
%_ptr_Function_int = OpTypePointer Function %int
%34 = OpConstantNull %int
%uint_0 = OpConstant %uint 0
%int_0 = OpConstant %int 0
%_ptr_Uniform_float = OpTypePointer Uniform %float
%int_1 = OpConstant %int 1
%_ptr_Uniform_int = OpTypePointer Uniform %int
%_ptr_Private_float = OpTypePointer Private %float
%bool = OpTypeBool
%_ptr_Function_bool = OpTypePointer Function %bool
%74 = OpConstantNull %bool
%int_2 = OpConstant %int 2
%int_3 = OpConstant %int 3
%_ptr_Function_v4float = OpTypePointer Function %v4float
%main_out = OpTypeStruct %v4float
%140 = OpTypeFunction %main_out %v4float
%main_1 = OpFunction %void None %23
%26 = OpLabel
%data = OpVariable %_ptr_Function__arr_v4float_uint_2 Function %31
%b = OpVariable %_ptr_Function_int Function %34
%y = OpVariable %_ptr_Function_int Function %34
%i = OpVariable %_ptr_Function_int Function %34
%x_82 = OpVariable %_ptr_Function_bool Function %74
%x_83_phi = OpVariable %_ptr_Function_bool Function %74
%40 = OpAccessChain %_ptr_Uniform_float %x_7 %uint_0 %int_0
%41 = OpLoad %float %40
%42 = OpAccessChain %_ptr_Uniform_float %x_7 %uint_0 %int_0
%43 = OpLoad %float %42
%44 = OpCompositeConstruct %v4float %41 %41 %41 %41
%45 = OpCompositeConstruct %v4float %43 %43 %43 %43
%46 = OpCompositeConstruct %_arr_v4float_uint_2 %44 %45
OpStore %data %46
%49 = OpAccessChain %_ptr_Uniform_int %x_10 %uint_0 %int_1
%50 = OpLoad %int %49
OpStore %b %50
%52 = OpAccessChain %_ptr_Private_float %gl_FragCoord %uint_1
%53 = OpLoad %float %52
%54 = OpAccessChain %_ptr_Uniform_int %x_10 %uint_0 %int_1
%55 = OpLoad %int %54
%56 = OpAccessChain %_ptr_Private_float %gl_FragCoord %uint_1
%57 = OpLoad %float %56
%58 = OpAccessChain %_ptr_Uniform_int %x_10 %uint_0 %int_1
%59 = OpLoad %int %58
%62 = OpConvertFToS %int %53
%63 = OpConvertFToS %int %57
%64 = OpBitwiseOr %int %55 %63
%60 = OpExtInst %int %61 SClamp %62 %64 %59
OpStore %y %60
%65 = OpAccessChain %_ptr_Uniform_int %x_10 %uint_0 %int_1
%66 = OpLoad %int %65
OpStore %i %66
OpBranch %67
%67 = OpLabel
OpLoopMerge %68 %69 None
OpBranch %70
%70 = OpLabel
%76 = OpLoad %int %i
%77 = OpAccessChain %_ptr_Uniform_int %x_10 %uint_0 %int_0
%78 = OpLoad %int %77
%79 = OpSLessThan %bool %76 %78
OpSelectionMerge %80 None
OpBranchConditional %79 %81 %82
%81 = OpLabel
OpBranch %80
%82 = OpLabel
OpBranch %68
%80 = OpLabel
%83 = OpLoad %int %b
%84 = OpAccessChain %_ptr_Uniform_int %x_10 %uint_0 %int_0
%85 = OpLoad %int %84
%86 = OpSGreaterThan %bool %83 %85
OpStore %x_83_phi %86
OpSelectionMerge %87 None
OpBranchConditional %86 %88 %87
%88 = OpLabel
%89 = OpLoad %int %y
%90 = OpAccessChain %_ptr_Uniform_int %x_10 %uint_0 %int_1
%91 = OpLoad %int %90
%92 = OpSGreaterThan %bool %89 %91
OpStore %x_82 %92
%93 = OpLoad %bool %x_82
OpStore %x_83_phi %93
OpBranch %87
%87 = OpLabel
%94 = OpLoad %bool %x_83_phi
OpSelectionMerge %95 None
OpBranchConditional %94 %96 %95
%96 = OpLabel
OpBranch %68
%95 = OpLabel
%97 = OpLoad %int %b
%98 = OpIAdd %int %97 %int_1
OpStore %b %98
OpBranch %69
%69 = OpLabel
%99 = OpLoad %int %i
%100 = OpIAdd %int %99 %int_1
OpStore %i %100
OpBranch %67
%68 = OpLabel
%101 = OpLoad %int %b
%102 = OpAccessChain %_ptr_Uniform_int %x_10 %uint_0 %int_0
%103 = OpLoad %int %102
%104 = OpIEqual %bool %101 %103
OpSelectionMerge %105 None
OpBranchConditional %104 %106 %105
%106 = OpLabel
%108 = OpAccessChain %_ptr_Uniform_int %x_10 %uint_0 %int_2
%109 = OpLoad %int %108
%110 = OpAccessChain %_ptr_Uniform_int %x_10 %uint_0 %int_1
%111 = OpLoad %int %110
%113 = OpAccessChain %_ptr_Uniform_int %x_10 %uint_0 %int_3
%114 = OpLoad %int %113
%115 = OpAccessChain %_ptr_Uniform_int %x_10 %uint_0 %int_1
%116 = OpLoad %int %115
%117 = OpAccessChain %_ptr_Uniform_int %x_10 %uint_0 %int_2
%118 = OpLoad %int %117
%119 = OpAccessChain %_ptr_Uniform_int %x_10 %uint_0 %int_2
%120 = OpLoad %int %119
%121 = OpAccessChain %_ptr_Uniform_int %x_10 %uint_0 %int_1
%122 = OpLoad %int %121
%123 = OpExtInst %int %61 SClamp %109 %111 %114
%125 = OpAccessChain %_ptr_Function_v4float %data %123
%126 = OpConvertSToF %float %116
%127 = OpConvertSToF %float %118
%128 = OpConvertSToF %float %120
%129 = OpConvertSToF %float %122
%130 = OpCompositeConstruct %v4float %126 %127 %128 %129
OpStore %125 %130
OpBranch %105
%105 = OpLabel
%131 = OpAccessChain %_ptr_Uniform_int %x_10 %uint_0 %int_1
%132 = OpLoad %int %131
%133 = OpAccessChain %_ptr_Function_v4float %data %132
%134 = OpLoad %v4float %133
%135 = OpCompositeExtract %float %134 0
%136 = OpCompositeExtract %float %134 1
%137 = OpCompositeExtract %float %134 2
%138 = OpCompositeExtract %float %134 3
%139 = OpCompositeConstruct %v4float %135 %136 %137 %138
OpStore %x_GLF_color %139
OpReturn
OpFunctionEnd
%main_inner = OpFunction %main_out None %140
%gl_FragCoord_param = OpFunctionParameter %v4float
%144 = OpLabel
OpStore %gl_FragCoord %gl_FragCoord_param
%145 = OpFunctionCall %void %main_1
%146 = OpLoad %v4float %x_GLF_color
%147 = OpCompositeConstruct %main_out %146
OpReturnValue %147
OpFunctionEnd
%main = OpFunction %void None %23
%149 = OpLabel
%151 = OpLoad %v4float %gl_FragCoord_param_1
%150 = OpFunctionCall %main_out %main_inner %151
%152 = OpCompositeExtract %v4float %150 0
OpStore %x_GLF_color_1_1 %152
OpReturn
OpFunctionEnd