summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri
diff options
context:
space:
mode:
authorAapo Tahkola <aet@rasterburn.org>2005-11-01 16:59:13 +0000
committerAapo Tahkola <aet@rasterburn.org>2005-11-01 16:59:13 +0000
commit6aa6d440d9d312cb984020e746aa80c3dbf6ea2c (patch)
treec1893fb63278d7a8010ed421dc378b538071c942 /src/mesa/drivers/dri
parente7d6bb9dc41433803bcaad671ea2cf3bf628e0be (diff)
Re-enable fallbacks.
Diffstat (limited to 'src/mesa/drivers/dri')
-rw-r--r--src/mesa/drivers/dri/r300/r300_context.h1
-rw-r--r--src/mesa/drivers/dri/r300/r300_render.c107
-rw-r--r--src/mesa/drivers/dri/r300/r300_state.c4
-rw-r--r--src/mesa/drivers/dri/r300/radeon_vtxfmt_a.c6
4 files changed, 40 insertions, 78 deletions
diff --git a/src/mesa/drivers/dri/r300/r300_context.h b/src/mesa/drivers/dri/r300/r300_context.h
index c03dd03daf..ac4bf86afd 100644
--- a/src/mesa/drivers/dri/r300/r300_context.h
+++ b/src/mesa/drivers/dri/r300/r300_context.h
@@ -876,6 +876,7 @@ extern GLboolean r300CreateContext(const __GLcontextModes * glVisual,
void translate_vertex_shader(struct r300_vertex_program *vp);
extern void r300InitShaderFuncs(struct dd_function_table *functions);
extern int r300VertexProgUpdateParams(GLcontext *ctx, struct r300_vertex_program *vp, float *dst);
+extern GLboolean r300Fallback(GLcontext *ctx);
#ifdef RADEON_VTXFMT_A
extern void radeon_init_vtxfmt_a(r300ContextPtr rmesa);
diff --git a/src/mesa/drivers/dri/r300/r300_render.c b/src/mesa/drivers/dri/r300/r300_render.c
index 98ddd82106..5e7ce544d4 100644
--- a/src/mesa/drivers/dri/r300/r300_render.c
+++ b/src/mesa/drivers/dri/r300/r300_render.c
@@ -770,65 +770,28 @@ void dump_dt(struct dt *dt, int count)
}
#endif
-/**
- * Called by the pipeline manager to render a batch of primitives.
- * We can return true to pass on to the next stage (i.e. software
- * rasterization) or false to indicate that the pipeline has finished
- * after we render something.
- */
-static GLboolean r300_run_render(GLcontext *ctx,
- struct tnl_pipeline_stage *stage)
-{
-
- if (RADEON_DEBUG & DEBUG_PRIMS)
- fprintf(stderr, "%s\n", __FUNCTION__);
-
-#if 0
- return r300_run_immediate_render(ctx, stage);
-#else
- return r300_run_vb_render(ctx, stage);
-#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) \
WARN_ONCE("fallback:%s\n", #expr); \
- /*stage->active = GL_FALSE*/; \
- return; \
+ return GL_TRUE; \
} \
} while(0)
-static void r300_check_render(GLcontext *ctx, struct tnl_pipeline_stage *stage)
+GLboolean r300Fallback(GLcontext *ctx)
{
- 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 */
+ FALLBACK_IF(ctx->RenderMode != GL_RENDER); // We do not do SELECT or FEEDBACK (yet ?)
+
#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->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
@@ -836,51 +799,47 @@ static void r300_check_render(GLcontext *ctx, struct tnl_pipeline_stage *stage)
FALLBACK_IF(ctx->Polygon.StippleFlag); // GL_POLYGON_STIPPLE
FALLBACK_IF(ctx->Multisample.Enabled); // GL_MULTISAMPLE_ARB
- FALLBACK_IF(ctx->RenderMode != GL_RENDER); // We do not do SELECT or FEEDBACK (yet ?)
-
-#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
+ FALLBACK_IF(ctx->Line.StippleFlag);
/* HW doesnt appear to directly support these */
- //FALLBACK_IF(ctx->Line.SmoothFlag); // GL_LINE_SMOOTH disabling to get blender going
+ FALLBACK_IF(ctx->Line.SmoothFlag); // GL_LINE_SMOOTH
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
+ return GL_FALSE;
}
-
-static void dtr(struct tnl_pipeline_stage *stage)
+/**
+ * Called by the pipeline manager to render a batch of primitives.
+ * We can return true to pass on to the next stage (i.e. software
+ * rasterization) or false to indicate that the pipeline has finished
+ * after we render something.
+ */
+static GLboolean r300_run_render(GLcontext *ctx,
+ struct tnl_pipeline_stage *stage)
{
- (void)stage;
-}
-static GLboolean r300_create_render(GLcontext *ctx,
- struct tnl_pipeline_stage *stage)
-{
- return GL_TRUE;
-}
+ if (RADEON_DEBUG & DEBUG_PRIMS)
+ fprintf(stderr, "%s\n", __FUNCTION__);
+ if (r300Fallback(ctx))
+ return GL_TRUE;
+#if 0
+ return r300_run_immediate_render(ctx, stage);
+#else
+ return r300_run_vb_render(ctx, stage);
+#endif
+}
const struct tnl_pipeline_stage _r300_render_stage = {
"r300 hw rasterize",
NULL,
- r300_create_render,
- dtr, /* destructor */
- r300_check_render, /* check */
+ NULL,
+ NULL,
+ NULL,
r300_run_render /* run */
};
@@ -918,8 +877,8 @@ static void r300_check_tcl_render(GLcontext *ctx, struct tnl_pipeline_stage *sta
const struct tnl_pipeline_stage _r300_tcl_stage = {
"r300 tcl",
NULL,
- r300_create_render,
- dtr, /* destructor */
- r300_check_tcl_render, /* check */
+ NULL,
+ NULL,
+ NULL,
r300_run_tcl_render /* run */
};
diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c
index 343acc426a..913602668c 100644
--- a/src/mesa/drivers/dri/r300/r300_state.c
+++ b/src/mesa/drivers/dri/r300/r300_state.c
@@ -2261,9 +2261,7 @@ static void r300RenderMode( GLcontext *ctx, GLenum mode )
{
r300ContextPtr rmesa = R300_CONTEXT(ctx);
(void)rmesa;
- WARN_ONCE("TODO: fallback properly when rendering mode is not GL_RENDER\n"
- "\tThe way things are now neither selection nor feedback modes work\n")
-// FALLBACK( rmesa, R300_FALLBACK_RENDER_MODE, (mode != GL_RENDER) );
+ (void)mode;
}
/**
diff --git a/src/mesa/drivers/dri/r300/radeon_vtxfmt_a.c b/src/mesa/drivers/dri/r300/radeon_vtxfmt_a.c
index 34fe0952fe..628b89f3d5 100644
--- a/src/mesa/drivers/dri/r300/radeon_vtxfmt_a.c
+++ b/src/mesa/drivers/dri/r300/radeon_vtxfmt_a.c
@@ -18,7 +18,11 @@ static int setup_arrays(r300ContextPtr rmesa, GLint start)
GLcontext *ctx;
GLuint enabled = 0;
- ctx = rmesa->radeon.glCtx;
+ ctx = rmesa->radeon.glCtx;
+ if (r300Fallback(ctx)) {
+ WARN_ONCE("No fallbacks in vtxftm_a yet.\n");
+ //return -1;
+ }
memset(rmesa->state.VB.AttribPtr, 0, VERT_ATTRIB_MAX*sizeof(struct dt));