swrast: fix active attribs with atifragshader
authorMiklós Máté <mtmkls@gmail.com>
Sun, 26 Jun 2016 19:48:00 +0000 (13:48 -0600)
committerBrian Paul <brianp@vmware.com>
Thu, 11 Aug 2016 14:29:23 +0000 (08:29 -0600)
Only include the ones that can be used by the shader.

This fixes texture coordinates, which were completely wrong,
because WPOS was included in the list of attribs. It also
increases performance noticeably.

Signed-off-by: Miklós Máté <mtmkls@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
src/mesa/swrast/s_context.c

index 0a5fc7e9329bb81ee8ae7f17882ed142fa31ff80..a63179c05f302b775474556780f28a77ef1c309e 100644 (file)
@@ -504,7 +504,8 @@ _swrast_update_active_attribs(struct gl_context *ctx)
       attribsMask &= ~VARYING_BIT_POS; /* WPOS is always handled specially */
    }
    else if (ctx->ATIFragmentShader._Enabled) {
-      attribsMask = ~0;  /* XXX fix me */
+      attribsMask = VARYING_BIT_COL0 | VARYING_BIT_COL1 |
+                    VARYING_BIT_FOGC | VARYING_BITS_TEX_ANY;
    }
    else {
       /* fixed function */