[Mesa-dev] [PATCH] vbo: disable primitive restart when GL >= 4.5

Marek Olšák maraeo at gmail.com
Thu Oct 6 14:16:55 UTC 2016


That's funny, because Polaris is our first hardware that supports
primitive restart with DrawArrays (including draw indirect), while
OpenGL removed the support at the same time.

Reviewed-by: Marek Olšák <marek.olsak at amd.com>

Marek

On Thu, Oct 6, 2016 at 3:22 PM, Martina Kollarova
<martina.kollarova at intel.com> wrote:
> The OpenGL 4.5 spec updated the section on primitive restart, and now it
> doesn't have to be performed on drawing commands not taking a parameter,
> regardless of whether PRIMITIVE_RESTART_FIXED_INDEX is enabled or not.
>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98106
> Signed-off-by: Martina Kollarova <martina.kollarova at intel.com>
> ---
>  src/mesa/vbo/vbo_exec_array.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/mesa/vbo/vbo_exec_array.c b/src/mesa/vbo/vbo_exec_array.c
> index 46543f8..cf1ba13 100644
> --- a/src/mesa/vbo/vbo_exec_array.c
> +++ b/src/mesa/vbo/vbo_exec_array.c
> @@ -423,7 +423,7 @@ vbo_draw_arrays(struct gl_context *ctx, GLenum mode, GLint start,
>
>     /* Implement the primitive restart index */
>     if (ctx->Array.PrimitiveRestart && !ctx->Array.PrimitiveRestartFixedIndex &&
> -       ctx->Array.RestartIndex < count) {
> +       ctx->Version < 45 && ctx->Array.RestartIndex < count) {
>        GLuint primCount = 0;
>
>        if (ctx->Array.RestartIndex == start) {
> --
> 1.9.1
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list