From 39c9516197c208bb918ce87b968ad32e703b4413 Mon Sep 17 00:00:00 2001 From: Ryan Houdek Date: Fri, 17 May 2013 21:12:21 -0500 Subject: [PATCH] [Android] Qualcomm driver has a bug where it returns an invalid length for GL_INFO_LOG_LENGTH with glGetShaderiv. Qualcomm drivers seem to max out at ~512bytes returned from glGetShaderInfoLog so this is a reasonable max. --- Source/Plugins/Plugin_VideoOGL/Src/ProgramShaderCache.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Source/Plugins/Plugin_VideoOGL/Src/ProgramShaderCache.cpp b/Source/Plugins/Plugin_VideoOGL/Src/ProgramShaderCache.cpp index 1b5ab26c73..1c85177352 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/ProgramShaderCache.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/ProgramShaderCache.cpp @@ -334,6 +334,12 @@ GLuint ProgramShaderCache::CompileSingleShader (GLuint type, const char* code ) if (compileStatus != GL_TRUE || (length > 1 && DEBUG_GLSL)) { GLsizei charsWritten; +#ifdef USE_GLES3 + // This is a bug in the Qualcomm OpenGL Driver + // The length returned is garbage length so we need to set a default max + // XXX: Check if qualcomm driver here + length = 1024; // Qualcomm driver maxes out at 512 bytes returned from glGetShaderInfoLog anyway +#endif GLchar* infoLog = new GLchar[length]; glGetShaderInfoLog(result, length, &charsWritten, infoLog); ERROR_LOG(VIDEO, "PS Shader info log:\n%s", infoLog); @@ -527,7 +533,7 @@ void ProgramShaderCache::CreateHeader ( void ) , v==GLSLES3 ? "300 es" : v==GLSL_120 ? "120" : v==GLSL_130 ? "130" : "140" , v==GLSLES3 ? "precision highp float;" : "" - , v<=GLSL_130 ? "#extension GL_ARB_texture_rectangle : enable" : "#define texture2DRect texture" + , v==GLSLES3 ? "" : v<=GLSL_130 ? "#extension GL_ARB_texture_rectangle : enable" : "#define texture2DRect texture" , g_ActiveConfig.backend_info.bSupportsGLSLUBO && v