[Mesa-dev] [PATCH] mesa/main: Add primitive restart support to glArrayElement

Brian Paul brianp at vmware.com
Tue May 1 15:42:03 PDT 2012


On 05/01/2012 10:09 AM, Jordan Justen wrote:
> When primitive restart is enabled, and glArrayElement is called
> with the restart index value, then call glPrimitiveRestartNV.
>
> Signed-off-by: Jordan Justen<jordan.l.justen at intel.com>
> ---
>   src/mesa/main/api_arrayelt.c |   10 +++++++++-
>   1 files changed, 9 insertions(+), 1 deletions(-)
>
> diff --git a/src/mesa/main/api_arrayelt.c b/src/mesa/main/api_arrayelt.c
> index 7bf55f3..6de6de2 100644
> --- a/src/mesa/main/api_arrayelt.c
> +++ b/src/mesa/main/api_arrayelt.c
> @@ -1643,12 +1643,20 @@ void GLAPIENTRY _ae_ArrayElement( GLint elt )
>      const struct _glapi_table * const disp = GET_DISPATCH();
>      GLboolean do_map;
>
> +   /* If PrimitiveRestart is enabled and the index is the RestartIndex
> +    * then we call PrimitiveRestartNV and return.
> +    */
> +   if (ctx->Array.PrimitiveRestart&&  (elt == ctx->Array.RestartIndex)) {
> +      CALL_PrimitiveRestartNV((struct _glapi_table *)disp, ());
> +      return;
> +   }
> +
>      if (actx->NewState) {
>         assert(!actx->mapped_vbos);
>         _ae_update_state( ctx );
>      }
>
> -   /* Determine if w need to map/unmap VBOs */
> +   /* Determine if we need to map/unmap VBOs */
>      do_map = actx->nr_vbos&&  !actx->mapped_vbos;
>
>      if (do_map)


You might add a note to the commit message that this is a candidate 
for the 8.0 / stable branch.


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


More information about the mesa-dev mailing list