summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/radeon/radeon_common.c
diff options
context:
space:
mode:
authorPauli Nieminen <suokkos@gmail.com>2009-08-28 04:58:50 +0300
committerPauli Nieminen <suokkos@gmail.com>2009-08-28 04:58:50 +0300
commitbfbad4fbb7420d3b5e8761c08d197574bfcd44b2 (patch)
treeabf8c758815cae843f02be8d431fe9632e3050d0 /src/mesa/drivers/dri/radeon/radeon_common.c
parente541845959761e9f47d14ade6b58a32db04ef7e4 (diff)
r100/r200: Share PolygonStripple code.
Diffstat (limited to 'src/mesa/drivers/dri/radeon/radeon_common.c')
-rw-r--r--src/mesa/drivers/dri/radeon/radeon_common.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/radeon/radeon_common.c b/src/mesa/drivers/dri/radeon/radeon_common.c
index bed75f3d73..e760279d4a 100644
--- a/src/mesa/drivers/dri/radeon/radeon_common.c
+++ b/src/mesa/drivers/dri/radeon/radeon_common.c
@@ -273,6 +273,31 @@ void radeonScissor(GLcontext* ctx, GLint x, GLint y, GLsizei w, GLsizei h)
}
}
+void radeonPolygonStipple( GLcontext *ctx, const GLubyte *mask )
+{
+ radeonContextPtr radeon = RADEON_CONTEXT(ctx);
+ GLint i;
+ BATCH_LOCALS(radeon);
+
+ radeon_firevertices(radeon);
+
+ BEGIN_BATCH_NO_AUTOSTATE(35);
+
+ OUT_BATCH(CP_PACKET0(RADEON_RE_STIPPLE_ADDR, 0));
+ OUT_BATCH(0x00000000);
+
+ OUT_BATCH(CP_PACKET0_ONE(RADEON_RE_STIPPLE_DATA, 31));
+
+ /* Must flip pattern upside down.
+ */
+ for ( i = 31 ; i >= 0; i--) {
+ OUT_BATCH(((GLuint *) mask)[i]);
+ }
+
+ END_BATCH();
+}
+
+
/* ================================================================
* SwapBuffers with client-side throttling