[Mesa-dev] [PATCH 03/11] mesa: remove DD_LINE_STIPPLE flag
Eric Anholt
eric at anholt.net
Mon Apr 15 21:49:10 PDT 2013
Brian Paul <brianp at vmware.com> writes:
> For the i915 driver, make it a local macro.
> ---
> src/mesa/drivers/dri/i915/intel_tris.c | 3 ++-
> src/mesa/main/debug.c | 3 +--
> src/mesa/main/enable.c | 1 -
> src/mesa/main/mtypes.h | 1 -
> src/mesa/main/state.c | 8 --------
> 5 files changed, 3 insertions(+), 13 deletions(-)
>
> diff --git a/src/mesa/drivers/dri/i915/intel_tris.c b/src/mesa/drivers/dri/i915/intel_tris.c
> index b97fc98..70afe5f 100644
> --- a/src/mesa/drivers/dri/i915/intel_tris.c
> +++ b/src/mesa/drivers/dri/i915/intel_tris.c
> @@ -944,6 +944,7 @@ intelFastRenderClippedPoly(struct gl_context * ctx, const GLuint * elts, GLuint
>
>
>
> +#define DD_LINE_STIPPLE (1 << 7)
>
> #define ANY_FALLBACK_FLAGS (DD_LINE_STIPPLE | DD_TRI_STIPPLE | DD_POINT_ATTEN)
> #define ANY_RASTER_FLAGS (DD_TRI_LIGHT_TWOSIDE | DD_TRI_OFFSET | DD_TRI_UNFILLED)
> @@ -953,7 +954,7 @@ intelChooseRenderState(struct gl_context * ctx)
> {
> TNLcontext *tnl = TNL_CONTEXT(ctx);
> struct intel_context *intel = intel_context(ctx);
> - GLuint flags = ctx->_TriangleCaps;
> + GLuint flags = ctx->_TriangleCaps | (ctx->Line.StippleFlag << 7);
Could you at least use ?: to explicitly use the DD_LINE_STIPPLE flag
instead of shifting the bool by 7? This awful code doesn't need to get
any more confusing than it already is. Similarly in the following
patches.
-------------- 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/20130415/63fff1dc/attachment.pgp>
More information about the mesa-dev
mailing list