2 <title>WebGL test: `highp` support
</title>
3 <script src=
"/tests/SimpleTest/SimpleTest.js"></script>
4 <link rel=
"stylesheet" href=
"/tests/SimpleTest/test.css">
5 <script src=
"driver-info.js"></script>
6 <script src=
"webgl-util.js"></script>
7 <script id=
"shader-vs" type=
"x-shader/x-vertex">
10 gl_Position = vec4(vec3(
0.0),
1.0);
14 <script id=
"shader-fs" type=
"x-shader/x-fragment">
16 precision highp float;
19 gl_FragColor = vec4(
1.0,
1.0,
1.0,
1.0);
24 <canvas id=
"c"></canvas>
27 // Give ourselves a scope to return early from:
29 var gl
= c
.getContext('webgl');
31 todo(false, 'WebGL is unavailable.');
35 function checkGLError(func
, info
) {
36 var error
= gl
.getError();
37 var prefix
= info
? ('[' + info
+ '] ') : ''
38 func(!error
, prefix
+ 'gl.getError should be 0x0, was 0x' + error
.toString(16) + '.');
41 var format
= gl
.getShaderPrecisionFormat(gl
.FRAGMENT_SHADER
, gl
.HIGH_FLOAT
);
42 var prog
= WebGLUtil
.createProgramByIds(gl
, 'shader-vs', 'shader-fs');
46 ok(prog
, 'Frag shader with unconditional `precision highp float` should ' +
47 'link if `getShaderPrecisionFormat` gives a format for it.');
49 ok(!prog
, 'Frag shader with unconditional `precision highp float` should ' +
50 'NOT link if `getShaderPrecisionFormat` gives NO format for it.');