[Mesa-dev] [PATCH] r600: Flip point sprite coordinates when rendering to an FBO.
Matt Turner
mattst88 at gmail.com
Mon Jul 19 14:13:10 PDT 2010
On Mon, Jul 19, 2010 at 4:50 PM, Henri Verbeet <hverbeet at gmail.com> wrote:
> ---
> src/mesa/drivers/dri/r600/r700_fragprog.c | 4 +++-
> 1 files changed, 3 insertions(+), 1 deletions(-)
>
> diff --git a/src/mesa/drivers/dri/r600/r700_fragprog.c b/src/mesa/drivers/dri/r600/r700_fragprog.c
> index bf17a97..fa01890 100644
> --- a/src/mesa/drivers/dri/r600/r700_fragprog.c
> +++ b/src/mesa/drivers/dri/r600/r700_fragprog.c
> @@ -587,7 +587,9 @@ GLboolean r700SetupFragmentProgram(GLcontext * ctx)
> SETfield(r700->SPI_INTERP_CONTROL_0.u32All, SPI_PNT_SPRITE_SEL_T, PNT_SPRITE_OVRD_Y_shift, PNT_SPRITE_OVRD_Y_mask);
> SETfield(r700->SPI_INTERP_CONTROL_0.u32All, SPI_PNT_SPRITE_SEL_0, PNT_SPRITE_OVRD_Z_shift, PNT_SPRITE_OVRD_Z_mask);
> SETfield(r700->SPI_INTERP_CONTROL_0.u32All, SPI_PNT_SPRITE_SEL_1, PNT_SPRITE_OVRD_W_shift, PNT_SPRITE_OVRD_W_mask);
> - if(ctx->Point.SpriteOrigin == GL_LOWER_LEFT)
> + /* Like e.g. viewport and winding, point sprite coordinates are
> + * inverted when rendering to FBO. */
> + if (ctx->Point.SpriteOrigin == GL_LOWER_LEFT ^ !!ctx->DrawBuffer->Name)
I can't speak to the meaning of this change, but the use of ^ and !!
is just an abuse of the language.
^ is binary XOR. Logical XOR is !=.
Let's write this like
if ((ctx->Point.SpriteOrigin == GL_LOWER_LEFT) !=
(ctx->DrawBuffer->Name != NULL))
Thanks,
Matt
More information about the mesa-dev
mailing list