[Mesa-dev] [PATCH] drivers/common/meta: Disable GL_PRIMITIVE_RESTART in glBlitFramebuffer

Sudnik, Andrey andrey.sudnik at intel.com
Tue Nov 8 05:16:53 UTC 2016


Matt,
The actual problem is the following. There is a VM with 3Dmark03 benchmark running in VMware Workstation. It renders corrupted image while benchmark is loading. The issue is reproducible with Mesa 12, I haven't checked it with Mesa 13.
I've attached simple reproducer that is based on apitrace's file captured from the VM.
Actually there is no bug for the issue.

Sorry for the message below, it is added automatically.

Andrey

-----Original Message-----
From: Matt Turner [mailto:mattst88 at gmail.com] 
Sent: Friday, November 4, 2016 10:44 AM
To: Sudnik, Andrey <andrey.sudnik at intel.com>
Cc: mesa-dev at lists.freedesktop.org
Subject: Re: [Mesa-dev] [PATCH] drivers/common/meta: Disable GL_PRIMITIVE_RESTART in glBlitFramebuffer

On Wed, Nov 2, 2016 at 5:16 AM, Andrey Sudnik <andrey.sudnik at intel.com> wrote:
> glTexSubImage2D works incorrectly in i965 when GL_PIXEL_UNPACK_BUFFER 
> is set and GL_PRIMITIVE_RESTART is enabled.
> The patch fixes this issue.

Thanks for the patch!

Probably need more information about what the actual problem is. Looks like something about meta not saving and restoring primitive restart?

Is there a bug filed, or a piglit test that exercises this?

>
> Signed-off-by: Andrey Sudnik <andrey.sudnik at intel.com>
> ---
>  src/mesa/drivers/common/meta.c      | 12 ++++++++++++
>  src/mesa/drivers/common/meta.h      |  6 ++++++
>  src/mesa/drivers/common/meta_blit.c |  3 +++
>  3 files changed, 21 insertions(+)
>
> diff --git a/src/mesa/drivers/common/meta.c 
> b/src/mesa/drivers/common/meta.c index 6dcbc8b..f48e943 100644
> --- a/src/mesa/drivers/common/meta.c
> +++ b/src/mesa/drivers/common/meta.c
> @@ -789,6 +789,12 @@ _mesa_meta_begin(struct gl_context *ctx, GLbitfield state)
>               sizeof(save->ColorDrawBuffers));
>     }
>
> +   if (state & MESA_META_PRIMITIVE_RESTART){

Missing a space between ) and {

> +       save->PrimitiveRestart = ctx->Array.PrimitiveRestart;
> +       save->PrimitiveRestartFixedIndex = ctx->Array.PrimitiveRestartFixedIndex;
> +       save->RestartIndex = ctx->Array.RestartIndex;
> +   }
> +
>     /* misc */
>     {
>        save->Lighting = ctx->Light.Enabled; @@ -1175,6 +1181,12 @@ 
> _mesa_meta_end(struct gl_context *ctx)
>           _mesa_set_framebuffer_srgb(ctx, save->sRGBEnabled);
>     }
>
> +   if ( state & MESA_META_PRIMITIVE_RESTART) {

Stray space after (

> +       ctx->Array.PrimitiveRestart = save->PrimitiveRestart;
> +       ctx->Array.PrimitiveRestartFixedIndex = save->PrimitiveRestartFixedIndex;
> +       ctx->Array.RestartIndex = save->RestartIndex;
> +   }
> +
>     /* misc */
>     if (save->Lighting) {
>        _mesa_set_enable(ctx, GL_LIGHTING, GL_TRUE); diff --git 
> a/src/mesa/drivers/common/meta.h b/src/mesa/drivers/common/meta.h 
> index 0a7321c..9ba2850 100644
> --- a/src/mesa/drivers/common/meta.h
> +++ b/src/mesa/drivers/common/meta.h
> @@ -60,6 +60,7 @@
>  #define MESA_META_OCCLUSION_QUERY      0x400000
>  #define MESA_META_DRAW_BUFFERS         0x800000
>  #define MESA_META_DITHER              0x1000000
> +#define MESA_META_PRIMITIVE_RESTART   0x2000000
>  /**\}*/
>
>  /**
> @@ -191,6 +192,11 @@ struct save_state
>
>     /** MESA_META_DRAW_BUFFERS */
>     GLenum ColorDrawBuffers[MAX_DRAW_BUFFERS];
> +
> +   /** MESA GL_PRIMITIVE_RESTART */
> +   GLboolean PrimitiveRestart;
> +   GLboolean PrimitiveRestartFixedIndex;
> +   GLuint RestartIndex;
>  };
>
>  /**
> diff --git a/src/mesa/drivers/common/meta_blit.c 
> b/src/mesa/drivers/common/meta_blit.c
> index 20d3215..d13d844 100644
> --- a/src/mesa/drivers/common/meta_blit.c
> +++ b/src/mesa/drivers/common/meta_blit.c
> @@ -1020,6 +1020,9 @@ _mesa_meta_BlitFramebuffer(struct gl_context *ctx,
>     /* Dithering shouldn't be performed for glBlitFramebuffer */
>     _mesa_set_enable(ctx, GL_DITHER, GL_FALSE);
>
> +   /* Disable Primitive Restart */
> +   _mesa_set_enable(ctx, GL_PRIMITIVE_RESTART, GL_FALSE);
> +
>     /* If the clipping earlier changed the destination rect at all, then
>      * enable the scissor to clip to it.
>      */
> --
> 2.7.4
>
>
> --------------------------------------------------------------------
> Joint Stock Company Intel A/O
> Registered legal address: Krylatsky Hills Business Park,
> 17 Krylatskaya Str., Bldg 4, Moscow 121614, Russian Federation
>
> This e-mail and any attachments may contain confidential material for 
> the sole use of the intended recipient(s). Any review or distribution 
> by others is strictly prohibited. If you are not the intended 
> recipient, please contact the sender and delete all copies.

Please remove this from future mail sent to mesa-dev. It's a publicly archived mailing list after all...

--------------------------------------------------------------------
Joint Stock Company Intel A/O
Registered legal address: Krylatsky Hills Business Park,
17 Krylatskaya Str., Bldg 4, Moscow 121614,
Russian Federation

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gltexsubimage_repro.zip
Type: application/x-zip-compressed
Size: 171123 bytes
Desc: gltexsubimage_repro.zip
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20161108/bcea8f02/attachment-0001.bin>


More information about the mesa-dev mailing list