From e972497310f752994a8b42636a51239d2b9d0c44 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Wed, 29 Dec 2004 14:06:09 +0000 Subject: [PATCH] Make line stipple a fallback. Make sure fallbacks are wrapped by SpanRenderStart/SpanRenderFinish --- src/mesa/drivers/dri/unichrome/via_context.c | 1 - src/mesa/drivers/dri/unichrome/via_span.c | 5 ++--- src/mesa/drivers/dri/unichrome/via_span.h | 2 ++ src/mesa/drivers/dri/unichrome/via_state.c | 16 ++-------------- src/mesa/drivers/dri/unichrome/via_tris.c | 13 ++++++++++--- 5 files changed, 16 insertions(+), 21 deletions(-) diff --git a/src/mesa/drivers/dri/unichrome/via_context.c b/src/mesa/drivers/dri/unichrome/via_context.c index e41aa286f24..ba78477f36e 100644 --- a/src/mesa/drivers/dri/unichrome/via_context.c +++ b/src/mesa/drivers/dri/unichrome/via_context.c @@ -522,7 +522,6 @@ viaCreateContext(const __GLcontextModes *mesaVis, vmesa->glBuffer = NULL; vmesa->texHeap = mmInit(0, viaScreen->textureSize); - vmesa->stippleInHw = 1; vmesa->renderIndex = ~0; make_empty_list(&vmesa->TexObjList); diff --git a/src/mesa/drivers/dri/unichrome/via_span.c b/src/mesa/drivers/dri/unichrome/via_span.c index 8ae62256e7e..9578af3b657 100644 --- a/src/mesa/drivers/dri/unichrome/via_span.c +++ b/src/mesa/drivers/dri/unichrome/via_span.c @@ -251,17 +251,16 @@ static void viaSetBuffer(GLcontext *ctx, GLframebuffer *colorBuffer, /* Move locking out to get reasonable span performance. */ -static void viaSpanRenderStart( GLcontext *ctx ) +void viaSpanRenderStart( GLcontext *ctx ) { viaContextPtr vmesa = VIA_CONTEXT(ctx); VIA_FINISH_PRIM(vmesa); LOCK_HARDWARE(vmesa); viaFlushPrimsLocked(vmesa); WAIT_IDLE(vmesa); - } -static void viaSpanRenderFinish( GLcontext *ctx ) +void viaSpanRenderFinish( GLcontext *ctx ) { viaContextPtr vmesa = VIA_CONTEXT(ctx); _swrast_flush( ctx ); diff --git a/src/mesa/drivers/dri/unichrome/via_span.h b/src/mesa/drivers/dri/unichrome/via_span.h index 6045f2ce7ea..71b3f82c03a 100644 --- a/src/mesa/drivers/dri/unichrome/via_span.h +++ b/src/mesa/drivers/dri/unichrome/via_span.h @@ -26,5 +26,7 @@ #define _VIA_SPAN_H extern void viaInitSpanFuncs(GLcontext *ctx); +extern void viaSpanRenderStart( GLcontext *ctx ); +extern void viaSpanRenderFinish( GLcontext *ctx ); #endif diff --git a/src/mesa/drivers/dri/unichrome/via_state.c b/src/mesa/drivers/dri/unichrome/via_state.c index 92d76dd9b44..e9f0d6682f9 100644 --- a/src/mesa/drivers/dri/unichrome/via_state.c +++ b/src/mesa/drivers/dri/unichrome/via_state.c @@ -163,7 +163,7 @@ static void via_emit_state(viaContextPtr vmesa) ADVANCE_RING(); } - if (ctx->Line.StippleFlag) { + if (0 && ctx->Line.StippleFlag) { BEGIN_RING(2); OUT_RING( ((HC_SubA_HLP << 24) | ctx->Line.StipplePattern) ); OUT_RING( ((HC_SubA_HLPRF << 24) | ctx->Line.StippleFactor) ); @@ -1345,7 +1345,7 @@ static void viaChooseLineState(GLcontext *ctx) } } - if (ctx->Line.StippleFlag) { + if (0 && ctx->Line.StippleFlag) { vmesa->regEnable |= HC_HenLP_MASK; vmesa->regHLP = ctx->Line.StipplePattern; vmesa->regHLPRF = ctx->Line.StippleFactor; @@ -1513,18 +1513,6 @@ void viaValidateState( GLcontext *ctx ) struct gl_texture_unit *texUnit1 = &ctx->Texture.Unit[1]; if (VIA_DEBUG) fprintf(stderr, "%s - in\n", __FUNCTION__); -#if 0 - if (!(vmesa->newState & (_NEW_COLOR | - _NEW_TEXTURE | - _NEW_DEPTH | - _NEW_FOG | - _NEW_LIGHT | - _NEW_LINE | - _NEW_POLYGON | - _NEW_POLYGONSTIPPLE | - _NEW_STENCIL))) - return; -#endif if (texUnit0->_ReallyEnabled || texUnit1->_ReallyEnabled || ctx->Fog.Enabled) { vmesa->regCmdB |= HC_HVPMSK_Cs; diff --git a/src/mesa/drivers/dri/unichrome/via_tris.c b/src/mesa/drivers/dri/unichrome/via_tris.c index 4f9a9647716..b936760dc32 100644 --- a/src/mesa/drivers/dri/unichrome/via_tris.c +++ b/src/mesa/drivers/dri/unichrome/via_tris.c @@ -411,7 +411,9 @@ via_fallback_tri(viaContextPtr vmesa, via_translate_vertex(ctx, v0, &v[0]); via_translate_vertex(ctx, v1, &v[1]); via_translate_vertex(ctx, v2, &v[2]); + viaSpanRenderStart( ctx ); _swrast_Triangle(ctx, &v[0], &v[1], &v[2]); + viaSpanRenderFinish( ctx ); } @@ -424,7 +426,9 @@ via_fallback_line(viaContextPtr vmesa, SWvertex v[2]; via_translate_vertex(ctx, v0, &v[0]); via_translate_vertex(ctx, v1, &v[1]); + viaSpanRenderStart( ctx ); _swrast_Line(ctx, &v[0], &v[1]); + viaSpanRenderFinish( ctx ); } @@ -435,7 +439,9 @@ via_fallback_point(viaContextPtr vmesa, GLcontext *ctx = vmesa->glCtx; SWvertex v[1]; via_translate_vertex(ctx, v0, &v[0]); + viaSpanRenderStart( ctx ); _swrast_Point(ctx, &v[0]); + viaSpanRenderFinish( ctx ); } /**********************************************************************/ @@ -540,10 +546,11 @@ static void viaFastRenderClippedPoly(GLcontext *ctx, const GLuint *elts, _DD_NEW_TRI_STIPPLE | \ _NEW_POLYGONSTIPPLE) +/* Via does support line stipple in hardware, and it is partially + * working in the older versions of this driver: + */ +#define LINE_FALLBACK (DD_LINE_STIPPLE) #define POINT_FALLBACK (0) -/*#define LINE_FALLBACK (DD_LINE_STIPPLE) -*/ -#define LINE_FALLBACK (0) #define TRI_FALLBACK (0) #define ANY_FALLBACK_FLAGS (POINT_FALLBACK|LINE_FALLBACK|TRI_FALLBACK) #define ANY_RASTER_FLAGS (DD_TRI_LIGHT_TWOSIDE|DD_TRI_OFFSET|DD_TRI_UNFILLED) -- 2.30.2