vo_gpu: use highp float if available for GLES

Using mediump float on GLES causes problems with kernel resampling,
PQ HDR, and possibly others. The issues are fixed by using highp,
which is available when GL_FRAGMENT_PRECISION_HIGH is defined.
This commit is contained in:
Stephen Salerno 2020-06-02 11:27:32 -05:00 committed by Jan Ekström
parent dc24a437fb
commit 5141662427
1 changed files with 5 additions and 0 deletions

View File

@ -761,7 +761,12 @@ static void gl_sc_generate(struct gl_shader_cache *sc,
for (int n = 0; n < sc->num_exts; n++)
ADD(header, "#extension %s : enable\n", sc->exts[n]);
if (glsl_es) {
ADD(header, "#ifdef GL_FRAGMENT_PRECISION_HIGH\n");
ADD(header, "precision highp float;\n");
ADD(header, "#else\n");
ADD(header, "precision mediump float;\n");
ADD(header, "#endif\n");
ADD(header, "precision mediump sampler2D;\n");
if (sc->ra->caps & RA_CAP_TEX_3D)
ADD(header, "precision mediump sampler3D;\n");