Permalink
Browse files

Merge branch 'iff-link-issue' of git://github.com/greggman/regal

  • Loading branch information...
2 parents 3a686e6 + 5da8892 commit 793b87d8cc803ea3055c0b9f783b407421558711 @nigels-com nigels-com committed Aug 30, 2012
Showing with 16 additions and 8 deletions.
  1. +16 −8 src/regal/RegalIff.cpp
View
@@ -1325,10 +1325,14 @@ void Program::Init( RegalContext * ctx, const Store & sstore, const GLchar *vsSr
Shader( ctx, tbl, GL_FRAGMENT_SHADER, fs, fsSrc );
Attribs( ctx );
ctx->dispatcher.call(&tbl.glLinkProgram)( pg );
- ctx->dispatcher.call(&tbl.glGetProgramInfoLog)( pg, (1<<15) - 2, &dbgLogLen, dbgLog );
- dbgLog[ dbgLogLen ] = 0;
- if( dbgLogLen > 0 ) {
- ITrace( dbgLog );
+ GLint status = 0;
+ ctx->dispatcher.call(&tbl.glGetProgramiv)( pg, GL_LINK_STATUS, &status );
+ if ( !status ) {
+ ctx->dispatcher.call(&tbl.glGetProgramInfoLog)( pg, (1<<15) - 2, &dbgLogLen, dbgLog );
+ dbgLog[ dbgLogLen ] = 0;
+ if( dbgLogLen > 0 ) {
+ ITrace( dbgLog );
+ }
}
ctx->dispatcher.call(&tbl.glUseProgram)( pg );
@@ -1356,10 +1360,14 @@ void Program::Shader( RegalContext * ctx, DispatchTable & tbl, GLenum type, GLui
shader = ctx->dispatcher.call(&tbl.glCreateShader)(type);
ctx->dispatcher.call(&tbl.glShaderSource)( shader, 1, srcs, len );
ctx->dispatcher.call(&tbl.glCompileShader)( shader );
- ctx->dispatcher.call(&tbl.glGetShaderInfoLog)( shader, (1<<15) - 2, &dbgLogLen, dbgLog );
- dbgLog[ dbgLogLen ] = 0;
- if( dbgLogLen > 0 ) {
- ITrace( dbgLog );
+ GLint status = 0;
+ ctx->dispatcher.call(&tbl.glGetShaderiv)( shader, GL_COMPILE_STATUS, &status );
+ if ( !status ) {
+ ctx->dispatcher.call(&tbl.glGetShaderInfoLog)( shader, (1<<15) - 2, &dbgLogLen, dbgLog );
+ dbgLog[ dbgLogLen ] = 0;
+ if( dbgLogLen > 0 ) {
+ ITrace( dbgLog );
+ }
}
ctx->dispatcher.call(&tbl.glAttachShader)( pg, shader );
}

0 comments on commit 793b87d

Please sign in to comment.