From a78bbd0816a894a366bf3824fbbfbc5c794cd61d Mon Sep 17 00:00:00 2001 From: Aapo Tahkola Date: Thu, 17 Mar 2005 21:50:01 +0000 Subject: Simple TCL stage and ability to disable vps. --- src/mesa/drivers/dri/r300/r300_render.c | 49 ++++++++++++++++++++++++++++++++- 1 file changed, 48 insertions(+), 1 deletion(-) (limited to 'src/mesa/drivers/dri/r300/r300_render.c') diff --git a/src/mesa/drivers/dri/r300/r300_render.c b/src/mesa/drivers/dri/r300/r300_render.c index 19377c2d34..b855c81673 100644 --- a/src/mesa/drivers/dri/r300/r300_render.c +++ b/src/mesa/drivers/dri/r300/r300_render.c @@ -672,7 +672,7 @@ static void r300_check_render(GLcontext *ctx, struct tnl_pipeline_stage *stage) stage->active = GL_FALSE; return; } - + /* I'm almost certain I forgot something here */ #if 0 /* These should work now.. */ @@ -731,3 +731,50 @@ const struct tnl_pipeline_stage _r300_render_stage = { r300_check_render, /* check */ r300_run_render /* run */ }; + +static GLboolean r300_run_tcl_render(GLcontext *ctx, + struct tnl_pipeline_stage *stage) +{ + r300ContextPtr rmesa = R300_CONTEXT(ctx); + TNLcontext *tnl = TNL_CONTEXT(ctx); + struct vertex_buffer *VB = &tnl->vb; + GLuint i; + + if (RADEON_DEBUG & DEBUG_PRIMS) + fprintf(stderr, "%s\n", __FUNCTION__); + + return r300_run_vb_render(ctx, stage); +} + +static void r300_check_tcl_render(GLcontext *ctx, struct tnl_pipeline_stage *stage) +{ + r300ContextPtr r300 = R300_CONTEXT(ctx); + int i; + + if (RADEON_DEBUG & DEBUG_STATE) + fprintf(stderr, "%s\n", __FUNCTION__); + + /* We only support rendering in hardware for now */ + if (ctx->RenderMode != GL_RENDER) { + stage->active = GL_FALSE; + return; + } + if((r300->current_vp != NULL) && ctx->VertexProgram._Enabled) { + stage->active = GL_TRUE; + stage->inputs = ctx->VertexProgram.Current->InputsRead; + } else { + stage->active = GL_FALSE; + } +} + +const struct tnl_pipeline_stage _r300_tcl_stage = { + "r300 tcl", + _NEW_ALL, /* re-check (always re-check for now) */ + 0, /* re-run (always runs) */ + GL_TRUE, /* active */ + 0, 0, /* inputs (set in check_render), outputs */ + 0, 0, /* changed_inputs, private */ + dtr, /* destructor */ + r300_check_tcl_render, /* check */ + r300_run_tcl_render /* run */ +}; -- cgit v1.2.3