On Fri, 20 Jan 2012 13:00:10 +0000, Jonathan Coome <jco...@fastmail.co.uk> wrote: > On 19/01/2012 23:48, Yuanhan Liu wrote: > Is there any need for GEN6_SF_POINT_SPRITE_UPPERLEFT? It's basically 0, > so the | operation with dw1 won't have any effect, and you could remove > the else clauses. And if you wanted to clear the bit, I think you'd need > to do something like this instead: > > if ((ctx->Point.SpriteOrigin == GL_LOWER_LEFT) != render_to_fbo) { > dw1 |= GEN6_SF_POINT_SPRITE_LOWERLEFT; > } else { > dw1 &= ~GEN6_SF_POINT_SPRITE_LOWERLEFT; > }
Clearing wasn't the intention, it was just to make it clear what the two values of that bitfield mean. It's a relatively common pattern in driver coding, and you rely on the compiler to not do something silly for dw1 |= 0.
pgpleEMgXLrv1.pgp
Description: PGP signature
_______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev