[Mesa-dev] [PATCH 1/2] mesa: Track the API used to create a VAO

Brian Paul brianp at vmware.com
Sat Jan 21 07:14:18 PST 2012


On 01/20/2012 07:59 PM, Ian Romanick wrote:
> From: Ian Romanick<ian.d.romanick at intel.com>
>
> There are more differences between Apple and ARB than just the Gen
> requirement.
>
> NOTE: This is a candidate for release branches.
>
> Signed-off-by: Ian Romanick<ian.d.romanick at intel.com>
> ---
>   src/mesa/main/arrayobj.c |    1 +
>   src/mesa/main/mtypes.h   |    5 +++++
>   2 files changed, 6 insertions(+), 0 deletions(-)
>
> diff --git a/src/mesa/main/arrayobj.c b/src/mesa/main/arrayobj.c
> index 3287745..0e74777 100644
> --- a/src/mesa/main/arrayobj.c
> +++ b/src/mesa/main/arrayobj.c
> @@ -372,6 +372,7 @@ bind_vertex_array(struct gl_context *ctx, GLuint id, GLboolean genRequired)
>               _mesa_error(ctx, GL_OUT_OF_MEMORY, "glBindVertexArrayAPPLE");
>               return;
>            }
> +         newObj->arb_semantics = genRequired;
>            save_array_object(ctx, newObj);
>         }
>      }

The existing gl_array_object::VBOonly field is set for array objects 
that are created with the ARB glGenVertexArrays() function.  You're 
setting the new arb_semantics field at bind time.

Do we want to combine those fields into one flag that's set at Gen 
time, not Bind time?

The genRequired param to bind_vertex_array() is/was really just used 
to implement an error check.


> diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
> index 2ff6085..a89d586 100644
> --- a/src/mesa/main/mtypes.h
> +++ b/src/mesa/main/mtypes.h
> @@ -1629,6 +1629,11 @@ struct gl_array_object
>      GLuint _MaxElement;
>
>      struct gl_buffer_object *ElementArrayBufferObj;
> +
> +   /**
> +    * Does this VAO follow the Apple or ARB semantics?
> +    */
> +   GLboolean arb_semantics;
>   };

To be consistent with other field names, this should be capitalized as 
ARBsemantics.

-Brian


More information about the mesa-dev mailing list