xref: /aosp_15_r20/external/skia/tests/sksl/shared/UniformMatrixResize.asm.frag (revision c8dee2aa9b3f27cf6c858bd81872bdeb2c07ed17)
1               OpCapability Shader
2          %1 = OpExtInstImport "GLSL.std.450"
3               OpMemoryModel Logical GLSL450
4               OpEntryPoint Fragment %_entrypoint_v "_entrypoint" %sk_FragColor
5               OpExecutionMode %_entrypoint_v OriginUpperLeft
6               OpName %sk_FragColor "sk_FragColor"
7               OpName %_UniformBuffer "_UniformBuffer"
8               OpMemberName %_UniformBuffer 0 "testMatrix3x3"
9               OpMemberName %_UniformBuffer 1 "colorGreen"
10               OpMemberName %_UniformBuffer 2 "colorRed"
11               OpName %_entrypoint_v "_entrypoint_v"
12               OpName %resizeMatrix_f22 "resizeMatrix_f22"
13               OpName %main "main"
14               OpDecorate %sk_FragColor RelaxedPrecision
15               OpDecorate %sk_FragColor Location 0
16               OpDecorate %sk_FragColor Index 0
17               OpMemberDecorate %_UniformBuffer 0 Offset 0
18               OpMemberDecorate %_UniformBuffer 0 ColMajor
19               OpMemberDecorate %_UniformBuffer 0 MatrixStride 16
20               OpMemberDecorate %_UniformBuffer 1 Offset 48
21               OpMemberDecorate %_UniformBuffer 1 RelaxedPrecision
22               OpMemberDecorate %_UniformBuffer 2 Offset 64
23               OpMemberDecorate %_UniformBuffer 2 RelaxedPrecision
24               OpDecorate %_UniformBuffer Block
25               OpDecorate %8 Binding 0
26               OpDecorate %8 DescriptorSet 0
27               OpDecorate %87 RelaxedPrecision
28               OpDecorate %90 RelaxedPrecision
29               OpDecorate %91 RelaxedPrecision
30      %float = OpTypeFloat 32
31    %v4float = OpTypeVector %float 4
32%_ptr_Output_v4float = OpTypePointer Output %v4float
33%sk_FragColor = OpVariable %_ptr_Output_v4float Output
34    %v3float = OpTypeVector %float 3
35%mat3v3float = OpTypeMatrix %v3float 3
36%_UniformBuffer = OpTypeStruct %mat3v3float %v4float %v4float
37%_ptr_Uniform__UniformBuffer = OpTypePointer Uniform %_UniformBuffer
38          %8 = OpVariable %_ptr_Uniform__UniformBuffer Uniform
39       %void = OpTypeVoid
40         %15 = OpTypeFunction %void
41    %float_0 = OpConstant %float 0
42    %v2float = OpTypeVector %float 2
43         %19 = OpConstantComposite %v2float %float_0 %float_0
44%_ptr_Function_v2float = OpTypePointer Function %v2float
45%mat2v2float = OpTypeMatrix %v2float 2
46         %24 = OpTypeFunction %mat2v2float
47%_ptr_Uniform_mat3v3float = OpTypePointer Uniform %mat3v3float
48        %int = OpTypeInt 32 1
49      %int_0 = OpConstant %int 0
50    %float_1 = OpConstant %float 1
51         %37 = OpTypeFunction %v4float %_ptr_Function_v2float
52       %bool = OpTypeBool
53      %false = OpConstantFalse %bool
54    %float_2 = OpConstant %float 2
55    %float_4 = OpConstant %float 4
56    %float_5 = OpConstant %float 5
57         %46 = OpConstantComposite %v2float %float_1 %float_2
58         %47 = OpConstantComposite %v2float %float_4 %float_5
59         %48 = OpConstantComposite %mat2v2float %46 %47
60     %v2bool = OpTypeVector %bool 2
61         %64 = OpConstantComposite %v3float %float_0 %float_0 %float_1
62         %66 = OpConstantComposite %v3float %float_1 %float_2 %float_0
63         %67 = OpConstantComposite %v3float %float_4 %float_5 %float_0
64         %68 = OpConstantComposite %mat3v3float %66 %67 %64
65     %v3bool = OpTypeVector %bool 3
66%_ptr_Function_v4float = OpTypePointer Function %v4float
67%_ptr_Uniform_v4float = OpTypePointer Uniform %v4float
68      %int_1 = OpConstant %int 1
69      %int_2 = OpConstant %int 2
70%_entrypoint_v = OpFunction %void None %15
71         %16 = OpLabel
72         %20 = OpVariable %_ptr_Function_v2float Function
73               OpStore %20 %19
74         %22 = OpFunctionCall %v4float %main %20
75               OpStore %sk_FragColor %22
76               OpReturn
77               OpFunctionEnd
78%resizeMatrix_f22 = OpFunction %mat2v2float None %24
79         %25 = OpLabel
80         %26 = OpAccessChain %_ptr_Uniform_mat3v3float %8 %int_0
81         %30 = OpLoad %mat3v3float %26
82         %32 = OpCompositeExtract %v3float %30 0
83         %33 = OpVectorShuffle %v2float %32 %32 0 1
84         %34 = OpCompositeExtract %v3float %30 1
85         %35 = OpVectorShuffle %v2float %34 %34 0 1
86         %36 = OpCompositeConstruct %mat2v2float %33 %35
87               OpReturnValue %36
88               OpFunctionEnd
89       %main = OpFunction %v4float None %37
90         %38 = OpFunctionParameter %_ptr_Function_v2float
91         %39 = OpLabel
92         %79 = OpVariable %_ptr_Function_v4float Function
93         %42 = OpFunctionCall %mat2v2float %resizeMatrix_f22
94         %50 = OpCompositeExtract %v2float %42 0
95         %51 = OpFOrdEqual %v2bool %50 %46
96         %52 = OpAll %bool %51
97         %53 = OpCompositeExtract %v2float %42 1
98         %54 = OpFOrdEqual %v2bool %53 %47
99         %55 = OpAll %bool %54
100         %56 = OpLogicalAnd %bool %52 %55
101               OpSelectionMerge %58 None
102               OpBranchConditional %56 %57 %58
103         %57 = OpLabel
104         %59 = OpFunctionCall %mat2v2float %resizeMatrix_f22
105         %60 = OpCompositeExtract %v2float %59 0
106         %61 = OpCompositeConstruct %v3float %60 %float_0
107         %62 = OpCompositeExtract %v2float %59 1
108         %63 = OpCompositeConstruct %v3float %62 %float_0
109         %65 = OpCompositeConstruct %mat3v3float %61 %63 %64
110         %70 = OpFOrdEqual %v3bool %61 %66
111         %71 = OpAll %bool %70
112         %72 = OpFOrdEqual %v3bool %63 %67
113         %73 = OpAll %bool %72
114         %74 = OpLogicalAnd %bool %71 %73
115         %75 = OpFOrdEqual %v3bool %64 %64
116         %76 = OpAll %bool %75
117         %77 = OpLogicalAnd %bool %74 %76
118               OpBranch %58
119         %58 = OpLabel
120         %78 = OpPhi %bool %false %39 %77 %57
121               OpSelectionMerge %83 None
122               OpBranchConditional %78 %81 %82
123         %81 = OpLabel
124         %84 = OpAccessChain %_ptr_Uniform_v4float %8 %int_1
125         %87 = OpLoad %v4float %84
126               OpStore %79 %87
127               OpBranch %83
128         %82 = OpLabel
129         %88 = OpAccessChain %_ptr_Uniform_v4float %8 %int_2
130         %90 = OpLoad %v4float %88
131               OpStore %79 %90
132               OpBranch %83
133         %83 = OpLabel
134         %91 = OpLoad %v4float %79
135               OpReturnValue %91
136               OpFunctionEnd
137