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

Daniel Scharrer daniel at constexpr.org
Thu Oct 6 14:17:28 UTC 2016


On 2016-10-06 15:22, Martina Kollarova 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) {
> 

Mesa currently sets ctx->Version to the highest version the driver supports for
the selected profile, which may be higher than the GL version requested in
glXCreateContextAttribsARB. I'm afraid that this change could theoretically
break conformant applications written against older OpenGL versions.

Maybe Mesa should limit the context version to the one requested by the
application. The blob drivers seem to do this (at least the AMD one) and the
current behaviour has already caused problems before:
 https://bugs.freedesktop.org/show_bug.cgi?id=95374

--
Daniel Scharrer
http://constexpr.org/


More information about the mesa-dev mailing list