From: Alan Hourihane Date: Fri, 14 Jan 2005 13:10:50 +0000 (+0000) Subject: Get PolygonStipple working.. (or seemingly too). It seems to do the right X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=42cfcce8d44d145b8f01ca9de71813608a7f2be4;p=mesa.git Get PolygonStipple working.. (or seemingly too). It seems to do the right things now given the demos I've used and passes glean's paths test. --- diff --git a/src/mesa/drivers/dri/unichrome/via_context.h b/src/mesa/drivers/dri/unichrome/via_context.h index b8a58cc8df8..a1a86c9139f 100644 --- a/src/mesa/drivers/dri/unichrome/via_context.h +++ b/src/mesa/drivers/dri/unichrome/via_context.h @@ -303,8 +303,6 @@ struct via_context_t { GLuint swap_count; GLuint swap_missed_count; - GLuint stipple[32]; - PFNGLXGETUSTPROC get_ust; }; diff --git a/src/mesa/drivers/dri/unichrome/via_ioctl.c b/src/mesa/drivers/dri/unichrome/via_ioctl.c index 7e7b933becb..e90ec0f78e4 100644 --- a/src/mesa/drivers/dri/unichrome/via_ioctl.c +++ b/src/mesa/drivers/dri/unichrome/via_ioctl.c @@ -542,18 +542,8 @@ static void via_emit_cliprect(viaContextPtr vmesa, vb[4] = ((HC_SubA_HDBBasL << 24) | (offset & 0xFFFFFF)); vb[5] = ((HC_SubA_HDBBasH << 24) | ((offset & 0xFF000000)) >> 24); - /* HSPXYOS seems to be ignored on CLE266, don't emit. This is - * required for hardware stipple conformance (as long as we still - * have drawXoff). - */ - if (vmesa->viaScreen->deviceID == VIA_CLE266) { - vb[6] = HC_DUMMY; - vb[7] = ((HC_SubA_HDBFM << 24) | HC_HDBLoc_Local | format | pitch); - } - else { - vb[6] = ((HC_SubA_HDBFM << 24) | HC_HDBLoc_Local | format | pitch); - vb[7] = ((HC_SubA_HSPXYOS << 24) | ((32 - vmesa->drawXoff) << HC_HSPXOS_SHIFT)); - } + vb[6] = ((HC_SubA_HSPXYOS << 24) | ((31 - vmesa->drawXoff) << HC_HSPXOS_SHIFT)); + vb[7] = ((HC_SubA_HDBFM << 24) | HC_HDBLoc_Local | format | pitch); } diff --git a/src/mesa/drivers/dri/unichrome/via_state.c b/src/mesa/drivers/dri/unichrome/via_state.c index 2227653a032..23a9a8d719a 100644 --- a/src/mesa/drivers/dri/unichrome/via_state.c +++ b/src/mesa/drivers/dri/unichrome/via_state.c @@ -466,7 +466,7 @@ void viaEmitState(viaContextPtr vmesa) } if (ctx->Polygon.StippleFlag) { - GLuint *stipple = &vmesa->stipple[0]; + GLuint *stipple = &ctx->PolygonStipple[0]; BEGIN_RING(38); OUT_RING( HC_HEADER2 ); @@ -505,8 +505,8 @@ void viaEmitState(viaContextPtr vmesa) OUT_RING( stipple[0] ); OUT_RING( HC_HEADER2 ); OUT_RING( (HC_ParaType_NotTex << 16) ); - OUT_RING( ((HC_SubA_HSPXYOS << 24) | (0x20 - (vmesa->driDrawable->h & 0x1F))) ); - OUT_RING( ((HC_SubA_HSPXYOS << 24) | (0x20 - (vmesa->driDrawable->h & 0x1F))) ); + OUT_RING( ((HC_SubA_HSPXYOS << 24) | (((31 - vmesa->drawX) & 0x1f) << HC_HSPXOS_SHIFT))); + OUT_RING( ((HC_SubA_HSPXYOS << 24) | (((31 - vmesa->drawX) & 0x1f) << HC_HSPXOS_SHIFT))); ADVANCE_RING(); } @@ -776,25 +776,6 @@ flip_bytes( GLubyte *p, GLuint n ) } #endif -static void viaPolygonStipple( GLcontext *ctx, const GLubyte *mask ) -{ - viaContextPtr vmesa = VIA_CONTEXT(ctx); - GLubyte *s = (GLubyte *)vmesa->stipple; - int i; - - /* Fallback for the CLE266 case. Stipple works on the CLE266, but - * the stipple x/y offset registers don't seem to be respected, - * meaning that when drawXoff != 0, the stipple is rotated left or - * right by a few pixels, giving incorrect results. - */ - if (vmesa->viaScreen->deviceID == VIA_CLE266) { - FALLBACK( vmesa, VIA_FALLBACK_STIPPLE, ctx->Polygon.StippleFlag); - } else { - for (i=0;i<128;i++) - s[i] = mask[i]; - } -} - void viaInitState(GLcontext *ctx) { viaContextPtr vmesa = VIA_CONTEXT(ctx); @@ -1424,13 +1405,11 @@ static void viaChoosePolygonState(GLcontext *ctx) } } - if (vmesa->viaScreen->deviceID != VIA_CLE266) { - if (ctx->Polygon.StippleFlag) { - vmesa->regEnable |= HC_HenSP_MASK; - } - else { - vmesa->regEnable &= ~HC_HenSP_MASK; - } + if (ctx->Polygon.StippleFlag) { + vmesa->regEnable |= HC_HenSP_MASK; + } + else { + vmesa->regEnable &= ~HC_HenSP_MASK; } if (ctx->Polygon.CullFlag) { @@ -1634,7 +1613,6 @@ void viaInitStateFuncs(GLcontext *ctx) ctx->Driver.DepthRange = viaDepthRange; ctx->Driver.Viewport = viaViewport; ctx->Driver.Enable = viaEnable; - ctx->Driver.PolygonStipple = viaPolygonStipple; /* Pixel path fallbacks. */