gl-renderer: fragment shader precision to high

Always when supported, make the fragment shader default floating point
precision high. The medium precision is roughly like half-floats, which
can be surprisingly bad. High precision does not reach even normal
32-bit float precision (by specification), but it's better. GL ES
implementations are allowed to exceed the minimum precision requirements
given in the specification.

This is an advance attempt to avoid nasty surprises from poor shader
precision.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
dev
Pekka Paalanen 4 years ago committed by Pekka Paalanen
parent 4d5b2f3410
commit 391f513c36
  1. 8
      libweston/renderer-gl/fragment.glsl

@ -46,7 +46,13 @@
#extension GL_OES_EGL_image_external : require
#endif
precision mediump float;
#ifdef GL_FRAGMENT_PRECISION_HIGH
#define HIGHPRECISION highp
#else
#define HIGHPRECISION mediump
#endif
precision HIGHPRECISION float;
/*
* These undeclared identifiers will be #defined by a runtime generated code

Loading…
Cancel
Save