On 04/19/2014 12:34 AM, Ian Romanick wrote:
On 03/17/2014 01:43 AM, Petri Latvala wrote: + if (queryName) { + strncpy(queryName, group_obj->Name, queryNameLength); + /* No specification given about whether the string needs to be + * zero-terminated. Zero-terminate the string anyway, no way for the + * application to know if the buffer was large enough. + */ Ugh... there's no way to ask the length of the longest name (like you can do with program uniforms)? Bad spec, bad!
There's GL_PERFQUERY_QUERY_NAME_LENGTH_MAX_INTEL etc. for all these string getters, so the comment might be a bit misleading. I'll rewrite it. The intention is to ensure that the written data is always null-terminated, even if the given buffer was too small. strncpy will already write the \0 at the end unless the buffer was too small. glGetActiveUniform() and pals return the length of the actual data written (not to mention explicitly specifying that the string is null-terminated), this API does not.
_______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev