Commit 4144f2e8 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Don't bother explicitly terminating the GLSL info log in print_glsl_info_log().

parent 67c67703
......@@ -518,29 +518,35 @@ void print_glsl_info_log(const struct wined3d_gl_info *gl_info, GLuint id, BOOL
* that if there are errors. */
if (length > 1)
{
const char *ptr, *line;
const char *ptr, *end, *line;
log = heap_alloc(length);
/* The info log is supposed to be zero-terminated, but at least some
* versions of fglrx don't terminate the string properly. The reported
* length does include the terminator, so explicitly set it to zero
* here. */
log[length - 1] = 0;
if (program)
GL_EXTCALL(glGetProgramInfoLog(id, length, NULL, log));
else
GL_EXTCALL(glGetShaderInfoLog(id, length, NULL, log));
ptr = log;
/* The info log is supposed to be zero-terminated. Note that at least
* some versions of fglrx don't terminate the string properly. The
* reported length does include the supposed terminator though, so we
* don't care here. */
end = &ptr[length - 1];
if (gl_info->quirks & WINED3D_QUIRK_INFO_LOG_SPAM)
{
WARN("Info log received from GLSL shader #%u:\n", id);
while ((line = get_info_log_line(&ptr))) WARN(" %.*s", (int)(ptr - line), line);
while ((line = wined3d_get_line(&ptr, end)))
{
WARN(" %.*s", (int)(ptr - line), line);
}
}
else
{
FIXME("Info log received from GLSL shader #%u:\n", id);
while ((line = get_info_log_line(&ptr))) FIXME(" %.*s", (int)(ptr - line), line);
while ((line = wined3d_get_line(&ptr, end)))
{
FIXME(" %.*s", (int)(ptr - line), line);
}
}
heap_free(log);
}
......
......@@ -74,6 +74,20 @@ static inline float int_to_float(uint32_t i)
return u.f;
}
static inline const char *wined3d_get_line(const char **ptr, const char *end)
{
const char *p, *q;
if ((p = *ptr) >= end)
return NULL;
if (!(q = memchr(p, '\n', end - p)))
*ptr = end;
else
*ptr = q + 1;
return p;
}
#define MAKEDWORD_VERSION(maj, min) (((maj & 0xffffu) << 16) | (min & 0xffffu))
/* Driver quirks */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment