From cf4ccd5020743591b8d2b29df279c729004ca393 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Michel=20D=C3=A4nzer?= Date: Sat, 3 Feb 2007 17:32:02 +0100 Subject: [PATCH] Fall back to software rasterization if r300_translate_fragment_shader() fails. Aborting immediately is a bad idea with AIGLX. --- src/mesa/drivers/dri/r300/r300_render.c | 10 ++++++++++ src/mesa/drivers/dri/r300/r300_state.c | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/mesa/drivers/dri/r300/r300_render.c b/src/mesa/drivers/dri/r300/r300_render.c index 3d094b9db5d..e29df876962 100644 --- a/src/mesa/drivers/dri/r300/r300_render.c +++ b/src/mesa/drivers/dri/r300/r300_render.c @@ -385,8 +385,18 @@ GLboolean r300_run_vb_render(GLcontext *ctx, int r300Fallback(GLcontext *ctx) { r300ContextPtr r300 = R300_CONTEXT(ctx); + struct r300_fragment_program *rp = + (struct r300_fragment_program *) + (char *)ctx->FragmentProgram._Current; int i; + if (rp) { + if (!rp->translated) + r300_translate_fragment_shader(rp); + + FALLBACK_IF(!rp->translated); + } + /* We do not do SELECT or FEEDBACK (yet ?) * Is it worth doing them ? */ diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c index e06999aa262..a12f3bb5313 100644 --- a/src/mesa/drivers/dri/r300/r300_state.c +++ b/src/mesa/drivers/dri/r300/r300_state.c @@ -1823,7 +1823,7 @@ void r300SetupPixelShader(r300ContextPtr rmesa) r300_translate_fragment_shader(rp); if (!rp->translated) { fprintf(stderr, "%s: No valid fragment shader, exiting\n", __func__); - exit(-1); + return; } #define OUTPUT_FIELD(st, reg, field) \ -- 2.30.2