From fa81ebeece3c4a89d8de0c86ab0931721c172fce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Walter?= Date: Thu, 29 Mar 2018 21:07:51 +0200 Subject: [PATCH] GLES shader fixes --- plugins/SimulationView/layers.shader | 7 +++++++ plugins/SimulationView/layers_shadow.shader | 7 +++++++ plugins/SimulationView/simulationview_composite.shader | 7 +++++++ plugins/XRayView/xray_composite.shader | 7 +++++++ resources/shaders/grid.shader | 8 ++++++++ 5 files changed, 36 insertions(+) diff --git a/plugins/SimulationView/layers.shader b/plugins/SimulationView/layers.shader index d340773403..30f23a3189 100644 --- a/plugins/SimulationView/layers.shader +++ b/plugins/SimulationView/layers.shader @@ -28,6 +28,13 @@ vertex = } fragment = + #ifdef GL_ES + #ifdef GL_FRAGMENT_PRECISION_HIGH + precision highp float; + #else + precision mediump float; + #endif // GL_FRAGMENT_PRECISION_HIGH + #endif // GL_ES varying lowp vec4 v_color; varying float v_line_type; diff --git a/plugins/SimulationView/layers_shadow.shader b/plugins/SimulationView/layers_shadow.shader index 972f18c921..7ceccff21e 100644 --- a/plugins/SimulationView/layers_shadow.shader +++ b/plugins/SimulationView/layers_shadow.shader @@ -28,6 +28,13 @@ vertex = } fragment = + #ifdef GL_ES + #ifdef GL_FRAGMENT_PRECISION_HIGH + precision highp float; + #else + precision mediump float; + #endif // GL_FRAGMENT_PRECISION_HIGH + #endif // GL_ES varying lowp vec4 v_color; varying float v_line_type; diff --git a/plugins/SimulationView/simulationview_composite.shader b/plugins/SimulationView/simulationview_composite.shader index dcc02acc84..1ca8778b2b 100644 --- a/plugins/SimulationView/simulationview_composite.shader +++ b/plugins/SimulationView/simulationview_composite.shader @@ -13,6 +13,13 @@ vertex = } fragment = + #ifdef GL_ES + #ifdef GL_FRAGMENT_PRECISION_HIGH + precision highp float; + #else + precision mediump float; + #endif // GL_FRAGMENT_PRECISION_HIGH + #endif // GL_ES uniform sampler2D u_layer0; uniform sampler2D u_layer1; uniform sampler2D u_layer2; diff --git a/plugins/XRayView/xray_composite.shader b/plugins/XRayView/xray_composite.shader index 0a8f6364d7..7ea5287f96 100644 --- a/plugins/XRayView/xray_composite.shader +++ b/plugins/XRayView/xray_composite.shader @@ -13,6 +13,13 @@ vertex = } fragment = + #ifdef GL_ES + #ifdef GL_FRAGMENT_PRECISION_HIGH + precision highp float; + #else + precision mediump float; + #endif // GL_FRAGMENT_PRECISION_HIGH + #endif // GL_ES uniform sampler2D u_layer0; //Default pass. uniform sampler2D u_layer1; //Selection pass. uniform sampler2D u_layer2; //X-ray pass. diff --git a/resources/shaders/grid.shader b/resources/shaders/grid.shader index 07cb1a01a6..0510686889 100644 --- a/resources/shaders/grid.shader +++ b/resources/shaders/grid.shader @@ -14,6 +14,14 @@ vertex = } fragment = + #ifdef GL_ES + #extension GL_OES_standard_derivatives : enable + #ifdef GL_FRAGMENT_PRECISION_HIGH + precision highp float; + #else + precision mediump float; + #endif // GL_FRAGMENT_PRECISION_HIGH + #endif // GL_ES uniform lowp vec4 u_plateColor; uniform lowp vec4 u_gridColor0; uniform lowp vec4 u_gridColor1;