blob: 53fe0c332b217ae64ea812df206c9c58c5388500 [file] [log] [blame]
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 1
; Bound: 185
; Schema: 0
OpCapability Shader
%85 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpEntryPoint Vertex %vertex_main "vertex_main" %vertex_main_position_Output %vertex_main_loc0_Output %vertex_main___point_size_Output
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpMemberName %tint_symbol_1 0 "tint_symbol"
OpName %tint_symbol_1 "tint_symbol_1"
OpName %arg_0_plane0 "arg_0_plane0"
OpName %arg_0_plane1 "arg_0_plane1"
OpMemberName %tint_ExternalTextureParams_std140 0 "numPlanes"
OpMemberName %tint_ExternalTextureParams_std140 1 "doYuvToRgbConversionOnly"
OpMemberName %tint_ExternalTextureParams_std140 2 "yuvToRgbConversionMatrix"
OpMemberName %tint_GammaTransferParams 0 "G"
OpMemberName %tint_GammaTransferParams 1 "A"
OpMemberName %tint_GammaTransferParams 2 "B"
OpMemberName %tint_GammaTransferParams 3 "C"
OpMemberName %tint_GammaTransferParams 4 "D"
OpMemberName %tint_GammaTransferParams 5 "E"
OpMemberName %tint_GammaTransferParams 6 "F"
OpMemberName %tint_GammaTransferParams 7 "padding"
OpName %tint_GammaTransferParams "tint_GammaTransferParams"
OpMemberName %tint_ExternalTextureParams_std140 3 "gammaDecodeParams"
OpMemberName %tint_ExternalTextureParams_std140 4 "gammaEncodeParams"
OpMemberName %tint_ExternalTextureParams_std140 5 "gamutConversionMatrix_col0"
OpMemberName %tint_ExternalTextureParams_std140 6 "gamutConversionMatrix_col1"
OpMemberName %tint_ExternalTextureParams_std140 7 "gamutConversionMatrix_col2"
OpMemberName %tint_ExternalTextureParams_std140 8 "sampleTransform_col0"
OpMemberName %tint_ExternalTextureParams_std140 9 "sampleTransform_col1"
OpMemberName %tint_ExternalTextureParams_std140 10 "sampleTransform_col2"
OpMemberName %tint_ExternalTextureParams_std140 11 "loadTransform_col0"
OpMemberName %tint_ExternalTextureParams_std140 12 "loadTransform_col1"
OpMemberName %tint_ExternalTextureParams_std140 13 "loadTransform_col2"
OpMemberName %tint_ExternalTextureParams_std140 14 "samplePlane0RectMin"
OpMemberName %tint_ExternalTextureParams_std140 15 "samplePlane0RectMax"
OpMemberName %tint_ExternalTextureParams_std140 16 "samplePlane1RectMin"
OpMemberName %tint_ExternalTextureParams_std140 17 "samplePlane1RectMax"
OpMemberName %tint_ExternalTextureParams_std140 18 "visibleSize"
OpMemberName %tint_ExternalTextureParams_std140 19 "plane1CoordFactor"
OpName %tint_ExternalTextureParams_std140 "tint_ExternalTextureParams_std140"
OpMemberName %tint_symbol_3_std140 0 "tint_symbol_2"
OpName %tint_symbol_3_std140 "tint_symbol_3_std140"
OpName %vertex_main_position_Output "vertex_main_position_Output"
OpName %vertex_main_loc0_Output "vertex_main_loc0_Output"
OpName %vertex_main___point_size_Output "vertex_main___point_size_Output"
OpName %textureLoad_8acf41 "textureLoad_8acf41"
OpMemberName %tint_ExternalTextureParams 0 "numPlanes"
OpMemberName %tint_ExternalTextureParams 1 "doYuvToRgbConversionOnly"
OpMemberName %tint_ExternalTextureParams 2 "yuvToRgbConversionMatrix"
OpMemberName %tint_ExternalTextureParams 3 "gammaDecodeParams"
OpMemberName %tint_ExternalTextureParams 4 "gammaEncodeParams"
OpMemberName %tint_ExternalTextureParams 5 "gamutConversionMatrix"
OpMemberName %tint_ExternalTextureParams 6 "sampleTransform"
OpMemberName %tint_ExternalTextureParams 7 "loadTransform"
OpMemberName %tint_ExternalTextureParams 8 "samplePlane0RectMin"
OpMemberName %tint_ExternalTextureParams 9 "samplePlane0RectMax"
OpMemberName %tint_ExternalTextureParams 10 "samplePlane1RectMin"
OpMemberName %tint_ExternalTextureParams 11 "samplePlane1RectMax"
OpMemberName %tint_ExternalTextureParams 12 "visibleSize"
OpMemberName %tint_ExternalTextureParams 13 "plane1CoordFactor"
OpName %tint_ExternalTextureParams "tint_ExternalTextureParams"
OpName %res "res"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpName %vertex_main_inner "vertex_main_inner"
OpMemberName %VertexOutput 0 "pos"
OpMemberName %VertexOutput 1 "prevent_dce"
OpName %VertexOutput "VertexOutput"
OpName %out "out"
OpName %tint_TextureLoadExternal "tint_TextureLoadExternal"
OpName %plane_0 "plane_0"
OpName %plane_1 "plane_1"
OpName %params "params"
OpName %coords "coords"
OpName %tint_GammaCorrection "tint_GammaCorrection"
OpName %v "v"
OpName %params_0 "params"
OpName %vertex_main "vertex_main"
OpName %convert_tint_ExternalTextureParams "convert_tint_ExternalTextureParams"
OpName %input "input"
OpMemberDecorate %tint_symbol_1 0 Offset 0
OpDecorate %tint_symbol_1 Block
OpDecorate %1 DescriptorSet 0
OpDecorate %1 Binding 0
OpDecorate %1 Coherent
OpDecorate %arg_0_plane0 DescriptorSet 1
OpDecorate %arg_0_plane0 Binding 0
OpDecorate %arg_0_plane1 DescriptorSet 1
OpDecorate %arg_0_plane1 Binding 1
OpMemberDecorate %tint_ExternalTextureParams_std140 0 Offset 0
OpMemberDecorate %tint_ExternalTextureParams_std140 1 Offset 4
OpMemberDecorate %tint_ExternalTextureParams_std140 2 Offset 16
OpMemberDecorate %tint_ExternalTextureParams_std140 2 ColMajor
OpMemberDecorate %tint_ExternalTextureParams_std140 2 MatrixStride 16
OpMemberDecorate %tint_GammaTransferParams 0 Offset 0
OpMemberDecorate %tint_GammaTransferParams 1 Offset 4
OpMemberDecorate %tint_GammaTransferParams 2 Offset 8
OpMemberDecorate %tint_GammaTransferParams 3 Offset 12
OpMemberDecorate %tint_GammaTransferParams 4 Offset 16
OpMemberDecorate %tint_GammaTransferParams 5 Offset 20
OpMemberDecorate %tint_GammaTransferParams 6 Offset 24
OpMemberDecorate %tint_GammaTransferParams 7 Offset 28
OpMemberDecorate %tint_ExternalTextureParams_std140 3 Offset 64
OpMemberDecorate %tint_ExternalTextureParams_std140 4 Offset 96
OpMemberDecorate %tint_ExternalTextureParams_std140 5 Offset 128
OpMemberDecorate %tint_ExternalTextureParams_std140 6 Offset 144
OpMemberDecorate %tint_ExternalTextureParams_std140 7 Offset 160
OpMemberDecorate %tint_ExternalTextureParams_std140 8 Offset 176
OpMemberDecorate %tint_ExternalTextureParams_std140 9 Offset 184
OpMemberDecorate %tint_ExternalTextureParams_std140 10 Offset 192
OpMemberDecorate %tint_ExternalTextureParams_std140 11 Offset 200
OpMemberDecorate %tint_ExternalTextureParams_std140 12 Offset 208
OpMemberDecorate %tint_ExternalTextureParams_std140 13 Offset 216
OpMemberDecorate %tint_ExternalTextureParams_std140 14 Offset 224
OpMemberDecorate %tint_ExternalTextureParams_std140 15 Offset 232
OpMemberDecorate %tint_ExternalTextureParams_std140 16 Offset 240
OpMemberDecorate %tint_ExternalTextureParams_std140 17 Offset 248
OpMemberDecorate %tint_ExternalTextureParams_std140 18 Offset 256
OpMemberDecorate %tint_ExternalTextureParams_std140 19 Offset 264
OpMemberDecorate %tint_symbol_3_std140 0 Offset 0
OpDecorate %tint_symbol_3_std140 Block
OpDecorate %10 DescriptorSet 1
OpDecorate %10 Binding 2
OpDecorate %10 NonWritable
OpDecorate %vertex_main_position_Output BuiltIn Position
OpDecorate %vertex_main_loc0_Output Location 0
OpDecorate %vertex_main_loc0_Output Flat
OpDecorate %vertex_main___point_size_Output BuiltIn PointSize
OpMemberDecorate %tint_ExternalTextureParams 0 Offset 0
OpMemberDecorate %tint_ExternalTextureParams 1 Offset 4
OpMemberDecorate %tint_ExternalTextureParams 2 Offset 16
OpMemberDecorate %tint_ExternalTextureParams 2 ColMajor
OpMemberDecorate %tint_ExternalTextureParams 2 MatrixStride 16
OpMemberDecorate %tint_ExternalTextureParams 3 Offset 64
OpMemberDecorate %tint_ExternalTextureParams 4 Offset 96
OpMemberDecorate %tint_ExternalTextureParams 5 Offset 128
OpMemberDecorate %tint_ExternalTextureParams 5 ColMajor
OpMemberDecorate %tint_ExternalTextureParams 5 MatrixStride 16
OpMemberDecorate %tint_ExternalTextureParams 6 Offset 176
OpMemberDecorate %tint_ExternalTextureParams 6 ColMajor
OpMemberDecorate %tint_ExternalTextureParams 6 MatrixStride 8
OpMemberDecorate %tint_ExternalTextureParams 7 Offset 200
OpMemberDecorate %tint_ExternalTextureParams 7 ColMajor
OpMemberDecorate %tint_ExternalTextureParams 7 MatrixStride 8
OpMemberDecorate %tint_ExternalTextureParams 8 Offset 224
OpMemberDecorate %tint_ExternalTextureParams 9 Offset 232
OpMemberDecorate %tint_ExternalTextureParams 10 Offset 240
OpMemberDecorate %tint_ExternalTextureParams 11 Offset 248
OpMemberDecorate %tint_ExternalTextureParams 12 Offset 256
OpMemberDecorate %tint_ExternalTextureParams 13 Offset 264
OpMemberDecorate %VertexOutput 0 Offset 0
OpMemberDecorate %VertexOutput 1 Offset 16
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%tint_symbol_1 = OpTypeStruct %v4float
%_ptr_StorageBuffer_tint_symbol_1 = OpTypePointer StorageBuffer %tint_symbol_1
%1 = OpVariable %_ptr_StorageBuffer_tint_symbol_1 StorageBuffer
%8 = OpTypeImage %float 2D 0 0 0 1 Unknown
%_ptr_UniformConstant_8 = OpTypePointer UniformConstant %8
%arg_0_plane0 = OpVariable %_ptr_UniformConstant_8 UniformConstant
%arg_0_plane1 = OpVariable %_ptr_UniformConstant_8 UniformConstant
%uint = OpTypeInt 32 0
%mat3v4float = OpTypeMatrix %v4float 3
%tint_GammaTransferParams = OpTypeStruct %float %float %float %float %float %float %float %uint
%v3float = OpTypeVector %float 3
%v2float = OpTypeVector %float 2
%v2uint = OpTypeVector %uint 2
%tint_ExternalTextureParams_std140 = OpTypeStruct %uint %uint %mat3v4float %tint_GammaTransferParams %tint_GammaTransferParams %v3float %v3float %v3float %v2float %v2float %v2float %v2float %v2float %v2float %v2float %v2float %v2float %v2float %v2uint %v2float
%tint_symbol_3_std140 = OpTypeStruct %tint_ExternalTextureParams_std140
%_ptr_Uniform_tint_symbol_3_std140 = OpTypePointer Uniform %tint_symbol_3_std140
%10 = OpVariable %_ptr_Uniform_tint_symbol_3_std140 Uniform
%_ptr_Output_v4float = OpTypePointer Output %v4float
%vertex_main_position_Output = OpVariable %_ptr_Output_v4float Output
%vertex_main_loc0_Output = OpVariable %_ptr_Output_v4float Output
%_ptr_Output_float = OpTypePointer Output %float
%vertex_main___point_size_Output = OpVariable %_ptr_Output_float Output
%26 = OpTypeFunction %v4float
%_ptr_Uniform_tint_ExternalTextureParams_std140 = OpTypePointer Uniform %tint_ExternalTextureParams_std140
%uint_0 = OpConstant %uint 0
%mat3v3float = OpTypeMatrix %v3float 3
%mat3v2float = OpTypeMatrix %v2float 3
%tint_ExternalTextureParams = OpTypeStruct %uint %uint %mat3v4float %tint_GammaTransferParams %tint_GammaTransferParams %mat3v3float %mat3v2float %mat3v2float %v2float %v2float %v2float %v2float %v2uint %v2float
%int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2
%int_1 = OpConstant %int 1
%40 = OpConstantComposite %v2int %int_1 %int_1
%_ptr_Function_v4float = OpTypePointer Function %v4float
%void = OpTypeVoid
%51 = OpTypeFunction %void
%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
%VertexOutput = OpTypeStruct %v4float %v4float
%62 = OpTypeFunction %VertexOutput
%_ptr_Function_VertexOutput = OpTypePointer Function %VertexOutput
%66 = OpConstantNull %VertexOutput
%68 = OpConstantNull %v4float
%uint_1 = OpConstant %uint 1
%77 = OpTypeFunction %v4float %8 %8 %tint_ExternalTextureParams %v2uint
%float_1 = OpConstant %float 1
%bool = OpTypeBool
%126 = OpTypeFunction %v3float %v3float %tint_GammaTransferParams
%v3bool = OpTypeVector %bool 3
%159 = OpTypeFunction %tint_ExternalTextureParams %tint_ExternalTextureParams_std140
%textureLoad_8acf41 = OpFunction %v4float None %26
%27 = OpLabel
%res = OpVariable %_ptr_Function_v4float Function
%28 = OpLoad %8 %arg_0_plane0
%29 = OpLoad %8 %arg_0_plane1
%30 = OpAccessChain %_ptr_Uniform_tint_ExternalTextureParams_std140 %10 %uint_0
%33 = OpLoad %tint_ExternalTextureParams_std140 %30
%34 = OpFunctionCall %tint_ExternalTextureParams %convert_tint_ExternalTextureParams %33
%39 = OpBitcast %v2uint %40
%44 = OpFunctionCall %v4float %tint_TextureLoadExternal %28 %29 %34 %39
OpStore %res %44
%48 = OpLoad %v4float %res
OpReturnValue %48
OpFunctionEnd
%fragment_main = OpFunction %void None %51
%52 = OpLabel
%53 = OpFunctionCall %v4float %textureLoad_8acf41
%54 = OpAccessChain %_ptr_StorageBuffer_v4float %1 %uint_0
OpStore %54 %53
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %51
%57 = OpLabel
%58 = OpFunctionCall %v4float %textureLoad_8acf41
%59 = OpAccessChain %_ptr_StorageBuffer_v4float %1 %uint_0
OpStore %59 %58
OpReturn
OpFunctionEnd
%vertex_main_inner = OpFunction %VertexOutput None %62
%63 = OpLabel
%out = OpVariable %_ptr_Function_VertexOutput Function %66
%67 = OpAccessChain %_ptr_Function_v4float %out %uint_0
OpStore %67 %68
%69 = OpAccessChain %_ptr_Function_v4float %out %uint_1
%71 = OpFunctionCall %v4float %textureLoad_8acf41
OpStore %69 %71
%72 = OpLoad %VertexOutput %out
OpReturnValue %72
OpFunctionEnd
%tint_TextureLoadExternal = OpFunction %v4float None %77
%plane_0 = OpFunctionParameter %8
%plane_1 = OpFunctionParameter %8
%params = OpFunctionParameter %tint_ExternalTextureParams
%coords = OpFunctionParameter %v2uint
%78 = OpLabel
%79 = OpCompositeExtract %uint %params 1
%80 = OpCompositeExtract %mat3v4float %params 2
%81 = OpCompositeExtract %mat3v2float %params 7
%82 = OpCompositeExtract %v2uint %params 12
%83 = OpCompositeExtract %v2float %params 13
%84 = OpExtInst %v2uint %85 UMin %coords %82
%86 = OpConvertUToF %v2float %84
%87 = OpCompositeConstruct %v3float %86 %float_1
%89 = OpMatrixTimesVector %v2float %81 %87
%90 = OpExtInst %v2float %85 RoundEven %89
%91 = OpConvertFToU %v2uint %90
%92 = OpCompositeExtract %uint %params 0
%93 = OpIEqual %bool %92 %uint_1
OpSelectionMerge %95 None
OpBranchConditional %93 %96 %97
%96 = OpLabel
%98 = OpImageFetch %v4float %plane_0 %91 Lod %uint_0
%99 = OpVectorShuffle %v3float %98 %98 0 1 2
%100 = OpCompositeExtract %float %98 3
OpBranch %95
%97 = OpLabel
%101 = OpImageFetch %v4float %plane_0 %91 Lod %uint_0
%102 = OpCompositeExtract %float %101 0
%103 = OpFMul %v2float %90 %83
%104 = OpConvertFToU %v2uint %103
%105 = OpImageFetch %v4float %plane_1 %104 Lod %uint_0
%106 = OpVectorShuffle %v2float %105 %105 0 1
%107 = OpCompositeConstruct %v4float %102 %106 %float_1
%108 = OpVectorTimesMatrix %v3float %107 %80
OpBranch %95
%95 = OpLabel
%109 = OpPhi %v3float %99 %96 %108 %97
%110 = OpPhi %float %100 %96 %float_1 %97
%111 = OpIEqual %bool %79 %uint_0
OpSelectionMerge %112 None
OpBranchConditional %111 %113 %114
%113 = OpLabel
%115 = OpCompositeExtract %tint_GammaTransferParams %params 3
%116 = OpCompositeExtract %tint_GammaTransferParams %params 4
%117 = OpCompositeExtract %mat3v3float %params 5
%118 = OpFunctionCall %v3float %tint_GammaCorrection %109 %115
%120 = OpMatrixTimesVector %v3float %117 %118
%121 = OpFunctionCall %v3float %tint_GammaCorrection %120 %116
OpBranch %112
%114 = OpLabel
OpBranch %112
%112 = OpLabel
%122 = OpPhi %v3float %121 %113 %109 %114
%123 = OpCompositeConstruct %v4float %122 %110
OpReturnValue %123
OpFunctionEnd
%tint_GammaCorrection = OpFunction %v3float None %126
%v = OpFunctionParameter %v3float
%params_0 = OpFunctionParameter %tint_GammaTransferParams
%127 = OpLabel
%128 = OpCompositeExtract %float %params_0 0
%129 = OpCompositeExtract %float %params_0 1
%130 = OpCompositeExtract %float %params_0 2
%131 = OpCompositeExtract %float %params_0 3
%132 = OpCompositeExtract %float %params_0 4
%133 = OpCompositeExtract %float %params_0 5
%134 = OpCompositeExtract %float %params_0 6
%135 = OpCompositeConstruct %v3float %128 %128 %128
%136 = OpCompositeConstruct %v3float %132 %132 %132
%137 = OpExtInst %v3float %85 FAbs %v
%138 = OpExtInst %v3float %85 FSign %v
%139 = OpFOrdLessThan %v3bool %137 %136
%141 = OpVectorTimesScalar %v3float %137 %131
%142 = OpCompositeConstruct %v3float %134 %134 %134
%143 = OpFAdd %v3float %141 %142
%144 = OpFMul %v3float %138 %143
%145 = OpVectorTimesScalar %v3float %137 %129
%146 = OpCompositeConstruct %v3float %130 %130 %130
%147 = OpFAdd %v3float %145 %146
%148 = OpExtInst %v3float %85 Pow %147 %135
%149 = OpCompositeConstruct %v3float %133 %133 %133
%150 = OpFAdd %v3float %148 %149
%151 = OpFMul %v3float %138 %150
%152 = OpSelect %v3float %139 %144 %151
OpReturnValue %152
OpFunctionEnd
%vertex_main = OpFunction %void None %51
%154 = OpLabel
%155 = OpFunctionCall %VertexOutput %vertex_main_inner
%156 = OpCompositeExtract %v4float %155 0
OpStore %vertex_main_position_Output %156
%157 = OpCompositeExtract %v4float %155 1
OpStore %vertex_main_loc0_Output %157
OpStore %vertex_main___point_size_Output %float_1
OpReturn
OpFunctionEnd
%convert_tint_ExternalTextureParams = OpFunction %tint_ExternalTextureParams None %159
%input = OpFunctionParameter %tint_ExternalTextureParams_std140
%160 = OpLabel
%161 = OpCompositeExtract %uint %input 0
%162 = OpCompositeExtract %uint %input 1
%163 = OpCompositeExtract %mat3v4float %input 2
%164 = OpCompositeExtract %tint_GammaTransferParams %input 3
%165 = OpCompositeExtract %tint_GammaTransferParams %input 4
%166 = OpCompositeExtract %v3float %input 5
%167 = OpCompositeExtract %v3float %input 6
%168 = OpCompositeExtract %v3float %input 7
%169 = OpCompositeConstruct %mat3v3float %166 %167 %168
%170 = OpCompositeExtract %v2float %input 8
%171 = OpCompositeExtract %v2float %input 9
%172 = OpCompositeExtract %v2float %input 10
%173 = OpCompositeConstruct %mat3v2float %170 %171 %172
%174 = OpCompositeExtract %v2float %input 11
%175 = OpCompositeExtract %v2float %input 12
%176 = OpCompositeExtract %v2float %input 13
%177 = OpCompositeConstruct %mat3v2float %174 %175 %176
%178 = OpCompositeExtract %v2float %input 14
%179 = OpCompositeExtract %v2float %input 15
%180 = OpCompositeExtract %v2float %input 16
%181 = OpCompositeExtract %v2float %input 17
%182 = OpCompositeExtract %v2uint %input 18
%183 = OpCompositeExtract %v2float %input 19
%184 = OpCompositeConstruct %tint_ExternalTextureParams %161 %162 %163 %164 %165 %169 %173 %177 %178 %179 %180 %181 %182 %183
OpReturnValue %184
OpFunctionEnd