[Mesa-dev] [PATCH] draw: implement vertex color clamping

Keith Whitwell keithw at vmware.com
Wed Mar 30 06:14:34 PDT 2011


> On Wed, Mar 30, 2011 at 2:45 PM, Keith Whitwell <keithw at vmware.com>
> wrote:
> 
> > > diff --git a/src/gallium/auxiliary/draw/draw_llvm.h
> > b/src/gallium/auxiliary/draw/draw_llvm.h
> > > index e8623e7..643a9ef 100644
> > > --- a/src/gallium/auxiliary/draw/draw_llvm.h
> > > +++ b/src/gallium/auxiliary/draw/draw_llvm.h
> > > @@ -162,6 +162,7 @@ struct draw_llvm_variant_key
> > >  {
> > >     unsigned nr_vertex_elements:8;
> > >     unsigned nr_samplers:8;
> > > +   unsigned clamp_vertex_color:8;
> > >     unsigned clip_xy:1;
> > >     unsigned clip_z:1;
> > >     unsigned clip_user:1;
> >
> > Why are there 8 bits for this?
> >
> > I'd suggest 1 bit is sufficient, and that you should take one bit
> from
> > "pad" to make space for it.
> >
> 
> It seems to be a typo. I have now fixed it, this is the updated part
> of the
> patch:
> 
> diff --git a/src/gallium/auxiliary/draw/draw_llvm.h
> b/src/gallium/auxiliary/draw/draw_llv
> index e8623e7..873a272 100644
> --- a/src/gallium/auxiliary/draw/draw_llvm.h
> +++ b/src/gallium/auxiliary/draw/draw_llvm.h
> @@ -162,6 +162,7 @@ struct draw_llvm_variant_key
>  {
>     unsigned nr_vertex_elements:8;
>     unsigned nr_samplers:8;
> +   unsigned clamp_vertex_color:1;
>     unsigned clip_xy:1;
>     unsigned clip_z:1;
>     unsigned clip_user:1;
> @@ -169,7 +170,7 @@ struct draw_llvm_variant_key
>     unsigned bypass_viewport:1;
>     unsigned need_edgeflags:1;
>     unsigned nr_planes:4;
> -   unsigned pad:6;
> +   unsigned pad:5;
> 
>     /* Variable number of vertex elements:
>      */
> 
> 
> 
> > Otherwise, it looks good to me.
> >
> 
> OK.

Thanks Marek, looks great.

Keith



More information about the mesa-dev mailing list