[Mesa-dev] [PATCH] mesa: expand the fragprog_inputs_read bitfield in ffvertex_prog.c

Kenneth Graunke kenneth at whitecape.org
Wed Nov 7 09:19:54 PST 2012


On 11/07/2012 07:33 AM, Brian Paul wrote:
> The glean glsl1 test was failing an assertion because FRAG_ATTRIB_FACE
> (and FRAG_ATTRIB_PNTC) doesn't fit in a 12-bit field.
>
> In the failing case we're using a fragment shader with fixed-function
> vertex processing.
> ---
>   src/mesa/main/ffvertex_prog.c |    6 +++---
>   1 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/src/mesa/main/ffvertex_prog.c b/src/mesa/main/ffvertex_prog.c
> index 4cdec21..1b4f653 100644
> --- a/src/mesa/main/ffvertex_prog.c
> +++ b/src/mesa/main/ffvertex_prog.c
> @@ -66,7 +66,7 @@ struct state_key {
>      unsigned point_attenuated:1;
>      unsigned point_array:1;
>      unsigned texture_enabled_global:1;
> -   unsigned fragprog_inputs_read:12;
> +   unsigned fragprog_inputs_read:14;
>
>      GLbitfield64 varying_vp_inputs;
>
> @@ -160,8 +160,8 @@ static void make_state_key( struct gl_context *ctx, struct state_key *key )
>
>      key->need_eye_coords = ctx->_NeedEyeCoords;
>
> -   /* Make sure fp->Base.InputsRead fits in a 12-bit field */
> -   assert(fp->Base.InputsRead < (1 << 12));
> +   /* Make sure fp->Base.InputsRead fits in a 14-bit field */
> +   assert(fp->Base.InputsRead < (1 << 14));
>      key->fragprog_inputs_read = fp->Base.InputsRead;
>      key->varying_vp_inputs = ctx->varying_vp_inputs;

Ouch.  Yeah, this is definitely needed.
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>

I guess we don't need to worry about FRAG_ATTRIB_CLIP_DIST0/1 or 
FRAG_ATTRIB_VAR* since those would need to be written by a vertex 
shader.  So this looks good.


More information about the mesa-dev mailing list