Changeset 399

Show
Ignore:
Timestamp:
05/28/07 05:13:11 (1 year ago)
Author:
krobillard
Message:

Thune GL - Shader link errors now properly reported.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/thune/thread_safe/gl/shader.c

    r390 r399  
    3535 
    3636 
    37 static void printInfoLog( UThread* ut, GLuint obj
     37static void printInfoLog( UThread* ut, GLuint obj, int prog
    3838{ 
    3939    GLint infologLength; 
     
    4141    char* infoLog; 
    4242 
    43     glGetShaderiv( obj, GL_INFO_LOG_LENGTH, &infologLength ); 
     43    if( prog ) 
     44        glGetProgramiv( obj, GL_INFO_LOG_LENGTH, &infologLength ); 
     45    else 
     46        glGetShaderiv( obj, GL_INFO_LOG_LENGTH, &infologLength ); 
     47 
    4448    if( infologLength > 0 ) 
    4549    { 
    4650        infoLog = (char*) malloc( infologLength ); 
    47         glGetShaderInfoLog( obj, infologLength, &charsWritten, infoLog ); 
     51 
     52        if( prog ) 
     53            glGetProgramInfoLog( obj, infologLength, &charsWritten, infoLog ); 
     54        else 
     55            glGetShaderInfoLog( obj, infologLength, &charsWritten, infoLog ); 
    4856 
    4957        //fprintf( stderr, "%s\n", infoLog ); 
     
    7381    if( ! ok ) 
    7482    { 
    75         printInfoLog( ut, sh->vertexObj ); 
     83        printInfoLog( ut, sh->vertexObj, 0 ); 
    7684        return 0; 
    7785    } 
     
    8391    if( ! ok ) 
    8492    { 
    85         printInfoLog( ut, sh->fragmentObj ); 
     93        printInfoLog( ut, sh->fragmentObj, 0 ); 
    8694        return 0; 
    8795    } 
     
    99107    if( ! ok ) 
    100108    { 
    101         printInfoLog( ut, sh->fragmentObj ); 
     109        printInfoLog( ut, sh->program, 1 ); 
    102110        return 0; 
    103111    } 
  • trunk/thune/gl/shader.c

    r382 r399  
    3535 
    3636 
    37 static void printInfoLog( UThread* ur_thread, GLuint obj
     37static void printInfoLog( UThread* ur_thread, GLuint obj, int prog
    3838{ 
    3939    GLint infologLength; 
     
    4141    char* infoLog; 
    4242 
    43     glGetShaderiv( obj, GL_INFO_LOG_LENGTH, &infologLength ); 
     43    if( prog ) 
     44        glGetProgramiv( obj, GL_INFO_LOG_LENGTH, &infologLength ); 
     45    else 
     46        glGetShaderiv( obj, GL_INFO_LOG_LENGTH, &infologLength ); 
     47 
    4448    if( infologLength > 0 ) 
    4549    { 
    4650        infoLog = (char*) malloc( infologLength ); 
    47         glGetShaderInfoLog( obj, infologLength, &charsWritten, infoLog ); 
     51 
     52        if( prog ) 
     53            glGetProgramInfoLog( obj, infologLength, &charsWritten, infoLog ); 
     54        else 
     55            glGetShaderInfoLog( obj, infologLength, &charsWritten, infoLog ); 
    4856 
    4957        //fprintf( stderr, "%s\n", infoLog ); 
     
    7381    if( ! ok ) 
    7482    { 
    75         printInfoLog( thr, sh->vertexObj ); 
     83        printInfoLog( thr, sh->vertexObj, 0 ); 
    7684        return 0; 
    7785    } 
     
    8391    if( ! ok ) 
    8492    { 
    85         printInfoLog( thr, sh->fragmentObj ); 
     93        printInfoLog( thr, sh->fragmentObj, 0 ); 
    8694        return 0; 
    8795    } 
     
    99107    if( ! ok ) 
    100108    { 
    101         printInfoLog( thr, sh->fragmentObj ); 
     109        printInfoLog( thr, sh->program, 1 ); 
    102110        return 0; 
    103111    }