xref: /aosp_15_r20/external/skia/tests/sksl/shared/FragCoords.asm.frag (revision c8dee2aa9b3f27cf6c858bd81872bdeb2c07ed17)
1               OpCapability Shader
2          %1 = OpExtInstImport "GLSL.std.450"
3               OpMemoryModel Logical GLSL450
4               OpEntryPoint Fragment %main "main" %sk_FragColor %sk_FragCoord
5               OpExecutionMode %main OriginUpperLeft
6               OpName %sk_FragColor "sk_FragColor"
7               OpName %sk_FragCoord "sk_FragCoord"
8               OpName %main "main"
9               OpName %sksl_synthetic_uniforms "sksl_synthetic_uniforms"
10               OpMemberName %sksl_synthetic_uniforms 0 "u_skRTFlip"
11               OpDecorate %sk_FragColor RelaxedPrecision
12               OpDecorate %sk_FragColor Location 0
13               OpDecorate %sk_FragColor Index 0
14               OpDecorate %sk_FragCoord BuiltIn FragCoord
15               OpMemberDecorate %sksl_synthetic_uniforms 0 Offset 16384
16               OpDecorate %sksl_synthetic_uniforms Block
17               OpDecorate %12 Binding 0
18               OpDecorate %12 DescriptorSet 0
19               OpDecorate %35 RelaxedPrecision
20               OpDecorate %36 RelaxedPrecision
21      %float = OpTypeFloat 32
22    %v4float = OpTypeVector %float 4
23%_ptr_Output_v4float = OpTypePointer Output %v4float
24%sk_FragColor = OpVariable %_ptr_Output_v4float Output
25%_ptr_Input_v4float = OpTypePointer Input %v4float
26%sk_FragCoord = OpVariable %_ptr_Input_v4float Input
27       %void = OpTypeVoid
28         %10 = OpTypeFunction %void
29    %v2float = OpTypeVector %float 2
30%sksl_synthetic_uniforms = OpTypeStruct %v2float
31%_ptr_Uniform_sksl_synthetic_uniforms = OpTypePointer Uniform %sksl_synthetic_uniforms
32         %12 = OpVariable %_ptr_Uniform_sksl_synthetic_uniforms Uniform
33        %int = OpTypeInt 32 1
34      %int_0 = OpConstant %int 0
35%_ptr_Uniform_v2float = OpTypePointer Uniform %v2float
36       %main = OpFunction %void None %10
37         %11 = OpLabel
38         %18 = OpAccessChain %_ptr_Uniform_v2float %12 %int_0
39         %20 = OpLoad %v2float %18
40         %21 = OpCompositeExtract %float %20 0
41         %22 = OpAccessChain %_ptr_Uniform_v2float %12 %int_0
42         %23 = OpLoad %v2float %22
43         %24 = OpCompositeExtract %float %23 1
44         %25 = OpLoad %v4float %sk_FragCoord
45         %26 = OpCompositeExtract %float %25 0
46         %27 = OpLoad %v4float %sk_FragCoord
47         %28 = OpCompositeExtract %float %27 1
48         %29 = OpLoad %v4float %sk_FragCoord
49         %30 = OpVectorShuffle %v2float %29 %29 2 3
50         %31 = OpFMul %float %24 %28
51         %32 = OpFAdd %float %21 %31
52         %33 = OpCompositeConstruct %v4float %26 %32 %30
53         %34 = OpVectorShuffle %v2float %33 %33 1 0
54         %35 = OpLoad %v4float %sk_FragColor
55         %36 = OpVectorShuffle %v4float %35 %34 4 5 2 3
56               OpStore %sk_FragColor %36
57               OpReturn
58               OpFunctionEnd
59