summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r300/r300_fs.c
diff options
context:
space:
mode:
authorNicolai Hähnle <[email protected]>2009-10-03 19:20:31 +0200
committerNicolai Hähnle <[email protected]>2009-10-03 19:29:48 +0200
commit81e5188f66248424d54fcf1d85a81510694bd472 (patch)
tree7ae351cee131c9f4404f34a64d8be9d3449124b4 /src/gallium/drivers/r300/r300_fs.c
parent59b20b760d63dad15d4d62a43bae8b7e26085c79 (diff)
r300g: Do not abort on fragment program compiler error
Signed-off-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/gallium/drivers/r300/r300_fs.c')
-rw-r--r--src/gallium/drivers/r300/r300_fs.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/gallium/drivers/r300/r300_fs.c b/src/gallium/drivers/r300/r300_fs.c
index a0e848a59ac..546ad545a53 100644
--- a/src/gallium/drivers/r300/r300_fs.c
+++ b/src/gallium/drivers/r300/r300_fs.c
@@ -126,9 +126,14 @@ void r300_translate_fragment_shader(struct r300_context* r300,
/* Invoke the compiler */
r3xx_compile_fragment_program(&compiler);
if (compiler.Base.Error) {
- /* Todo: Fail gracefully */
- fprintf(stderr, "r300 FP: Compiler error\n");
- abort();
+ /* Todo: Fallback to software rendering gracefully? */
+ fprintf(stderr, "r300 FP: Compiler error: %s\n", compiler.Base.ErrorMsg);
+
+ if (compiler.is_r500) {
+ memcpy(compiler.code, &r5xx_passthrough_fragment_shader, sizeof(r5xx_passthrough_fragment_shader));
+ } else {
+ memcpy(compiler.code, &r3xx_passthrough_fragment_shader, sizeof(r3xx_passthrough_fragment_shader));
+ }
}
/* And, finally... */