Changeset 1470


Ignore:
Timestamp:
Jun 14, 2012, 2:30:58 PM (7 years ago)
Author:
sam
Message:

gpu: be more verbose about shader compilation; some warnings are useful.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/gpu/shader.cpp

    r1459 r1470  
    211211    glCompileShader(data->vert_id);
    212212
     213    glGetShaderInfoLog(data->vert_id, sizeof(errbuf), &len, errbuf);
    213214    glGetShaderiv(data->vert_id, GL_COMPILE_STATUS, &status);
    214215    if (status != GL_TRUE)
    215216    {
    216         glGetShaderInfoLog(data->vert_id, sizeof(errbuf), &len, errbuf);
    217217        Log::Error("failed to compile vertex shader: %s", errbuf);
    218218        Log::Error("shader source:\n%s\n", buf);
     219    }
     220    else if (len > 1)
     221    {
     222        Log::Debug("compile log for vertex shader: %s", errbuf);
     223        Log::Debug("shader source:\n%s\n", buf);
    219224    }
    220225#else
     
    250255    glCompileShader(data->frag_id);
    251256
     257    glGetShaderInfoLog(data->frag_id, sizeof(errbuf), &len, errbuf);
    252258    glGetShaderiv(data->frag_id, GL_COMPILE_STATUS, &status);
    253259    if (status != GL_TRUE)
    254260    {
    255         glGetShaderInfoLog(data->frag_id, sizeof(errbuf), &len, errbuf);
    256261        Log::Error("failed to compile fragment shader: %s", errbuf);
    257262        Log::Error("shader source:\n%s\n", buf);
     263    }
     264    else if (len > 1)
     265    {
     266        Log::Debug("compile log for fragment shader: %s", errbuf);
     267        Log::Debug("shader source:\n%s\n", buf);
    258268    }
    259269#else
     
    294304
    295305    glLinkProgram(data->prog_id);
     306    glGetProgramInfoLog(data->prog_id, sizeof(errbuf), &len, errbuf);
     307    glGetProgramiv(data->prog_id, GL_LINK_STATUS, &status);
     308    if (status != GL_TRUE)
     309    {
     310        Log::Error("failed to link program: %s", errbuf);
     311    }
     312    else if (len > 1)
     313    {
     314        Log::Debug("link log for program: %s", errbuf);
     315    }
    296316    glValidateProgram(data->prog_id);
    297317#endif
Note: See TracChangeset for help on using the changeset viewer.