Merge pull request #2976 from jeremy-lunarg/hayes-fix-2975
[platform/upstream/glslang.git] / Test / textureQueryLOD.frag
1 #version 150
2
3 #ifdef GL_ARB_texture_query_lod
4 #extension GL_ARB_texture_query_lod : enable
5 #endif
6 #ifdef GL_ARB_gpu_shader5
7 #extension GL_ARB_gpu_shader5 : enable
8 #endif
9
10 #ifdef GL_ES
11 precision highp float;
12 #endif
13
14 in vec2 vUV; // vert->frag
15 out vec4 color; // frag->fb
16 #define UV vUV
17
18 #define bias 1.5
19 #define TEX 128.0
20 #define offset ivec2(1,1)
21 uniform highp sampler2DShadow sampler;
22 uniform int funct;
23
24 void main (void)
25 {
26     switch (funct)
27     {
28     case 0:
29         ivec2 iv2 = textureSize(sampler, 0);
30 #ifdef GL_ARB_texture_query_lod
31         vec2 fv2 = textureQueryLOD(sampler, vec2(0.0, 0.0));
32 #endif
33                 color = vec4(iv2,fv2);
34         break;
35     default:
36         color = vec4(1.0, 1.0, 1.0, 1.0);
37         break;
38     }
39 }