[Mesa-dev] [PATCH] i965: Ignore glPointSize when GL_POINT_SIZE_ARRAY_OES is enabled

Kenneth Graunke kenneth at whitecape.org
Sat Mar 12 06:16:17 UTC 2016


On Wednesday, March 2, 2016 10:58:46 AM PST Plamena Manolova wrote:
> When a user defines a point size array and enables it, the point
> size value set via glPointSize should be ignored. To achieve this,
> we can simply set ctx->VertexProgram.PointSizeEnabled whenever
> GL_POINT_SIZE_ARRAY_OES is set so that the right point size is
> used.
> 
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=42187
> Signed-off-by: Plamena Manolova <plamena.manolova at intel.com>

This looks good!  A couple of small things...

The subject prefix should be "mesa: ..." now that it's changing
mesa/main/enable.c, rather than "i965: ...".

> ---
>  src/mesa/main/enable.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c
> index 3985457..ecc04f4 100644
> --- a/src/mesa/main/enable.c
> +++ b/src/mesa/main/enable.c
> @@ -105,6 +105,7 @@ client_state(struct gl_context *ctx, GLenum cap, 
GLboolean state)
>        case GL_POINT_SIZE_ARRAY_OES:
>           var = &vao->VertexAttrib[VERT_ATTRIB_POINT_SIZE].Enabled;
>           flag = VERT_BIT_POINT_SIZE;

I believe we should add

         FLUSH_VERTICES(ctx, _NEW_PROGRAM);

here before setting the new state.  That signals the _NEW_PROGRAM
dirty state flag, which causes drivers to re-emit the relevant state.
It looks like this function signals _NEW_ARRAY already...but the i965
SF state atoms don't listen to _NEW_ARRAY.  Without that, we might
fail to re-emit the hardware state when this changes.

The other place that sets ctx->VertexProgram.PointSizeEnabled signals
_NEW_PROGRAM, so it seems best to keep it consistent and signal
_NEW_PROGRAM here too.

> +         ctx->VertexProgram.PointSizeEnabled = state;
>           break;
>  
>        /* GL_NV_primitive_restart */
> 

With both of those changes, this would get:

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>

If you could send an updated patch, I'll be happy to commit it for you.
Thanks again!
-------------- 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: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20160311/032f7757/attachment.sig>


More information about the mesa-dev mailing list