mesa: rework the meaning of gl_debug_message::length
authorEmil Velikov <emil.l.velikov@gmail.com>
Thu, 26 Nov 2015 00:36:17 +0000 (00:36 +0000)
committerEmil Velikov <emil.l.velikov@gmail.com>
Thu, 3 Dec 2015 19:21:19 +0000 (19:21 +0000)
commit5a23f6bd8d8d26e0e75801df44cc228f15f9768e
treebb496052c6b4bee01b54b9fcfd6151b4c7dfe978
parent622186fbdf47e4c77aadba3e38567636ecbcccf5
mesa: rework the meaning of gl_debug_message::length

Currently it stores strlen(buf) whenever the user originally provided a
negative value for length.

Although I've not seen any explicit text in the spec, CTS requires that
the very same length (be that negative value or not) is returned back on
Pop.

So let's push down the length < 0 checks, tweak the meaning of
gl_debug_message::length and fix GetDebugMessageLog to add and count the
null terminators, as required by the spec.

v2: return correct total length in GetDebugMessageLog
v3: rebase (drop _mesa_shader_debug hunk).

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
src/mesa/main/errors.c