[Mesa-dev] [PATCH] Remove ir_binop_dot optimization from glsl TODO

Matt Turner mattst88 at gmail.com
Mon Jun 4 00:12:05 CEST 2012


On Sun, 2012-06-03 at 14:30 -0700, Kenneth Graunke wrote:
> On 06/03/2012 10:15 AM, Matt Turner wrote:
> > It seems that we already do this.
> > ---
> >  src/glsl/TODO |    3 ---
> >  1 files changed, 0 insertions(+), 3 deletions(-)
> > 
> > diff --git a/src/glsl/TODO b/src/glsl/TODO
> > index eb73fc2..bd077a8 100644
> > --- a/src/glsl/TODO
> > +++ b/src/glsl/TODO
> > @@ -6,9 +6,6 @@
> >    constant index values.  For others it is more complicated.  Perhaps these
> >    cases should be silently converted to uniforms?
> >  
> > -- Implement support for ir_binop_dot in opt_algebraic.cpp.  Perform
> > -  transformations such as "dot(v, vec3(0.0, 1.0, 0.0))" -> v.y.
> > -
> >  - Track source locations throughout the IR.  There are currently several
> >    places where we cannot emit line numbers for errors (and currently emit 0:0)
> >    because we've "lost" the line number information.  This is particularly
> 
> We do?  Considering there's no instance of ir_binop_dot in
> opt_algebraic.cpp, I'm a bit skeptical :)

I could of course be mistaken, but consider the following fragment
shader:

varying vec3 light;
void main() {
	const vec4 DiffuseColor = vec4(0.9, 0.9, 0.9, 1.0);
	float DiffuseTerm = dot(vec3(0.0, 1.0, 0.0), light);
	gl_FragColor = DiffuseColor * DiffuseTerm;
}



More information about the mesa-dev mailing list