r5xx: Detangle FP fallback and translation switches.
authorCorbin Simpson <MostAwesomeDude@gmail.com>
Sun, 15 Jun 2008 00:51:04 +0000 (17:51 -0700)
committerCorbin Simpson <MostAwesomeDude@gmail.com>
Sun, 15 Jun 2008 00:59:10 +0000 (17:59 -0700)
r5xx should fallback if it encounters a bad FP.
TODO: Re-enable the dumb shader so we don't have to completely fallback.

src/mesa/drivers/dri/r300/r500_fragprog.c
src/mesa/drivers/dri/r300/r500_fragprog_emit.c

index 7cf32acd4e2cdc0e516ff6f4143e734ed6e5c9b8..0483c09ba072a1a5a63b7c1436bc85701c9f4098 100644 (file)
@@ -331,20 +331,19 @@ void r500TranslateFragmentShader(r300ContextPtr r300,
                        radeonCompilerDump(&compiler.compiler);
                }
 
-               if (!r500FragmentProgramEmit(&compiler))
-                       fp->error = GL_TRUE;
+               fp->translated = r500FragmentProgramEmit(&compiler);
 
                radeonCompilerCleanup(&compiler.compiler);
 
                r300UpdateStateParameters(r300->radeon.glCtx, _NEW_PROGRAM);
 
-               fp->translated = GL_TRUE;
                if (RADEON_DEBUG & DEBUG_PIXEL) {
                        fprintf(stderr, "Mesa program:\n");
                        fprintf(stderr, "-------------\n");
                        _mesa_print_program(&fp->mesa_program.Base);
                        fflush(stdout);
-                       dump_program(&fp->code);
+                       if (fp->translated)
+                               dump_program(&fp->code);
                }
 
        }
index 3b515515ef14c250753ac048053b4f3abe161b95..59c904865319dc9dc70e800e7c6499671b774cbe 100644 (file)
@@ -1296,7 +1296,7 @@ static GLboolean parse_program(struct r500_pfs_compile_state *cs)
                        fpi = clause->Instructions + ip;
                        counter = do_inst(cs, fpi, counter);
 
-                       if (cs->compiler->fp->error == GL_TRUE)
+                       if (cs->compiler->fp->error)
                                return GL_FALSE;
                }
        }