[Mesa-dev] [PATCH] mesa: fix shininess check for ffvertex_prog

Ilia Mirkin imirkin at alum.mit.edu
Mon May 4 12:57:05 PDT 2015


On Mon, May 4, 2015 at 3:57 PM, Tim Rowley <timothy.o.rowley at intel.com> wrote:
> This was working before because it failed into generating the more
> general case lighting equation.
>
> diff --git a/src/mesa/main/ffvertex_prog.c b/src/mesa/main/ffvertex_prog.c
> index 7fdd9ba..cce0636 100644
> --- a/src/mesa/main/ffvertex_prog.c
> +++ b/src/mesa/main/ffvertex_prog.c
> @@ -135,7 +135,7 @@ static GLboolean check_active_shininess( struct gl_context *ctx,
>         (key->light_color_material_mask & (1 << attr)))
>        return GL_TRUE;
>
> -   if (key->varying_vp_inputs & VERT_ATTRIB_GENERIC(attr))
> +   if (key->varying_vp_inputs & (1 << VERT_ATTRIB_GENERIC(attr)))

Unfortunately this would have to be 1ULL. To avoid this whole
situation, why not just use VERT_BIT_GENERIC(attr)?

BTW if it's easy, please add a piglit test (or modify existing one) to
hit this. If it's not easy, then... meh. This is a pretty obvious fix,
since:

src/mesa/main/mtypes.h:   GLbitfield64 varying_vp_inputs;  /**< mask
of VERT_BIT_* flags */


  -ilia

>        return GL_TRUE;
>
>     if (ctx->Light.Material.Attrib[attr][0] != 0.0F)
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list