File: precision-qualifier-sampler.frag

package info (click to toggle)
piglit 0~git20200212-f4710c51b-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 106,972 kB
  • sloc: ansic: 263,763; xml: 48,941; python: 29,918; lisp: 19,789; cpp: 12,142; sh: 22; makefile: 20; pascal: 5
file content (74 lines) | stat: -rw-r--r-- 2,433 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
// [config]
// expect_result: pass
// glsl_version: 1.30
// require_extensions: GL_ARB_arrays_of_arrays
// check_link: true
// [end config]
//
// From the GLSL ES 3.00 specification, section 4.5.4 ("Default
// Precision Qualifiers"):
//
// "The precision statement
//
// precision precision-qualifier type;
//
// can be used to establish a default precision qualifier. The
// type field can be int or float or any of the sampler types, and
// the precision-qualifier can be lowp, mediump, or highp."
//
// Section 8 (Built-In Functions) of the GLSL ES 1.00 spec says:

// "uniform lowp sampler2D sampler;
//  highp vec2 coord;
//  ...
//  lowp vec4 col = texture2D (sampler, coord);
//                                         // texture2D returns lowp"
//
// Section 4.5 (Precision and Precision Qualifiers) of the GLSL 1.30
// spec also says:
//
// "Precision qualifiers are added for code portability with OpenGL
//  ES, not for functionality. They have the same syntax as in OpenGL ES."
//
// From this, we infer that GLSL 1.30 (and later) should allow precision
// qualifiers on sampler types just like float and integer types.
//
// This test verifies that a precision qualifier can be used on all of
// GLSL 1.30's sampler types.

#version 130
#extension GL_ARB_arrays_of_arrays: enable

#ifdef GL_ARB_texture_cube_map_array
#extension GL_ARB_texture_cube_map_array: enable
uniform mediump samplerCubeArray cms1[2][2];
uniform mediump samplerCubeArrayShadow cms2[2][2];
#endif

uniform mediump sampler1D s1[2][2];
uniform mediump sampler2D s2[2][2];
uniform mediump sampler3D s3[2][2];
uniform mediump samplerCube s4[2][2];
uniform mediump samplerCubeShadow s5[2][2];
uniform mediump sampler1DShadow s6[2][2];
uniform mediump sampler2DShadow s7[2][2];
uniform mediump sampler1DArray s8[2][2];
uniform mediump sampler2DArray s9[2][2];
uniform mediump sampler1DArrayShadow s10[2][2];
uniform mediump sampler2DArrayShadow s11[2][2];
uniform mediump isampler1D s12[2][2];
uniform mediump isampler2D s13[2][2];
uniform mediump isampler3D s14[2][2];
uniform mediump isamplerCube s15[2][2];
uniform mediump isampler1DArray s16[2][2];
uniform mediump isampler2DArray s17[2][2];
uniform mediump usampler1D s18[2][2];
uniform mediump usampler2D s19[2][2];
uniform mediump usampler3D s20[2][2];
uniform mediump usamplerCube s21[2][2];
uniform mediump usampler1DArray s22[2][2];
uniform mediump usampler2DArray s23[2][2];

void main()
{
}