[Mesa-dev] [PATCH] i965: fix inverted point sprite origin when rendering to FBO

Eric Anholt eric at anholt.net
Fri Jan 20 11:43:05 PST 2012


On Fri, 20 Jan 2012 13:00:10 +0000, Jonathan Coome <jcoome at 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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20120120/f6c102fc/attachment.pgp>


More information about the mesa-dev mailing list