[Mesa-dev] [PATCH 1/4] vbo: ignore primitive restart if FixedIndex is enabled in DrawArrays

Kenneth Graunke kenneth at whitecape.org
Sun Jan 4 19:28:37 PST 2015


On Sunday, January 04, 2015 10:44:17 PM Marek Olšák wrote:
> From: Marek Olšák <marek.olsak at amd.com>
> 
> From GL 4.4 Core profile:
> 
>   If both PRIMITIVE_RESTART and PRIMITIVE_RESTART_FIXED_INDEX are
>   enabled, the index value determined by PRIMITIVE_RESTART_FIXED_INDEX is
>   used. If PRIMITIVE_RESTART_FIXED_INDEX is enabled, primitive restart is not
>   performed for array elements transferred by any drawing command not taking a
>   type parameter, including all of the *Draw* commands other than *DrawEle-
>   ments*.
> 
> Cc: 10.2 10.3 10.4 <mesa-stable at lists.freedesktop.org>
> ---
>  src/mesa/vbo/vbo_exec_array.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/src/mesa/vbo/vbo_exec_array.c b/src/mesa/vbo/vbo_exec_array.c
> index 6eac841..95193f2 100644
> --- a/src/mesa/vbo/vbo_exec_array.c
> +++ b/src/mesa/vbo/vbo_exec_array.c
> @@ -596,7 +596,8 @@ vbo_draw_arrays(struct gl_context *ctx, GLenum mode, GLint start,
>     prim[0].is_indirect = 0;
>  
>     /* Implement the primitive restart index */
> -   if (ctx->Array.PrimitiveRestart && ctx->Array.RestartIndex < count) {
> +   if (ctx->Array.PrimitiveRestart && !ctx->Array.PrimitiveRestartFixedIndex &&
> +       ctx->Array.RestartIndex < count) {
>        GLuint primCount = 0;
>  
>        if (ctx->Array.RestartIndex == start) {
> 

Patches 1-2 are:
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20150104/659710f6/attachment-0001.sig>


More information about the mesa-dev mailing list