1
0
mirror of https://github.com/FunkyFr3sh/cnc-ddraw.git synced 2025-03-24 17:49:52 +01:00

add glGetShaderInfoLog output to logs

This commit is contained in:
FunkyFr3sh 2023-08-29 14:19:49 +02:00
parent 911311bc45
commit 3716807d3d

View File

@ -216,7 +216,7 @@ void oglu_init()
g_oglu_got_version3 = FALSE; g_oglu_got_version3 = FALSE;
wglCreateContextAttribsARB = (PFNWGLCREATECONTEXTATTRIBSARBPROC)xwglGetProcAddress("wglCreateContextAttribsARB"); wglCreateContextAttribsARB = (PFNWGLCREATECONTEXTATTRIBSARBPROC)xwglGetProcAddress("wglCreateContextAttribsARB");
} }
if (g_ddraw->opengl_core) if (g_ddraw->opengl_core)
{ {
wglCreateContextAttribsARB = (PFNWGLCREATECONTEXTATTRIBSARBPROC)xwglGetProcAddress("wglCreateContextAttribsARB"); wglCreateContextAttribsARB = (PFNWGLCREATECONTEXTATTRIBSARBPROC)xwglGetProcAddress("wglCreateContextAttribsARB");
@ -270,6 +270,22 @@ GLuint oglu_build_program(const GLchar* vert_source, const GLchar* frag_source)
glGetShaderiv(vert_shader, GL_COMPILE_STATUS, &is_compiled); glGetShaderiv(vert_shader, GL_COMPILE_STATUS, &is_compiled);
if (is_compiled == GL_FALSE) if (is_compiled == GL_FALSE)
{ {
#ifdef _DEBUG
GLint len = 0;
glGetShaderiv(frag_shader, GL_INFO_LOG_LENGTH, &len);
if (len > 0)
{
char* log = calloc(len + 50, 1);
if (log)
{
glGetShaderInfoLog(frag_shader, len, &len, &log[0]);
TRACE("glGetShaderInfoLog (Vertex):\n%s", log);
free(log);
}
}
#endif
if (glDeleteShader) if (glDeleteShader)
glDeleteShader(vert_shader); glDeleteShader(vert_shader);
@ -283,14 +299,22 @@ GLuint oglu_build_program(const GLchar* vert_source, const GLchar* frag_source)
glGetShaderiv(frag_shader, GL_COMPILE_STATUS, &is_compiled); glGetShaderiv(frag_shader, GL_COMPILE_STATUS, &is_compiled);
if (is_compiled == GL_FALSE) if (is_compiled == GL_FALSE)
{ {
/* #ifdef _DEBUG
GLint len = 0; GLint len = 0;
glGetShaderiv(frag_shader, GL_INFO_LOG_LENGTH, &len); glGetShaderiv(frag_shader, GL_INFO_LOG_LENGTH, &len);
char* log = calloc(len + 50, 1); if (len > 0)
glGetShaderInfoLog(frag_shader, len, &len, &log[0]); {
TRACE("| GL_LOG: %s\n", log); char* log = calloc(len + 50, 1);
free(log);
*/ if (log)
{
glGetShaderInfoLog(frag_shader, len, &len, &log[0]);
TRACE("glGetShaderInfoLog (Fragment):\n%s", log);
free(log);
}
}
#endif
if (glDeleteShader) if (glDeleteShader)
{ {
glDeleteShader(frag_shader); glDeleteShader(frag_shader);