diff --git a/ref/gl/gl2_shim/gl2_shim.c b/ref/gl/gl2_shim/gl2_shim.c index bf3dfddf..81f62353 100644 --- a/ref/gl/gl2_shim/gl2_shim.c +++ b/ref/gl/gl2_shim/gl2_shim.c @@ -202,12 +202,15 @@ static void APIENTRY GL2_BindTexture( GLenum tex, GLuint obj) } #endif -static char *GL_PrintInfoLog( GLhandleARB object ) +static char *GL_PrintInfoLog( GLhandleARB object, qboolean program ) { static char msg[8192]; int maxLength = 0; - pglGetObjectParameterivARB( object, GL_OBJECT_INFO_LOG_LENGTH_ARB, &maxLength ); + if( program && pglProgramiv) + pglProgramiv( object, GL_OBJECT_INFO_LOG_LENGTH_ARB, &maxLength ); + else + pglGetObjectParameterivARB( object, GL_OBJECT_INFO_LOG_LENGTH_ARB, &maxLength ); if( maxLength >= sizeof( msg )) { @@ -215,7 +218,10 @@ static char *GL_PrintInfoLog( GLhandleARB object ) maxLength = sizeof( msg ) - 1; } - pglGetInfoLogARB( object, maxLength, &maxLength, msg ); + if( program && pglGetProgramInfoLog) + pglGetProgramInfoLog( object, maxLength, &maxLength, msg ); + else + pglGetInfoLogARB( object, maxLength, &maxLength, msg ); return msg; } @@ -276,7 +282,7 @@ static GLuint GL2_GenerateShader( gl2wrap_prog_t *prog, GLenum type ) if ( status == GL_FALSE ) { - gEngfuncs.Con_Reportf( S_ERROR "GL2_GenerateShader( 0x%04x, 0x%x ): compile failed: %s\n", prog->flags, type, GL_PrintInfoLog(id)); + gEngfuncs.Con_Reportf( S_ERROR "GL2_GenerateShader( 0x%04x, 0x%x ): compile failed: %s\n", prog->flags, type, GL_PrintInfoLog(id, false)); gEngfuncs.Con_DPrintf( "Shader text:\n%s\n\n", shader ); pglDeleteObjectARB( id ); @@ -358,7 +364,7 @@ static gl2wrap_prog_t *GL2_GetProg( const GLuint flags ) pglGetObjectParameterivARB( glprog, GL_OBJECT_LINK_STATUS_ARB, &status ); if ( status == GL_FALSE ) { - gEngfuncs.Con_Reportf( S_ERROR "GL2_GetProg(): Failed linking progs for 0x%04x!\n%s\n", prog->flags, GL_PrintInfoLog(glprog) ); + gEngfuncs.Con_Reportf( S_ERROR "GL2_GetProg(): Failed linking progs for 0x%04x!\n%s\n", prog->flags, GL_PrintInfoLog(glprog, true) ); prog->flags = 0; if( pglDeleteProgram ) pglDeleteProgram( glprog ); diff --git a/ref/gl/gl_export.h b/ref/gl/gl_export.h index d7a4089e..fbd8ddf7 100644 --- a/ref/gl/gl_export.h +++ b/ref/gl/gl_export.h @@ -1375,6 +1375,7 @@ APIENTRY_LINKAGE void GL_FUNCTION( glSwapInterval ) ( int interval ); // arb shaders change in core APIENTRY_LINKAGE void GL_FUNCTION( glDeleteProgram )(GLuint program); APIENTRY_LINKAGE void GL_FUNCTION( glProgramiv )(GLuint program, GLenum e, GLuint *v); +APIENTRY_LINKAGE void GL_FUNCTION( glGetProgramInfoLog )(GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *infoLog); // gl2shim deps APIENTRY_LINKAGE void GL_FUNCTION( glBufferStorage )( GLenum target, GLsizei size, const GLvoid * data, GLbitfield flags); diff --git a/ref/gl/gl_opengl.c b/ref/gl/gl_opengl.c index 652d1de5..e475452d 100644 --- a/ref/gl/gl_opengl.c +++ b/ref/gl/gl_opengl.c @@ -381,6 +381,7 @@ static dllfunc_t shaderobjectsfuncs_gles[] = { "glVertexAttrib3fv" , (void **)&pglVertexAttrib3fvARB }, { "glProgramiv" , (void**)&pglProgramiv }, { "glDeleteProgram" , (void**)&pglDeleteProgram }, + { "glGetProgramInfoLog" , (void **)&pglGetProgramInfoLog }, //{ "glVertexAttrib4f" , (void **)&pglVertexAttrib4fARB }, //{ "glVertexAttrib4fv" , (void **)&pglVertexAttrib4fvARB }, //{ "glVertexAttrib4ubv" , (void **)&pglVertexAttrib4ubvARB },