Fall back to software rasterization if r300_translate_fragment_shader() fails.
authorMichel Dänzer <michel@tungstengraphics.com>
Sat, 3 Feb 2007 16:32:02 +0000 (17:32 +0100)
committerMichel Dänzer <michel@tungstengraphics.com>
Sat, 3 Feb 2007 16:32:02 +0000 (17:32 +0100)
Aborting immediately is a bad idea with AIGLX.

src/mesa/drivers/dri/r300/r300_render.c
src/mesa/drivers/dri/r300/r300_state.c

index 3d094b9db5d5f3f209cf4f2b86c509cc42971f17..e29df8769624e91cb393662bd6dbf251a7411895 100644 (file)
@@ -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 ?
         */
index e06999aa262d1a8685805d3992bb627a80c769ca..a12f3bb531342be88fb955e2597620736f6594a7 100644 (file)
@@ -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)  \