mirror of
https://github.com/YGGverse/xash3d-fwgs.git
synced 2025-01-12 08:08:02 +00:00
gl2shim: try fix getting program link log
This commit is contained in:
parent
4a2f8cafcd
commit
d378878c91
@ -202,12 +202,15 @@ static void APIENTRY GL2_BindTexture( GLenum tex, GLuint obj)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static char *GL_PrintInfoLog( GLhandleARB object )
|
static char *GL_PrintInfoLog( GLhandleARB object, qboolean program )
|
||||||
{
|
{
|
||||||
static char msg[8192];
|
static char msg[8192];
|
||||||
int maxLength = 0;
|
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 ))
|
if( maxLength >= sizeof( msg ))
|
||||||
{
|
{
|
||||||
@ -215,7 +218,10 @@ static char *GL_PrintInfoLog( GLhandleARB object )
|
|||||||
maxLength = sizeof( msg ) - 1;
|
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;
|
return msg;
|
||||||
}
|
}
|
||||||
@ -276,7 +282,7 @@ static GLuint GL2_GenerateShader( gl2wrap_prog_t *prog, GLenum type )
|
|||||||
|
|
||||||
if ( status == GL_FALSE )
|
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 );
|
gEngfuncs.Con_DPrintf( "Shader text:\n%s\n\n", shader );
|
||||||
pglDeleteObjectARB( id );
|
pglDeleteObjectARB( id );
|
||||||
@ -358,7 +364,7 @@ static gl2wrap_prog_t *GL2_GetProg( const GLuint flags )
|
|||||||
pglGetObjectParameterivARB( glprog, GL_OBJECT_LINK_STATUS_ARB, &status );
|
pglGetObjectParameterivARB( glprog, GL_OBJECT_LINK_STATUS_ARB, &status );
|
||||||
if ( status == GL_FALSE )
|
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;
|
prog->flags = 0;
|
||||||
if( pglDeleteProgram )
|
if( pglDeleteProgram )
|
||||||
pglDeleteProgram( glprog );
|
pglDeleteProgram( glprog );
|
||||||
|
@ -1375,6 +1375,7 @@ APIENTRY_LINKAGE void GL_FUNCTION( glSwapInterval ) ( int interval );
|
|||||||
// arb shaders change in core
|
// arb shaders change in core
|
||||||
APIENTRY_LINKAGE void GL_FUNCTION( glDeleteProgram )(GLuint program);
|
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( glProgramiv )(GLuint program, GLenum e, GLuint *v);
|
||||||
|
APIENTRY_LINKAGE void GL_FUNCTION( glGetProgramInfoLog )(GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *infoLog);
|
||||||
|
|
||||||
// gl2shim deps
|
// gl2shim deps
|
||||||
APIENTRY_LINKAGE void GL_FUNCTION( glBufferStorage )( GLenum target, GLsizei size, const GLvoid * data, GLbitfield flags);
|
APIENTRY_LINKAGE void GL_FUNCTION( glBufferStorage )( GLenum target, GLsizei size, const GLvoid * data, GLbitfield flags);
|
||||||
|
@ -381,6 +381,7 @@ static dllfunc_t shaderobjectsfuncs_gles[] =
|
|||||||
{ "glVertexAttrib3fv" , (void **)&pglVertexAttrib3fvARB },
|
{ "glVertexAttrib3fv" , (void **)&pglVertexAttrib3fvARB },
|
||||||
{ "glProgramiv" , (void**)&pglProgramiv },
|
{ "glProgramiv" , (void**)&pglProgramiv },
|
||||||
{ "glDeleteProgram" , (void**)&pglDeleteProgram },
|
{ "glDeleteProgram" , (void**)&pglDeleteProgram },
|
||||||
|
{ "glGetProgramInfoLog" , (void **)&pglGetProgramInfoLog },
|
||||||
//{ "glVertexAttrib4f" , (void **)&pglVertexAttrib4fARB },
|
//{ "glVertexAttrib4f" , (void **)&pglVertexAttrib4fARB },
|
||||||
//{ "glVertexAttrib4fv" , (void **)&pglVertexAttrib4fvARB },
|
//{ "glVertexAttrib4fv" , (void **)&pglVertexAttrib4fvARB },
|
||||||
//{ "glVertexAttrib4ubv" , (void **)&pglVertexAttrib4ubvARB },
|
//{ "glVertexAttrib4ubv" , (void **)&pglVertexAttrib4ubvARB },
|
||||||
|
Loading…
Reference in New Issue
Block a user