summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/savage/savagetris.c
diff options
context:
space:
mode:
authorFelix Kuehling <[email protected]>2004-03-24 22:05:25 +0000
committerFelix Kuehling <[email protected]>2004-03-24 22:05:25 +0000
commitadf33a1c6f087075b65f0fbc756839481a38e10d (patch)
tree60bf7d9ccc97916691629c354a7a0d6167c61c62 /src/mesa/drivers/dri/savage/savagetris.c
parent844585be4c392d7e06a8954e56c3756cafa74a39 (diff)
Make sure hardware culling is disabled for unfilled primitives,
points and lines.
Diffstat (limited to 'src/mesa/drivers/dri/savage/savagetris.c')
-rw-r--r--src/mesa/drivers/dri/savage/savagetris.c38
1 files changed, 24 insertions, 14 deletions
diff --git a/src/mesa/drivers/dri/savage/savagetris.c b/src/mesa/drivers/dri/savage/savagetris.c
index c8bd5762ea3..13772df9b3a 100644
--- a/src/mesa/drivers/dri/savage/savagetris.c
+++ b/src/mesa/drivers/dri/savage/savagetris.c
@@ -56,6 +56,21 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
static void savageRasterPrimitive( GLcontext *ctx, GLuint prim );
static void savageRenderPrimitive( GLcontext *ctx, GLenum prim );
+
+
+static GLenum reduced_prim[GL_POLYGON+1] = {
+ GL_POINTS,
+ GL_LINES,
+ GL_LINES,
+ GL_LINES,
+ GL_TRIANGLES,
+ GL_TRIANGLES,
+ GL_TRIANGLES,
+ GL_TRIANGLES,
+ GL_TRIANGLES,
+ GL_TRIANGLES
+};
+
/***********************************************************************
* Emit primitives *
@@ -311,7 +326,8 @@ do { \
* Helpers for rendering unfilled primitives *
***********************************************************************/
-#define RASTERIZE(x)
+#define RASTERIZE(x) if (imesa->raster_primitive != reduced_prim[x]) \
+ savageRasterPrimitive( ctx, x )
#define RENDER_PRIMITIVE imesa->render_primitive
#define IND SAVAGE_FALLBACK_BIT
#define TAG(x) x
@@ -644,19 +660,6 @@ static void savageRunPipeline( GLcontext *ctx )
/* High level hooks for t_vb_render.c */
/**********************************************************************/
-static GLenum reduced_prim[GL_POLYGON+1] = {
- GL_POINTS,
- GL_LINES,
- GL_LINES,
- GL_LINES,
- GL_TRIANGLES,
- GL_TRIANGLES,
- GL_TRIANGLES,
- GL_TRIANGLES,
- GL_TRIANGLES,
- GL_TRIANGLES
-};
-
/* This is called when Mesa switches between rendering triangle
* primitives (such as GL_POLYGON, GL_QUADS, GL_TRIANGLE_STRIP, etc),
* and lines, points and bitmaps.
@@ -670,6 +673,8 @@ static void savageRasterPrimitive( GLcontext *ctx, GLuint prim )
{
savageContextPtr imesa = SAVAGE_CONTEXT( ctx );
+ FLUSH_BATCH(imesa);
+
/* Update culling */
if (imesa->raster_primitive != prim)
imesa->dirty |= SAVAGE_UPLOAD_CTX;
@@ -795,6 +800,11 @@ static void savageRenderFinish( GLcontext *ctx )
/* Release the lock */
savageDDRenderEnd( ctx );
+ /* Flush the last primitive now, before any state is changed.
+ * Alternatively state could be emitted in all state-changing
+ * functions in savagestate.c. */
+ FLUSH_BATCH(SAVAGE_CONTEXT(ctx));
+
if (SAVAGE_CONTEXT(ctx)->RenderIndex & SAVAGE_FALLBACK_BIT)
_swrast_flush( ctx );
}