[Mesa-dev] [PATCH] mesa/vbo: Check for invalid types in various packed vertex functions.

Brian Paul brianp at vmware.com
Tue Nov 27 07:34:08 PST 2012


On 11/26/2012 06:14 PM, Kenneth Graunke wrote:
> According to the ARB_vertex_type_2_10_10_10_rev specification:
> "The error INVALID_ENUM is generated by VertexP*, NormalP*,
>   TexCoordP*, MultiTexCoordP*, ColorP*, or SecondaryColorP if<type>
>   is not UNSIGNED_INT_2_10_10_10_REV or INT_2_10_10_10_REV."
>
> Fixes 7 subcases of oglconform's packed-vertex test.
> ---
>   src/mesa/vbo/vbo_attrib_tmp.h | 43 +++++++++++++++++++++++++++++++++++++++++++
>   1 file changed, 43 insertions(+)
>
> diff --git a/src/mesa/vbo/vbo_attrib_tmp.h b/src/mesa/vbo/vbo_attrib_tmp.h
> index 077ca31..6882d85 100644
> --- a/src/mesa/vbo/vbo_attrib_tmp.h
> +++ b/src/mesa/vbo/vbo_attrib_tmp.h
> @@ -799,11 +799,17 @@ TAG(VertexAttrib4fvNV)(GLuint index, const GLfloat * v)
>         ATTR4FV(index, v);
>   }
>
> +#define ERROR_IF_NOT_PACKED_TYPE(ctx, type, func) \
> +   if (type != GL_INT_2_10_10_10_REV&&  type != GL_UNSIGNED_INT_2_10_10_10_REV) { \
> +      _mesa_error(ctx, GL_INVALID_ENUM, "%s(type)", func); \
> +      return; \
> +   }
>
 >   static void GLAPIENTRY
 >   TAG(VertexP2ui)(GLenum type, GLuint value)
 >   {
 >      GET_CURRENT_CONTEXT(ctx);
 > +   ERROR_IF_NOT_PACKED_TYPE(ctx, type, "VertexP2ui");
 >      ATTR_UI(2, type, 0, VBO_ATTRIB_POS, value);
 >   }


Looks like the error messages won't have the "gl" prefix on the 
function name.  Can you fix that?

Otherwise,
Reviewed-by: Brian Paul <brianp at vmware.com>



More information about the mesa-dev mailing list