Skip to content

Commit 9dc4064

Browse files
authored
Use highp when necessary in shader-precision-format. (#3743)
The test is written against WebGL 1.0, where it's legal for implementations to not support highp in the fragment shader. Use highp for tests of highp integer values, but continue to use mediump for tests of both lowp and mediump ints. Fixes #3739.
1 parent 0c8cdec commit 9dc4064

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

sdk/tests/conformance/misc/shader-precision-format.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,9 @@
223223
testRenderPrecision(gl, shaderType, 'int', precision, expected, msg);
224224
}
225225

226+
// Only use highp in the fragment shader if caller has determined it's supported.
227+
const uniformPrecision = (precision == 'highp' ? 'highp' : 'mediump');
228+
226229
{
227230
const vs = `
228231
attribute vec4 position;
@@ -261,7 +264,7 @@
261264
const fs = `
262265
precision ${precision} float;
263266
uniform ${precision} int v;
264-
uniform mediump float f;
267+
uniform ${uniformPrecision} float f;
265268
266269
void main() {
267270
mediump float diff = abs(float(v) - f);

0 commit comments

Comments
 (0)