-#if 1
-
-#if 0
- return r300_run_immediate_render(ctx, stage);
-#else
- return r300_run_vb_render(ctx, stage);
-#endif
-#else
- return GL_TRUE;
-#endif
-
-#if 0
- mgaContextPtr mmesa = MGA_CONTEXT(ctx);
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- struct vertex_buffer *VB = &tnl->vb;
- GLuint i;
-
- /* Don't handle clipping or indexed vertices or vertex manipulations.
- */
- if (mmesa->RenderIndex != 0 ||
- !mga_validate_render( ctx, VB )) {
- return GL_TRUE;
- }
-
- tnl->Driver.Render.Start( ctx );
- mmesa->SetupNewInputs = ~0;
-
- for (i = 0 ; i < VB->PrimitiveCount ; i++)
- {
- GLuint prim = VB->Primitive[i].mode;
- GLuint start = VB->Primitive[i].start;
- GLuint length = VB->Primitive[i].count;
-
- if (!length)
- continue;
-
- mga_render_tab_verts[prim & PRIM_MODE_MASK]( ctx, start, start + length,
- prim);
- }
-
- tnl->Driver.Render.Finish( ctx );
-
- return GL_FALSE; /* finished the pipe */
-#endif
-}
-
-
-/**
- * Called by the pipeline manager once before rendering.
- * We check the GL state here to
- * a) decide whether we can do the current state in hardware and
- * b) update hardware registers
- */
-#define FALLBACK_IF(expr) \
-do { \
- if (expr) { \
- if (1 || RADEON_DEBUG & DEBUG_FALLBACKS) \
- fprintf(stderr, "%s: fallback:%s\n", \
- __FUNCTION__, #expr); \
- stage->active = GL_FALSE; \
- return; \
- } \
-} while(0)
-
-static void r300_check_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;
- }
-
-
- /* I'm almost certain I forgot something here */
-#if 0 /* These should work now.. */
- FALLBACK_IF(ctx->Color.DitherFlag);
- FALLBACK_IF(ctx->Color.AlphaEnabled); // GL_ALPHA_TEST
- FALLBACK_IF(ctx->Color.BlendEnabled); // GL_BLEND
- FALLBACK_IF(ctx->Polygon.OffsetFill); // GL_POLYGON_OFFSET_FILL
-#endif
- //FALLBACK_IF(ctx->Polygon.OffsetPoint); // GL_POLYGON_OFFSET_POINT
- //FALLBACK_IF(ctx->Polygon.OffsetLine); // GL_POLYGON_OFFSET_LINE
- //FALLBACK_IF(ctx->Stencil.Enabled); // GL_STENCIL_TEST
-
- //FALLBACK_IF(ctx->Fog.Enabled); // GL_FOG disable as swtcl doesnt seem to support this
- //FALLBACK_IF(ctx->Polygon.SmoothFlag); // GL_POLYGON_SMOOTH disabling to get blender going
- FALLBACK_IF(ctx->Polygon.StippleFlag); // GL_POLYGON_STIPPLE
- FALLBACK_IF(ctx->Multisample.Enabled); // GL_MULTISAMPLE_ARB
-
-#if 0 /* ut2k3 fails to start if this is on */
- /* One step at a time - let one texture pass.. */
- for (i = 1; i < ctx->Const.MaxTextureUnits; i++)
- FALLBACK_IF(ctx->Texture.Unit[i].Enabled);
-#endif
-
- /* Assumed factor reg is found but pattern is still missing */
- //FALLBACK_IF(ctx->Line.StippleFlag); // GL_LINE_STIPPLE disabling to get blender going
-
- /* HW doesnt appear to directly support these */
- //FALLBACK_IF(ctx->Line.SmoothFlag); // GL_LINE_SMOOTH disabling to get blender going
- FALLBACK_IF(ctx->Point.SmoothFlag); // GL_POINT_SMOOTH
- /* Rest could be done with vertex fragments */
- if (ctx->Extensions.NV_point_sprite || ctx->Extensions.ARB_point_sprite)
- FALLBACK_IF(ctx->Point.PointSprite); // GL_POINT_SPRITE_NV
- //GL_POINT_DISTANCE_ATTENUATION_ARB
- //GL_POINT_FADE_THRESHOLD_SIZE_ARB
-
- /* let r300_run_render do its job */
-#if 0
- stage->active = GL_FALSE;
-#endif