| ; SPIR-V |
| ; Version: 1.3 |
| ; Generator: Google Tint Compiler; 0 |
| ; Bound: 193 |
| ; Schema: 0 |
| OpCapability Shader |
| OpCapability ImageQuery |
| %29 = OpExtInstImport "GLSL.std.450" |
| OpMemoryModel Logical GLSL450 |
| OpEntryPoint GLCompute %main "main" |
| OpExecutionMode %main LocalSize 1 1 1 |
| OpName %ext_tex_plane_1 "ext_tex_plane_1" |
| OpName %ext_tex_params_block_std140 "ext_tex_params_block_std140" |
| OpMemberName %ext_tex_params_block_std140 0 "inner" |
| OpName %ExternalTextureParams_std140 "ExternalTextureParams_std140" |
| OpMemberName %ExternalTextureParams_std140 0 "numPlanes" |
| OpMemberName %ExternalTextureParams_std140 1 "doYuvToRgbConversionOnly" |
| OpMemberName %ExternalTextureParams_std140 2 "yuvToRgbConversionMatrix" |
| OpMemberName %ExternalTextureParams_std140 3 "gammaDecodeParams" |
| OpName %GammaTransferParams "GammaTransferParams" |
| OpMemberName %GammaTransferParams 0 "G" |
| OpMemberName %GammaTransferParams 1 "A" |
| OpMemberName %GammaTransferParams 2 "B" |
| OpMemberName %GammaTransferParams 3 "C" |
| OpMemberName %GammaTransferParams 4 "D" |
| OpMemberName %GammaTransferParams 5 "E" |
| OpMemberName %GammaTransferParams 6 "F" |
| OpMemberName %GammaTransferParams 7 "padding" |
| OpMemberName %ExternalTextureParams_std140 4 "gammaEncodeParams" |
| OpMemberName %ExternalTextureParams_std140 5 "gamutConversionMatrix" |
| OpMemberName %ExternalTextureParams_std140 6 "coordTransformationMatrix_0" |
| OpMemberName %ExternalTextureParams_std140 7 "coordTransformationMatrix_1" |
| OpMemberName %ExternalTextureParams_std140 8 "coordTransformationMatrix_2" |
| OpName %ext_tex_params "ext_tex_params" |
| OpName %t "t" |
| OpName %outImage "outImage" |
| OpName %tint_clamp "tint_clamp" |
| OpName %e "e" |
| OpName %low "low" |
| OpName %high "high" |
| OpName %gammaCorrection "gammaCorrection" |
| OpName %v "v" |
| OpName %params "params" |
| OpName %ExternalTextureParams "ExternalTextureParams" |
| OpMemberName %ExternalTextureParams 0 "numPlanes" |
| OpMemberName %ExternalTextureParams 1 "doYuvToRgbConversionOnly" |
| OpMemberName %ExternalTextureParams 2 "yuvToRgbConversionMatrix" |
| OpMemberName %ExternalTextureParams 3 "gammaDecodeParams" |
| OpMemberName %ExternalTextureParams 4 "gammaEncodeParams" |
| OpMemberName %ExternalTextureParams 5 "gamutConversionMatrix" |
| OpMemberName %ExternalTextureParams 6 "coordTransformationMatrix" |
| OpName %textureLoadExternal "textureLoadExternal" |
| OpName %plane0 "plane0" |
| OpName %plane1 "plane1" |
| OpName %coord "coord" |
| OpName %params_0 "params" |
| OpName %color "color" |
| OpName %conv_ExternalTextureParams "conv_ExternalTextureParams" |
| OpName %val "val" |
| OpName %main "main" |
| OpName %red "red" |
| OpName %green "green" |
| OpDecorate %ext_tex_plane_1 DescriptorSet 0 |
| OpDecorate %ext_tex_plane_1 Binding 2 |
| OpDecorate %ext_tex_params_block_std140 Block |
| OpMemberDecorate %ext_tex_params_block_std140 0 Offset 0 |
| OpMemberDecorate %ExternalTextureParams_std140 0 Offset 0 |
| OpMemberDecorate %ExternalTextureParams_std140 1 Offset 4 |
| OpMemberDecorate %ExternalTextureParams_std140 2 Offset 16 |
| OpMemberDecorate %ExternalTextureParams_std140 2 ColMajor |
| OpMemberDecorate %ExternalTextureParams_std140 2 MatrixStride 16 |
| OpMemberDecorate %ExternalTextureParams_std140 3 Offset 64 |
| OpMemberDecorate %GammaTransferParams 0 Offset 0 |
| OpMemberDecorate %GammaTransferParams 1 Offset 4 |
| OpMemberDecorate %GammaTransferParams 2 Offset 8 |
| OpMemberDecorate %GammaTransferParams 3 Offset 12 |
| OpMemberDecorate %GammaTransferParams 4 Offset 16 |
| OpMemberDecorate %GammaTransferParams 5 Offset 20 |
| OpMemberDecorate %GammaTransferParams 6 Offset 24 |
| OpMemberDecorate %GammaTransferParams 7 Offset 28 |
| OpMemberDecorate %ExternalTextureParams_std140 4 Offset 96 |
| OpMemberDecorate %ExternalTextureParams_std140 5 Offset 128 |
| OpMemberDecorate %ExternalTextureParams_std140 5 ColMajor |
| OpMemberDecorate %ExternalTextureParams_std140 5 MatrixStride 16 |
| OpMemberDecorate %ExternalTextureParams_std140 6 Offset 176 |
| OpMemberDecorate %ExternalTextureParams_std140 7 Offset 184 |
| OpMemberDecorate %ExternalTextureParams_std140 8 Offset 192 |
| OpDecorate %ext_tex_params NonWritable |
| OpDecorate %ext_tex_params DescriptorSet 0 |
| OpDecorate %ext_tex_params Binding 3 |
| OpDecorate %t DescriptorSet 0 |
| OpDecorate %t Binding 0 |
| OpDecorate %outImage NonReadable |
| OpDecorate %outImage DescriptorSet 0 |
| OpDecorate %outImage Binding 1 |
| OpMemberDecorate %ExternalTextureParams 0 Offset 0 |
| OpMemberDecorate %ExternalTextureParams 1 Offset 4 |
| OpMemberDecorate %ExternalTextureParams 2 Offset 16 |
| OpMemberDecorate %ExternalTextureParams 2 ColMajor |
| OpMemberDecorate %ExternalTextureParams 2 MatrixStride 16 |
| OpMemberDecorate %ExternalTextureParams 3 Offset 64 |
| OpMemberDecorate %ExternalTextureParams 4 Offset 96 |
| OpMemberDecorate %ExternalTextureParams 5 Offset 128 |
| OpMemberDecorate %ExternalTextureParams 5 ColMajor |
| OpMemberDecorate %ExternalTextureParams 5 MatrixStride 16 |
| OpMemberDecorate %ExternalTextureParams 6 Offset 176 |
| OpMemberDecorate %ExternalTextureParams 6 ColMajor |
| OpMemberDecorate %ExternalTextureParams 6 MatrixStride 8 |
| %float = OpTypeFloat 32 |
| %3 = OpTypeImage %float 2D 0 0 0 1 Unknown |
| %_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3 |
| %ext_tex_plane_1 = OpVariable %_ptr_UniformConstant_3 UniformConstant |
| %uint = OpTypeInt 32 0 |
| %v4float = OpTypeVector %float 4 |
| %mat3v4float = OpTypeMatrix %v4float 3 |
| %GammaTransferParams = OpTypeStruct %float %float %float %float %float %float %float %uint |
| %v3float = OpTypeVector %float 3 |
| %mat3v3float = OpTypeMatrix %v3float 3 |
| %v2float = OpTypeVector %float 2 |
| %ExternalTextureParams_std140 = OpTypeStruct %uint %uint %mat3v4float %GammaTransferParams %GammaTransferParams %mat3v3float %v2float %v2float %v2float |
| %ext_tex_params_block_std140 = OpTypeStruct %ExternalTextureParams_std140 |
| %_ptr_Uniform_ext_tex_params_block_std140 = OpTypePointer Uniform %ext_tex_params_block_std140 |
| %ext_tex_params = OpVariable %_ptr_Uniform_ext_tex_params_block_std140 Uniform |
| %t = OpVariable %_ptr_UniformConstant_3 UniformConstant |
| %19 = OpTypeImage %float 2D 0 0 0 2 Rgba8 |
| %_ptr_UniformConstant_19 = OpTypePointer UniformConstant %19 |
| %outImage = OpVariable %_ptr_UniformConstant_19 UniformConstant |
| %int = OpTypeInt 32 1 |
| %v2int = OpTypeVector %int 2 |
| %20 = OpTypeFunction %v2int %v2int %v2int %v2int |
| %31 = OpTypeFunction %v3float %v3float %GammaTransferParams |
| %bool = OpTypeBool |
| %v3bool = OpTypeVector %bool 3 |
| %_ptr_Function_v3float = OpTypePointer Function %v3float |
| %50 = OpConstantNull %v3float |
| %mat3v2float = OpTypeMatrix %v2float 3 |
| %ExternalTextureParams = OpTypeStruct %uint %uint %mat3v4float %GammaTransferParams %GammaTransferParams %mat3v3float %mat3v2float |
| %70 = OpTypeFunction %v4float %3 %3 %v2int %ExternalTextureParams |
| %v2uint = OpTypeVector %uint 2 |
| %uint_1 = OpConstant %uint 1 |
| %81 = OpConstantComposite %v2uint %uint_1 %uint_1 |
| %90 = OpConstantNull %int |
| %float_1 = OpConstant %float 1 |
| %103 = OpConstantNull %uint |
| %121 = OpTypeFunction %ExternalTextureParams %ExternalTextureParams_std140 |
| %void = OpTypeVoid |
| %136 = OpTypeFunction %void |
| %int_10 = OpConstant %int 10 |
| %145 = OpConstantComposite %v2int %int_10 %int_10 |
| %146 = OpConstantNull %v2int |
| %int_0 = OpConstant %int 0 |
| %uint_0 = OpConstant %uint 0 |
| %_ptr_Uniform_ExternalTextureParams_std140 = OpTypePointer Uniform %ExternalTextureParams_std140 |
| %_ptr_Function_v4float = OpTypePointer Function %v4float |
| %159 = OpConstantNull %v4float |
| %int_70 = OpConstant %int 70 |
| %int_118 = OpConstant %int 118 |
| %174 = OpConstantComposite %v2int %int_70 %int_118 |
| %int_1 = OpConstant %int 1 |
| %187 = OpConstantComposite %v2int %int_1 %90 |
| %tint_clamp = OpFunction %v2int None %20 |
| %e = OpFunctionParameter %v2int |
| %low = OpFunctionParameter %v2int |
| %high = OpFunctionParameter %v2int |
| %27 = OpLabel |
| %30 = OpExtInst %v2int %29 SMax %e %low |
| %28 = OpExtInst %v2int %29 SMin %30 %high |
| OpReturnValue %28 |
| OpFunctionEnd |
| %gammaCorrection = OpFunction %v3float None %31 |
| %v = OpFunctionParameter %v3float |
| %params = OpFunctionParameter %GammaTransferParams |
| %35 = OpLabel |
| %48 = OpVariable %_ptr_Function_v3float Function %50 |
| %60 = OpVariable %_ptr_Function_v3float Function %50 |
| %66 = OpVariable %_ptr_Function_v3float Function %50 |
| %36 = OpExtInst %v3float %29 FAbs %v |
| %37 = OpCompositeExtract %float %params 4 |
| %38 = OpCompositeConstruct %v3float %37 %37 %37 |
| %39 = OpFOrdLessThan %v3bool %36 %38 |
| %42 = OpExtInst %v3float %29 FSign %v |
| %43 = OpCompositeExtract %float %params 3 |
| %44 = OpExtInst %v3float %29 FAbs %v |
| %45 = OpVectorTimesScalar %v3float %44 %43 |
| %46 = OpCompositeExtract %float %params 6 |
| %51 = OpCompositeConstruct %v3float %46 %46 %46 |
| %47 = OpFAdd %v3float %45 %51 |
| %52 = OpFMul %v3float %42 %47 |
| %53 = OpExtInst %v3float %29 FSign %v |
| %55 = OpCompositeExtract %float %params 1 |
| %56 = OpExtInst %v3float %29 FAbs %v |
| %57 = OpVectorTimesScalar %v3float %56 %55 |
| %58 = OpCompositeExtract %float %params 2 |
| %61 = OpCompositeConstruct %v3float %58 %58 %58 |
| %59 = OpFAdd %v3float %57 %61 |
| %62 = OpCompositeExtract %float %params 0 |
| %63 = OpCompositeConstruct %v3float %62 %62 %62 |
| %54 = OpExtInst %v3float %29 Pow %59 %63 |
| %64 = OpCompositeExtract %float %params 5 |
| %67 = OpCompositeConstruct %v3float %64 %64 %64 |
| %65 = OpFAdd %v3float %54 %67 |
| %68 = OpFMul %v3float %53 %65 |
| %69 = OpSelect %v3float %39 %52 %68 |
| OpReturnValue %69 |
| OpFunctionEnd |
| %textureLoadExternal = OpFunction %v4float None %70 |
| %plane0 = OpFunctionParameter %3 |
| %plane1 = OpFunctionParameter %3 |
| %coord = OpFunctionParameter %v2int |
| %params_0 = OpFunctionParameter %ExternalTextureParams |
| %78 = OpLabel |
| %color = OpVariable %_ptr_Function_v3float Function %50 |
| %82 = OpShiftRightArithmetic %v2int %coord %81 |
| %84 = OpCompositeExtract %uint %params_0 0 |
| %85 = OpIEqual %bool %84 %uint_1 |
| OpSelectionMerge %86 None |
| OpBranchConditional %85 %87 %88 |
| %87 = OpLabel |
| %89 = OpImageFetch %v4float %plane0 %coord Lod %90 |
| %91 = OpVectorShuffle %v3float %89 %89 0 1 2 |
| OpStore %color %91 |
| OpBranch %86 |
| %88 = OpLabel |
| %92 = OpImageFetch %v4float %plane0 %coord Lod %90 |
| %93 = OpCompositeExtract %float %92 0 |
| %94 = OpImageFetch %v4float %plane1 %82 Lod %90 |
| %95 = OpVectorShuffle %v2float %94 %94 0 1 |
| %96 = OpCompositeExtract %float %95 0 |
| %97 = OpCompositeExtract %float %95 1 |
| %99 = OpCompositeConstruct %v4float %93 %96 %97 %float_1 |
| %100 = OpCompositeExtract %mat3v4float %params_0 2 |
| %101 = OpVectorTimesMatrix %v3float %99 %100 |
| OpStore %color %101 |
| OpBranch %86 |
| %86 = OpLabel |
| %102 = OpCompositeExtract %uint %params_0 1 |
| %104 = OpIEqual %bool %102 %103 |
| OpSelectionMerge %105 None |
| OpBranchConditional %104 %106 %105 |
| %106 = OpLabel |
| %108 = OpLoad %v3float %color |
| %109 = OpCompositeExtract %GammaTransferParams %params_0 3 |
| %107 = OpFunctionCall %v3float %gammaCorrection %108 %109 |
| OpStore %color %107 |
| %110 = OpCompositeExtract %mat3v3float %params_0 5 |
| %111 = OpLoad %v3float %color |
| %112 = OpMatrixTimesVector %v3float %110 %111 |
| OpStore %color %112 |
| %114 = OpLoad %v3float %color |
| %115 = OpCompositeExtract %GammaTransferParams %params_0 4 |
| %113 = OpFunctionCall %v3float %gammaCorrection %114 %115 |
| OpStore %color %113 |
| OpBranch %105 |
| %105 = OpLabel |
| %116 = OpLoad %v3float %color |
| %117 = OpCompositeExtract %float %116 0 |
| %118 = OpCompositeExtract %float %116 1 |
| %119 = OpCompositeExtract %float %116 2 |
| %120 = OpCompositeConstruct %v4float %117 %118 %119 %float_1 |
| OpReturnValue %120 |
| OpFunctionEnd |
| %conv_ExternalTextureParams = OpFunction %ExternalTextureParams None %121 |
| %val = OpFunctionParameter %ExternalTextureParams_std140 |
| %124 = OpLabel |
| %125 = OpCompositeExtract %uint %val 0 |
| %126 = OpCompositeExtract %uint %val 1 |
| %127 = OpCompositeExtract %mat3v4float %val 2 |
| %128 = OpCompositeExtract %GammaTransferParams %val 3 |
| %129 = OpCompositeExtract %GammaTransferParams %val 4 |
| %130 = OpCompositeExtract %mat3v3float %val 5 |
| %131 = OpCompositeExtract %v2float %val 6 |
| %132 = OpCompositeExtract %v2float %val 7 |
| %133 = OpCompositeExtract %v2float %val 8 |
| %134 = OpCompositeConstruct %mat3v2float %131 %132 %133 |
| %135 = OpCompositeConstruct %ExternalTextureParams %125 %126 %127 %128 %129 %130 %134 |
| OpReturnValue %135 |
| OpFunctionEnd |
| %main = OpFunction %void None %136 |
| %139 = OpLabel |
| %red = OpVariable %_ptr_Function_v4float Function %159 |
| %green = OpVariable %_ptr_Function_v4float Function %159 |
| %141 = OpLoad %3 %t |
| %142 = OpLoad %3 %ext_tex_plane_1 |
| %149 = OpLoad %3 %t |
| %148 = OpImageQuerySizeLod %v2uint %149 %int_0 |
| %151 = OpISub %v2uint %148 %81 |
| %147 = OpBitcast %v2int %151 |
| %143 = OpFunctionCall %v2int %tint_clamp %145 %146 %147 |
| %155 = OpAccessChain %_ptr_Uniform_ExternalTextureParams_std140 %ext_tex_params %uint_0 |
| %156 = OpLoad %ExternalTextureParams_std140 %155 |
| %152 = OpFunctionCall %ExternalTextureParams %conv_ExternalTextureParams %156 |
| %140 = OpFunctionCall %v4float %textureLoadExternal %141 %142 %143 %152 |
| OpStore %red %140 |
| %161 = OpLoad %19 %outImage |
| %165 = OpLoad %19 %outImage |
| %164 = OpImageQuerySize %v2uint %165 |
| %166 = OpISub %v2uint %164 %81 |
| %163 = OpBitcast %v2int %166 |
| %162 = OpFunctionCall %v2int %tint_clamp %146 %146 %163 |
| %167 = OpLoad %v4float %red |
| OpImageWrite %161 %162 %167 |
| %169 = OpLoad %3 %t |
| %170 = OpLoad %3 %ext_tex_plane_1 |
| %177 = OpLoad %3 %t |
| %176 = OpImageQuerySizeLod %v2uint %177 %int_0 |
| %178 = OpISub %v2uint %176 %81 |
| %175 = OpBitcast %v2int %178 |
| %171 = OpFunctionCall %v2int %tint_clamp %174 %146 %175 |
| %180 = OpAccessChain %_ptr_Uniform_ExternalTextureParams_std140 %ext_tex_params %uint_0 |
| %181 = OpLoad %ExternalTextureParams_std140 %180 |
| %179 = OpFunctionCall %ExternalTextureParams %conv_ExternalTextureParams %181 |
| %168 = OpFunctionCall %v4float %textureLoadExternal %169 %170 %171 %179 |
| OpStore %green %168 |
| %184 = OpLoad %19 %outImage |
| %190 = OpLoad %19 %outImage |
| %189 = OpImageQuerySize %v2uint %190 |
| %191 = OpISub %v2uint %189 %81 |
| %188 = OpBitcast %v2int %191 |
| %185 = OpFunctionCall %v2int %tint_clamp %187 %146 %188 |
| %192 = OpLoad %v4float %green |
| OpImageWrite %184 %185 %192 |
| OpReturn |
| OpFunctionEnd |