X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Fmesa%2Fdrivers%2Fdri%2Fi810%2Fi810render.c;h=45f0954bbe26369b158ae5e5ba06953b27c47159;hb=689aca782216d2666486dea02206cbc9c4162e0d;hp=d1c1adc3b7cae62ad41c8470423a44ee5d245a22;hpb=57c9814b9e87924696df4c741861c29d4236d1eb;p=mesa.git diff --git a/src/mesa/drivers/dri/i810/i810render.c b/src/mesa/drivers/dri/i810/i810render.c index d1c1adc3b7c..45f0954bbe2 100644 --- a/src/mesa/drivers/dri/i810/i810render.c +++ b/src/mesa/drivers/dri/i810/i810render.c @@ -31,11 +31,13 @@ * dma buffers. Use strip/fan hardware acceleration where possible. * */ -#include "glheader.h" -#include "context.h" -#include "macros.h" -#include "imports.h" -#include "mtypes.h" +#include "main/glheader.h" +#include "main/context.h" +#include "main/macros.h" +#include "main/imports.h" +#include "main/mtypes.h" + +#include "math/m_xform.h" #include "tnl/t_context.h" @@ -44,7 +46,6 @@ #include "i810context.h" #include "i810tris.h" -#include "i810state.h" #include "i810vb.h" #include "i810ioctl.h" @@ -93,20 +94,6 @@ static const GLenum reduced_prim[GL_POLYGON+1] = { GL_TRIANGLES }; -/* Fallback to normal rendering. - */ -static void VERT_FALLBACK( GLcontext *ctx, - GLuint start, - GLuint count, - GLuint flags ) -{ - TNLcontext *tnl = TNL_CONTEXT(ctx); - tnl->Driver.Render.PrimitiveNotify( ctx, flags & PRIM_MODE_MASK ); - tnl->Driver.Render.BuildVertices( ctx, start, count, ~0 ); - tnl->Driver.Render.PrimTabVerts[flags&PRIM_MODE_MASK]( ctx, start, - count, flags ); - I810_CONTEXT(ctx)->SetupNewInputs = VERT_BIT_POS; -} @@ -115,16 +102,17 @@ static void VERT_FALLBACK( GLcontext *ctx, I810_STATECHANGE(imesa, 0); \ i810RasterPrimitive( ctx, reduced_prim[prim], hw_prim[prim] ); \ } while (0) -#define NEW_PRIMITIVE() I810_STATECHANGE( imesa, 0 ) -#define NEW_BUFFER() I810_FIREVERTICES( imesa ) #define GET_CURRENT_VB_MAX_VERTS() \ (((int)imesa->vertex_high - (int)imesa->vertex_low) / (imesa->vertex_size*4)) #define GET_SUBSEQUENT_VB_MAX_VERTS() \ (I810_DMA_BUF_SZ-4) / (imesa->vertex_size * 4) +#define ALLOC_VERTS( nr ) \ + i810AllocDmaLow( imesa, (nr) * imesa->vertex_size * 4) +#define EMIT_VERTS( ctx, j, nr, buf ) \ + i810_emit_contiguous_verts(ctx, j, (j)+(nr), buf) -#define EMIT_VERTS( ctx, j, nr ) \ - i810_emit_contiguous_verts(ctx, j, (j)+(nr)) +#define FLUSH() I810_FIREVERTICES( imesa ) #define TAG(x) i810_##x @@ -136,7 +124,7 @@ static void VERT_FALLBACK( GLcontext *ctx, /**********************************************************************/ -static GLboolean i810_run_render( GLcontext *ctx, +static GLboolean i810_run_render( struct gl_context *ctx, struct tnl_pipeline_stage *stage ) { i810ContextPtr imesa = I810_CONTEXT(ctx); @@ -146,7 +134,8 @@ static GLboolean i810_run_render( GLcontext *ctx, /* Don't handle clipping or indexed vertices. */ - if (VB->ClipOrMask || imesa->RenderIndex != 0 || VB->Elts) { + if (imesa->RenderIndex != 0 || + !i810_validate_render( ctx, VB )) { return GL_TRUE; } @@ -156,7 +145,7 @@ static GLboolean i810_run_render( GLcontext *ctx, for (i = 0 ; i < VB->PrimitiveCount ; i++) { - GLuint prim = VB->Primitive[i].mode; + GLuint prim = _tnl_translate_prim(&VB->Primitive[i]); GLuint start = VB->Primitive[i].start; GLuint length = VB->Primitive[i].count; @@ -173,46 +162,13 @@ static GLboolean i810_run_render( GLcontext *ctx, } -static void i810_check_render( GLcontext *ctx, struct tnl_pipeline_stage *stage ) -{ - GLuint inputs = VERT_BIT_POS | VERT_BIT_COLOR0; - - if (ctx->RenderMode == GL_RENDER) { - if (ctx->_TriangleCaps & DD_SEPARATE_SPECULAR) - inputs |= VERT_BIT_COLOR1; - - if (ctx->Texture.Unit[0]._ReallyEnabled) - inputs |= VERT_BIT_TEX0; - - if (ctx->Texture.Unit[1]._ReallyEnabled) - inputs |= VERT_BIT_TEX1; - - if (ctx->Fog.Enabled) - inputs |= VERT_BIT_FOG; - } - - stage->inputs = inputs; -} - - -static void dtr( struct tnl_pipeline_stage *stage ) -{ - (void)stage; -} - const struct tnl_pipeline_stage _i810_render_stage = { "i810 render", - (_DD_NEW_SEPARATE_SPECULAR | - _NEW_TEXTURE| - _NEW_FOG| - _NEW_RENDERMODE), /* re-check (new inputs) */ - 0, /* re-run (always runs) */ - GL_TRUE, /* active */ - 0, 0, /* inputs (set in check_render), outputs */ - 0, 0, /* changed_inputs, private */ - dtr, /* destructor */ - i810_check_render, /* check - initially set to alloc data */ + NULL, + NULL, + NULL, + NULL, i810_run_render /* run */ };