[Mesa-dev] [PATCH] glsl: count attributes for vertex inputs properly.

Kenneth Graunke kenneth at whitecape.org
Fri Jan 1 13:44:31 PST 2016


On Friday, January 1, 2016 1:42:50 PM PST Kenneth Graunke wrote:
> On Saturday, December 19, 2015 11:32:41 AM PST Dave Airlie wrote:
> > From: Dave Airlie <airlied at redhat.com>
> > 
> > This function deals with vertex inputs and fragment
> > outputs, so we should count the attribute locations
> > correctly for the vertex inputs.
> > 
> > Signed-off-by: Dave Airlie <airlied at redhat.com>
> > ---
> >  src/glsl/linker.cpp | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp
> > index ff22b3d..c7e6976 100644
> > --- a/src/glsl/linker.cpp
> > +++ b/src/glsl/linker.cpp
> > @@ -2466,7 +2466,7 @@ 
assign_attribute_or_color_locations(gl_shader_program 
> *prog,
> >           return false;
> >        }
> >  
> > -      const unsigned slots = var->type->count_attribute_slots(false);
> > +      const unsigned slots = var->type-
>count_attribute_slots(target_index 
> == MESA_SHADER_VERTEX ? true : false);
> >  
> >        /* If the variable is not a built-in and has a location statically
> >         * assigned in the shader (presumably via a layout qualifier), make 
> sure
> > 
> 
> Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
> 

Rather...please change it to:

      const unsigned slots = var->type->count_attribute_slots(target_index == 
MESA_SHADER_VERTEX);

(removing the redundant ? true : false).  Then,

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
-------------- 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: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20160101/2570234f/attachment-0001.sig>


More information about the mesa-dev mailing list