xref: /aosp_15_r20/external/skia/tests/sksl/shared/InoutParameters.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 "colorGreen"
9               OpName %_entrypoint_v "_entrypoint_v"
10               OpName %outParameterWrite_vh4 "outParameterWrite_vh4"
11               OpName %outParameterWriteIndirect_vh4 "outParameterWriteIndirect_vh4"
12               OpName %inoutParameterWrite_vh4 "inoutParameterWrite_vh4"
13               OpName %inoutParameterWriteIndirect_vh4 "inoutParameterWriteIndirect_vh4"
14               OpName %main "main"
15               OpName %c "c"
16               OpDecorate %sk_FragColor RelaxedPrecision
17               OpDecorate %sk_FragColor Location 0
18               OpDecorate %sk_FragColor Index 0
19               OpMemberDecorate %_UniformBuffer 0 Offset 0
20               OpMemberDecorate %_UniformBuffer 0 RelaxedPrecision
21               OpDecorate %_UniformBuffer Block
22               OpDecorate %11 Binding 0
23               OpDecorate %11 DescriptorSet 0
24               OpDecorate %32 RelaxedPrecision
25               OpDecorate %35 RelaxedPrecision
26               OpDecorate %37 RelaxedPrecision
27               OpDecorate %40 RelaxedPrecision
28               OpDecorate %41 RelaxedPrecision
29               OpDecorate %42 RelaxedPrecision
30               OpDecorate %45 RelaxedPrecision
31               OpDecorate %46 RelaxedPrecision
32               OpDecorate %48 RelaxedPrecision
33               OpDecorate %c RelaxedPrecision
34               OpDecorate %53 RelaxedPrecision
35               OpDecorate %55 RelaxedPrecision
36               OpDecorate %56 RelaxedPrecision
37               OpDecorate %58 RelaxedPrecision
38               OpDecorate %59 RelaxedPrecision
39               OpDecorate %61 RelaxedPrecision
40               OpDecorate %62 RelaxedPrecision
41               OpDecorate %64 RelaxedPrecision
42      %float = OpTypeFloat 32
43    %v4float = OpTypeVector %float 4
44%_ptr_Output_v4float = OpTypePointer Output %v4float
45%sk_FragColor = OpVariable %_ptr_Output_v4float Output
46%_UniformBuffer = OpTypeStruct %v4float
47%_ptr_Uniform__UniformBuffer = OpTypePointer Uniform %_UniformBuffer
48         %11 = OpVariable %_ptr_Uniform__UniformBuffer Uniform
49       %void = OpTypeVoid
50         %16 = OpTypeFunction %void
51    %float_0 = OpConstant %float 0
52    %v2float = OpTypeVector %float 2
53         %20 = OpConstantComposite %v2float %float_0 %float_0
54%_ptr_Function_v2float = OpTypePointer Function %v2float
55%_ptr_Function_v4float = OpTypePointer Function %v4float
56         %25 = OpTypeFunction %void %_ptr_Function_v4float
57%_ptr_Uniform_v4float = OpTypePointer Uniform %v4float
58        %int = OpTypeInt 32 1
59      %int_0 = OpConstant %int 0
60         %49 = OpTypeFunction %v4float %_ptr_Function_v2float
61%_entrypoint_v = OpFunction %void None %16
62         %17 = OpLabel
63         %21 = OpVariable %_ptr_Function_v2float Function
64               OpStore %21 %20
65         %23 = OpFunctionCall %v4float %main %21
66               OpStore %sk_FragColor %23
67               OpReturn
68               OpFunctionEnd
69%outParameterWrite_vh4 = OpFunction %void None %25
70         %26 = OpFunctionParameter %_ptr_Function_v4float
71         %27 = OpLabel
72         %28 = OpAccessChain %_ptr_Uniform_v4float %11 %int_0
73         %32 = OpLoad %v4float %28
74               OpStore %26 %32
75               OpReturn
76               OpFunctionEnd
77%outParameterWriteIndirect_vh4 = OpFunction %void None %25
78         %33 = OpFunctionParameter %_ptr_Function_v4float
79         %34 = OpLabel
80         %35 = OpVariable %_ptr_Function_v4float Function
81         %36 = OpFunctionCall %void %outParameterWrite_vh4 %35
82         %37 = OpLoad %v4float %35
83               OpStore %33 %37
84               OpReturn
85               OpFunctionEnd
86%inoutParameterWrite_vh4 = OpFunction %void None %25
87         %38 = OpFunctionParameter %_ptr_Function_v4float
88         %39 = OpLabel
89         %40 = OpLoad %v4float %38
90         %41 = OpLoad %v4float %38
91         %42 = OpFMul %v4float %40 %41
92               OpStore %38 %42
93               OpReturn
94               OpFunctionEnd
95%inoutParameterWriteIndirect_vh4 = OpFunction %void None %25
96         %43 = OpFunctionParameter %_ptr_Function_v4float
97         %44 = OpLabel
98         %46 = OpVariable %_ptr_Function_v4float Function
99         %45 = OpLoad %v4float %43
100               OpStore %46 %45
101         %47 = OpFunctionCall %void %inoutParameterWrite_vh4 %46
102         %48 = OpLoad %v4float %46
103               OpStore %43 %48
104               OpReturn
105               OpFunctionEnd
106       %main = OpFunction %v4float None %49
107         %50 = OpFunctionParameter %_ptr_Function_v2float
108         %51 = OpLabel
109          %c = OpVariable %_ptr_Function_v4float Function
110         %53 = OpVariable %_ptr_Function_v4float Function
111         %56 = OpVariable %_ptr_Function_v4float Function
112         %59 = OpVariable %_ptr_Function_v4float Function
113         %62 = OpVariable %_ptr_Function_v4float Function
114         %54 = OpFunctionCall %void %outParameterWrite_vh4 %53
115         %55 = OpLoad %v4float %53
116               OpStore %c %55
117         %57 = OpFunctionCall %void %outParameterWriteIndirect_vh4 %56
118         %58 = OpLoad %v4float %56
119               OpStore %c %58
120               OpStore %59 %58
121         %60 = OpFunctionCall %void %inoutParameterWrite_vh4 %59
122         %61 = OpLoad %v4float %59
123               OpStore %c %61
124               OpStore %62 %61
125         %63 = OpFunctionCall %void %inoutParameterWriteIndirect_vh4 %62
126         %64 = OpLoad %v4float %62
127               OpStore %c %64
128               OpReturnValue %64
129               OpFunctionEnd
130