Make sure hardware culling is disabled for unfilled primitives,

points and lines.
This commit is contained in:
Felix Kuehling 2004-03-24 22:05:25 +00:00
parent 844585be4c
commit adf33a1c6f
3 changed files with 29 additions and 15 deletions

View File

@ -412,6 +412,10 @@ void savageFlushVerticesLocked( savageContextPtr imesa )
* in savagedma.c that emits drawing commands. Cliprects are not handled
* yet. */
if (buffer->used) {
/* State must be updated "per primitive" because hardware
* culling must be disabled for unfilled primitives, points
* and lines. */
savageEmitHwStateLocked (imesa);
savageFakeVertices (imesa, buffer);
}
}

View File

@ -1584,6 +1584,7 @@ void savageEmitHwStateLocked( savageContextPtr imesa )
if (imesa->dirty & ~SAVAGE_UPLOAD_CLIPRECTS)
{
savageUpdateCull(imesa->glCtx);
if (imesa->dirty & (SAVAGE_UPLOAD_CTX | SAVAGE_UPLOAD_TEX0 | \
SAVAGE_UPLOAD_TEX1 | SAVAGE_UPLOAD_BUFFERS))
{
@ -1832,7 +1833,6 @@ void savageDDRenderStart(GLcontext *ctx)
/* set scissor to the first clip box*/
savageDDScissor(ctx,pbox->x1,pbox->y1,pbox->x2,pbox->y2);
savageUpdateCull(ctx);
savageDDUpdateHwState(ctx); /* update to hardware register*/
}
else /* need not render at all*/

View File

@ -57,6 +57,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 );
}