Commit 2920fc26 authored by Neil Roberts's avatar Neil Roberts

generators: Add the default precision for floats in GLSL ES shaders

In GLSL ES fragment shaders there is no default precision for floats.
The generated shaders are using floats in the return type of a
function. These had undefined precision which should be invalid.

Mesa has started detecting this since 95927c414ff.
Reviewed-by: Tapani Pälli's avatarTapani Pälli <tapani.palli@intel.com>
parent 2b3e9884
Pipeline #61399 passed with stage
......@@ -33,6 +33,10 @@
#extension ${ext} : require
% endfor
% if version.is_es:
precision mediump float;
% endif
#if defined ${extension}
# error ${extension} is defined, but should not be
#endif
......
......@@ -34,6 +34,10 @@
#extension ${ext} : require
% endfor
% if version.is_es:
precision mediump float;
% endif
#if !defined ${extension}
# error ${extension} is not defined
#elif ${extension} != 1
......
......@@ -34,4 +34,8 @@
% endfor
#extension ${extension} : require
% if version.is_es:
precision mediump float;
% endif
float foo() { return 0.0; }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment