aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/unichrome/via_tris.c
diff options
context:
space:
mode:
authorKeith Whitwell <[email protected]>2004-12-29 21:17:06 +0000
committerKeith Whitwell <[email protected]>2004-12-29 21:17:06 +0000
commit5be14fd59a24612afd09da13688d611a1711d6da (patch)
tree26b559af8815b006de46711d10358a1f8a8176e4 /src/mesa/drivers/dri/unichrome/via_tris.c
parent490e764d7affc093feff80192ed3f3d4642fcb8f (diff)
Fix some wrapping bugs in the last commit. Probably there are more
remaining.
Diffstat (limited to 'src/mesa/drivers/dri/unichrome/via_tris.c')
-rw-r--r--src/mesa/drivers/dri/unichrome/via_tris.c27
1 files changed, 20 insertions, 7 deletions
diff --git a/src/mesa/drivers/dri/unichrome/via_tris.c b/src/mesa/drivers/dri/unichrome/via_tris.c
index 4d2092f3611..862c827300f 100644
--- a/src/mesa/drivers/dri/unichrome/via_tris.c
+++ b/src/mesa/drivers/dri/unichrome/via_tris.c
@@ -40,6 +40,7 @@
#include "via_context.h"
#include "via_tris.h"
#include "via_state.h"
+#include "via_span.h"
#include "via_vb.h"
#include "via_ioctl.h"
@@ -74,7 +75,7 @@ static void __inline__ via_draw_triangle(viaContextPtr vmesa,
viaVertexPtr v2)
{
GLuint vertsize = vmesa->vertexSize;
- GLuint *vb = viaAllocDma(vmesa, 3 * 4 * vertsize);
+ GLuint *vb = viaExtendPrimitive(vmesa, 3 * 4 * vertsize);
/* fprintf(stderr, "%s: %p %p %p\n", __FUNCTION__, v0, v1, v2); */
COPY_DWORDS(vb, vertsize, v0);
COPY_DWORDS(vb, vertsize, v1);
@@ -89,7 +90,7 @@ static void __inline__ via_draw_quad(viaContextPtr vmesa,
viaVertexPtr v3)
{
GLuint vertsize = vmesa->vertexSize;
- GLuint *vb = viaAllocDma(vmesa, 6 * 4 * vertsize);
+ GLuint *vb = viaExtendPrimitive(vmesa, 6 * 4 * vertsize);
/* fprintf(stderr, "%s: %p %p %p %p\n", __FUNCTION__, v0, v1, v2, v3); */
COPY_DWORDS(vb, vertsize, v0);
@@ -105,7 +106,7 @@ static __inline__ void via_draw_line(viaContextPtr vmesa,
viaVertexPtr v1)
{
GLuint vertsize = vmesa->vertexSize;
- GLuint *vb = viaAllocDma(vmesa, 2 * 4 * vertsize);
+ GLuint *vb = viaExtendPrimitive(vmesa, 2 * 4 * vertsize);
COPY_DWORDS(vb, vertsize, v0);
COPY_DWORDS(vb, vertsize, v1);
}
@@ -115,7 +116,7 @@ static __inline__ void via_draw_point(viaContextPtr vmesa,
viaVertexPtr v0)
{
GLuint vertsize = vmesa->vertexSize;
- GLuint *vb = viaAllocDma(vmesa, 4 * vertsize);
+ GLuint *vb = viaExtendPrimitive(vmesa, 4 * vertsize);
COPY_DWORDS(vb, vertsize, v0);
}
@@ -521,7 +522,7 @@ static void viaFastRenderClippedPoly(GLcontext *ctx, const GLuint *elts,
{
viaContextPtr vmesa = VIA_CONTEXT(ctx);
GLuint vertsize = vmesa->vertexSize;
- GLuint *vb = viaAllocDma(vmesa, (n - 2) * 3 * 4 * vertsize);
+ GLuint *vb = viaExtendPrimitive(vmesa, (n - 2) * 3 * 4 * vertsize);
GLubyte *vertptr = (GLubyte *)vmesa->verts;
const GLuint *start = (const GLuint *)V(elts[0]);
int i;
@@ -632,6 +633,8 @@ static void viaRunPipeline(GLcontext *ctx)
viaContextPtr vmesa = VIA_CONTEXT(ctx);
if (vmesa->newState) {
+ viaChooseVertexState(ctx);
+ viaChooseRenderState(ctx);
viaValidateState( ctx );
}
@@ -672,8 +675,14 @@ void viaRasterPrimitive(GLcontext *ctx,
_mesa_lookup_enum_by_nr(hwprim));
VIA_FINISH_PRIM(vmesa);
+
viaCheckDma( vmesa, 1024 ); /* Ensure no wrapping inside this function */
+ if (vmesa->newEmitState) {
+ viaEmitState(vmesa);
+ }
+
+
regCmdB = vmesa->regCmdB;
switch (hwprim) {
@@ -782,12 +791,13 @@ void viaFinishPrimitive(viaContextPtr vmesa)
if (VIA_DEBUG) fprintf(stderr, "%s\n", __FUNCTION__);
if (!vmesa->dmaLastPrim) {
- return;
}
else if (vmesa->dmaLow != vmesa->dmaLastPrim) {
GLuint cmdA = vmesa->regCmdA_End | HC_HPLEND_MASK | HC_HPMValidN_MASK | HC_HE3Fire_MASK;
RING_VARS;
+ vmesa->dmaLastPrim = 0;
+
/* KW: modified 0x1 to 0x4 below:
*/
if ((vmesa->dmaLow & 0x1) || !vmesa->useAgp) {
@@ -801,7 +811,6 @@ void viaFinishPrimitive(viaContextPtr vmesa)
OUT_RING( cmdA );
ADVANCE_RING();
}
- vmesa->dmaLastPrim = 0;
if (vmesa->dmaLow > VIA_DMA_HIGHWATER)
viaFlushDma( vmesa );
@@ -819,6 +828,10 @@ void viaFinishPrimitive(viaContextPtr vmesa)
vmesa->dmaCliprectAddr = 0;
}
}
+
+ vmesa->renderPrimitive = GL_POLYGON + 1;
+ vmesa->hwPrimitive = GL_POLYGON + 1;
+ vmesa->dmaLastPrim = 0;
}