Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[Android] Qualcomm driver has a bug where it returns an invalid lengt…
…h for GL_INFO_LOG_LENGTH with glGetShaderiv. Qualcomm drivers seem to max out at ~512bytes returned from glGetShaderInfoLog so this is a reasonable max.
  • Loading branch information
Sonicadvance1 committed May 18, 2013
1 parent c30d00e commit 39c9516
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Source/Plugins/Plugin_VideoOGL/Src/ProgramShaderCache.cpp
Expand Up @@ -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);
Expand Down Expand Up @@ -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<GLSL_140 ? "#extension GL_ARB_uniform_buffer_object : enable" : ""
, v==GLSL_120 ? "attribute" : "in"
, v==GLSL_120 ? "attribute" : "out"
Expand Down

0 comments on commit 39c9516

Please sign in to comment.