From 7f4cdc86bcec5d63ed6be0034a0937d6b5cc369e Mon Sep 17 00:00:00 2001 From: Hannes Janetzek Date: Mon, 16 Sep 2013 20:41:52 +0200 Subject: [PATCH] workaround: strip shader 'precision' qualifier for desktop GL --- vtm/src/org/oscim/utils/GlUtils.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/vtm/src/org/oscim/utils/GlUtils.java b/vtm/src/org/oscim/utils/GlUtils.java index 66fcabe2..a262b0a6 100644 --- a/vtm/src/org/oscim/utils/GlUtils.java +++ b/vtm/src/org/oscim/utils/GlUtils.java @@ -174,6 +174,18 @@ public class GlUtils { */ public static int loadShader(int shaderType, String source) { + if (GLAdapter.GDX_DESKTOP_QUIRKS) { + // Strip precision modifer + int start = source.indexOf("precision"); + if (start >= 0) { + int end = source.indexOf(';', start) + 1; + if (start > 0) + source = source.substring(0, start) + source.substring(end); + else + source = source.substring(end); + } + } + int shader = GL.glCreateShader(shaderType); if (shader != 0) { GL.glShaderSource(shader, source);