[Mesa-dev] [PATCH 04/29] r200: convert r200 to use CoordsReplaceBits.
From: Mathias FröhlichSwitch over to use the CoordsReplaceBits bitmask. Reviewed-by: Brian Paul Reviewed-by: Ian Romanick Signed-off-by: Mathias Fröhlich --- src/mesa/drivers/dri/r200/r200_state.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/mesa/drivers/dri/r200/r200_state.c b/src/mesa/drivers/dri/r200/r200_state.c index b4acf98..e2a56d5 100644 --- a/src/mesa/drivers/dri/r200/r200_state.c +++ b/src/mesa/drivers/dri/r200/r200_state.c @@ -1851,11 +1851,8 @@ static void r200Enable( struct gl_context *ctx, GLenum cap, GLboolean state ) case GL_POINT_SPRITE_ARB: R200_STATECHANGE( rmesa, spr ); if ( state ) { -int i; -for (i = 0; i < 6; i++) { - rmesa->hw.spr.cmd[SPR_POINT_SPRITE_CNTL] |= - ctx->Point.CoordReplace[i] << (R200_PS_GEN_TEX_0_SHIFT + i); -} +rmesa->hw.spr.cmd[SPR_POINT_SPRITE_CNTL] |= R200_PS_GEN_TEX_MASK & +(ctx->Point.CoordReplaceBits << R200_PS_GEN_TEX_0_SHIFT); } else { rmesa->hw.spr.cmd[SPR_POINT_SPRITE_CNTL] &= ~R200_PS_GEN_TEX_MASK; } -- 2.5.5 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 04/29] r200: convert r200 to use CoordsReplaceBits.
On 05/23/2016 11:42 PM, mathias.froehl...@gmx.net wrote: > From: Mathias Fröhlich> > Switch over to use the CoordsReplaceBits bitmask. > > Signed-off-by: Mathias Fröhlich > --- > src/mesa/drivers/dri/r200/r200_state.c | 7 ++- > 1 file changed, 2 insertions(+), 5 deletions(-) > > diff --git a/src/mesa/drivers/dri/r200/r200_state.c > b/src/mesa/drivers/dri/r200/r200_state.c > index b4acf98..695d511 100644 > --- a/src/mesa/drivers/dri/r200/r200_state.c > +++ b/src/mesa/drivers/dri/r200/r200_state.c > @@ -1851,11 +1851,8 @@ static void r200Enable( struct gl_context *ctx, GLenum > cap, GLboolean state ) > case GL_POINT_SPRITE_ARB: >R200_STATECHANGE( rmesa, spr ); >if ( state ) { > - int i; > - for (i = 0; i < 6; i++) { > - rmesa->hw.spr.cmd[SPR_POINT_SPRITE_CNTL] |= > - ctx->Point.CoordReplace[i] << (R200_PS_GEN_TEX_0_SHIFT + i); > - } > + GLuint r = (GLuint)ctx->Point.CoordReplaceBits << > R200_PS_GEN_TEX_0_SHIFT; Since this isn't API facing, just use unsigned. > + rmesa->hw.spr.cmd[SPR_POINT_SPRITE_CNTL] |= R200_PS_GEN_TEX_MASK & r; >} else { >rmesa->hw.spr.cmd[SPR_POINT_SPRITE_CNTL] &= ~R200_PS_GEN_TEX_MASK; >} > ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 04/29] r200: convert r200 to use CoordsReplaceBits.
From: Mathias FröhlichSwitch over to use the CoordsReplaceBits bitmask. Signed-off-by: Mathias Fröhlich --- src/mesa/drivers/dri/r200/r200_state.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/mesa/drivers/dri/r200/r200_state.c b/src/mesa/drivers/dri/r200/r200_state.c index b4acf98..695d511 100644 --- a/src/mesa/drivers/dri/r200/r200_state.c +++ b/src/mesa/drivers/dri/r200/r200_state.c @@ -1851,11 +1851,8 @@ static void r200Enable( struct gl_context *ctx, GLenum cap, GLboolean state ) case GL_POINT_SPRITE_ARB: R200_STATECHANGE( rmesa, spr ); if ( state ) { -int i; -for (i = 0; i < 6; i++) { - rmesa->hw.spr.cmd[SPR_POINT_SPRITE_CNTL] |= - ctx->Point.CoordReplace[i] << (R200_PS_GEN_TEX_0_SHIFT + i); -} +GLuint r = (GLuint)ctx->Point.CoordReplaceBits << R200_PS_GEN_TEX_0_SHIFT; +rmesa->hw.spr.cmd[SPR_POINT_SPRITE_CNTL] |= R200_PS_GEN_TEX_MASK & r; } else { rmesa->hw.spr.cmd[SPR_POINT_SPRITE_CNTL] &= ~R200_PS_GEN_TEX_MASK; } -- 2.5.5 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev