xref: /aosp_15_r20/external/angle/third_party/glslang/src/Test/spv.130.frag (revision 8975f5c5ed3d1c378011245431ada316dfb6f244)
1#version 140
2#extension GL_ARB_texture_gather : enable
3
4vec3 a;
5float b;
6
7in vec4 i;
8out vec4 o;
9out ivec3 io;
10out uvec4 uo;
11
12flat in float fflat;
13smooth in float fsmooth;
14noperspective in float fnop;
15
16uniform samplerCube sampC;
17
18#extension GL_ARB_texture_rectangle : enable
19
20uniform sampler2D samp2D;
21uniform sampler2DShadow samp2DS;
22uniform sampler2DRect samp2DR;
23uniform sampler2DArray samp2DA;
24
25void bar3()
26{
27    o += textureGatherOffset(samp2D, vec2(0.3), ivec2(1));
28    o += textureGatherOffset(samp2DA, vec3(0.3), ivec2(1));
29}
30
31#extension GL_ARB_gpu_shader5 : enable
32
33void bar4()
34{
35    o += textureGatherOffset(samp2DR, vec2(0.3), ivec2(1));
36    o += textureGatherOffset(samp2DS, vec2(0.3), 1.3, ivec2(1));
37    o += textureGatherOffset(samp2D, vec2(0.3), ivec2(1), 2);
38}
39
40#extension GL_ARB_texture_cube_map_array : enable
41
42uniform  samplerCubeArray Sca;
43uniform isamplerCubeArray Isca;
44uniform usamplerCubeArray Usca;
45uniform samplerCubeArrayShadow Scas;
46
47void bar5()
48{
49    io = textureSize(Sca, 3);
50    o += texture(Sca, i);
51    io += texture(Isca, i, 0.7).xyz;
52    uo = texture(Usca, i);
53
54    o += textureLod(Sca, i, 1.7);
55    a = textureSize(Scas, 3);
56    float f = texture(Scas, i, i.y);
57    ivec4 c = textureGrad(Isca, i, vec3(0.1), vec3(0.2));
58    o += vec4(a, f + c);
59}
60
61#extension GL_ARB_shading_language_420pack : enable
62
63const int ai[3] = { 10, 23, 32 };
64uniform layout(binding=0) sampler2D bounds;
65
66void bar6()
67{
68    mat4x3 m43;
69    float a1 = m43[3].y;
70    //int a2 = m43.length();  // ERROR until shading_language_420pack is fully implemented
71    const float b = 2 * a1;
72    //a.x = gl_MinProgramTexelOffset + gl_MaxProgramTexelOffset;    // ERROR until shading_language_420pack is fully implemented
73}
74
75
76#extension GL_ARB_texture_rectangle : enable
77#extension GL_ARB_shader_texture_lod : require
78
79uniform sampler2D s2D;
80uniform sampler2DRect s2DR;
81uniform sampler2DRectShadow s2DRS;
82uniform sampler1D s1D;
83uniform sampler2DShadow s2DS;
84
85void main()
86{
87    o = textureGather(sampC, vec3(0.2));
88    o.y =  gl_ClipDistance[3];
89    bar3();
90    bar4();
91    bar5();
92    bar6();
93}