From 304a1c21ca1b3d4ae630c0e85a04eb83919ae886 Mon Sep 17 00:00:00 2001 From: Stas Gurtovoy Date: Thu, 30 Jun 2011 10:54:44 +0300 Subject: [PATCH] opengles Translator: Omit precision macros from shaders The shaders fail to compile if we don't omit those changes (Cordy game for example). Anyways, they have no semantic meaning in GLSL, quote for GLSL 4.1 spec: "Precision qualifiers are added for code portability with OpenGL ES, not for functionality. They have the same syntax as in OpenGL ES, as described below, but they have no semantic meaning, which includes no effect on the precision used to store or operate on variables." Also removed an anoying print in the encoder. --- .../opengl/host/libs/Translator/GLES_V2/ShaderParser.cpp | 5 +++++ tools/emulator/opengl/system/GLESv2_enc/GL2Encoder.cpp | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/tools/emulator/opengl/host/libs/Translator/GLES_V2/ShaderParser.cpp b/tools/emulator/opengl/host/libs/Translator/GLES_V2/ShaderParser.cpp index 00d6ab0aa..fa7bcd5bf 100644 --- a/tools/emulator/opengl/host/libs/Translator/GLES_V2/ShaderParser.cpp +++ b/tools/emulator/opengl/host/libs/Translator/GLES_V2/ShaderParser.cpp @@ -19,11 +19,16 @@ void ShaderParser::setSrc(const Version& ver,GLsizei count,const GLchar** string all precision qualifiers from the shader source , otherwise we will use a shader parser which set the default precisions to be the same as the default precisions of GLSL ES */ +#if 0 if(ver < Version(1,30,10)){ parseOmitPrecision(); } else { parseExtendDefaultPrecision(); } +#else + //XXX: Until proved otherwise, glsl doesn't know/use those precision macros, so we omit then + parseOmitPrecision(); +#endif } const char* ShaderParser::getOriginalSrc(){ diff --git a/tools/emulator/opengl/system/GLESv2_enc/GL2Encoder.cpp b/tools/emulator/opengl/system/GLESv2_enc/GL2Encoder.cpp index 38e8756a4..1d645914e 100644 --- a/tools/emulator/opengl/system/GLESv2_enc/GL2Encoder.cpp +++ b/tools/emulator/opengl/system/GLESv2_enc/GL2Encoder.cpp @@ -304,7 +304,7 @@ void GL2Encoder::s_glDrawElements(void *self, GLenum mode, GLsizei count, GLenum count * glSizeof(type)); // XXX - OPTIMIZATION (see the other else branch) should be implemented if(!has_indirect_arrays) { - LOGD("unoptimized drawelements !!!\n"); + //LOGD("unoptimized drawelements !!!\n"); } } else { // we are all direct arrays and immidate mode index array -