Module: Mesa
Branch: openchrome-branch
Commit: 64f871b15ee3541b515604b7eb23f549c3163657
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=64f871b15ee3541b515604b7eb23f549c3163657

Author: Thomas Hellstrom <thomas-at-shipmail-dot-org>
Date:   Thu Feb 26 10:00:09 2009 +0100

openchrome: Try to make sure line stipple works also in the fast render paths.

---

 src/mesa/drivers/dri/openchrome/via_tris.c |   22 +++++++++++++++-------
 1 files changed, 15 insertions(+), 7 deletions(-)

diff --git a/src/mesa/drivers/dri/openchrome/via_tris.c 
b/src/mesa/drivers/dri/openchrome/via_tris.c
index ada5da9..4749b91 100644
--- a/src/mesa/drivers/dri/openchrome/via_tris.c
+++ b/src/mesa/drivers/dri/openchrome/via_tris.c
@@ -899,6 +899,19 @@ viaRenderFinish(GLcontext * ctx)
     VIA_FINISH_PRIM(VIA_CONTEXT(ctx));
 }
 
+static inline void
+viaCheckResetStipple(struct via_context *vmesa, GLuint *cmdB)
+{
+    if (vmesa->resetStipple) {
+       *cmdB |= HC_HLPrst_MASK;
+       vmesa->regCmdB |= HC_HLPrst_MASK;
+    } else {
+       *cmdB &= ~HC_HLPrst_MASK;
+       vmesa->regCmdB &= ~HC_HLPrst_MASK;
+    }
+    vmesa->resetStipple = GL_FALSE;
+}
+
 /* System to flush dma and emit state changes based on the rasterized
  * primitive.
  */
@@ -919,13 +932,6 @@ viaRasterPrimitive(GLcontext * ctx, GLenum glprim, GLenum 
hwprim)
 
     assert(!vmesa->newState);
 
-    if (vmesa->resetStipple)
-       vmesa->regCmdB |= HC_HLPrst_MASK;
-    else
-       vmesa->regCmdB &= ~HC_HLPrst_MASK;
-
-    vmesa->resetStipple = GL_FALSE;
-
     if (vmesa->firstDrawAfterSwap) {
        LOCK_HARDWARE(vmesa);
        viaValidateDrawablesLocked(vmesa);
@@ -994,6 +1000,7 @@ viaRasterPrimitive(GLcontext * ctx, GLenum glprim, GLenum 
hwprim)
            vmesa->regCmdA_End |= HC_HPMType_Line | HC_HVCycle_Full;
            if (ctx->Light.ShadeModel == GL_FLAT)
                vmesa->regCmdA_End |= HC_HShading_FlatB;
+           viaCheckResetStipple(vmesa, &regCmdB);
            break;
        case GL_LINE_LOOP:
        case GL_LINE_STRIP:
@@ -1002,6 +1009,7 @@ viaRasterPrimitive(GLcontext * ctx, GLenum glprim, GLenum 
hwprim)
            regCmdB |= HC_HVCycle_AB | HC_HVCycle_NewB | HC_HLPrst_MASK;
            if (ctx->Light.ShadeModel == GL_FLAT)
                vmesa->regCmdA_End |= HC_HShading_FlatB;
+           viaCheckResetStipple(vmesa, &regCmdB);
            break;
        case GL_TRIANGLES:
            vmesa->regCmdA_End |= HC_HPMType_Tri | HC_HVCycle_Full;

_______________________________________________
mesa-commit mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to