summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarek Olšák <maraeo@gmail.com>2010-09-01 00:59:52 +0200
committerMarek Olšák <maraeo@gmail.com>2010-09-04 18:56:20 +0200
commit56de72c78afdb14d842a8fabbe2613a4d5eebb8f (patch)
tree2bacb44b7ad60f70d04aa8d43b9f4cb72011a687 /src
parent313e95f0c792580f6051fedb67e65838405c88f8 (diff)
r300g: only check for an empty shader if there are no compile errors
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/r300/r300_fs.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/gallium/drivers/r300/r300_fs.c b/src/gallium/drivers/r300/r300_fs.c
index 2b9861cae38..485faefc6ac 100644
--- a/src/gallium/drivers/r300/r300_fs.c
+++ b/src/gallium/drivers/r300/r300_fs.c
@@ -424,14 +424,6 @@ static void r300_translate_fragment_shader(
/* Invoke the compiler */
r3xx_compile_fragment_program(&compiler);
- /* Shaders with zero instructions are invalid,
- * use the dummy shader instead. */
- if (shader->code.code.r500.inst_end == -1) {
- rc_destroy(&compiler.Base);
- r300_dummy_fragment_shader(r300, shader);
- return;
- }
-
if (compiler.Base.Error) {
fprintf(stderr, "r300 FP: Compiler Error:\n%sUsing a dummy shader"
" instead.\n", compiler.Base.ErrorMsg);
@@ -447,6 +439,14 @@ static void r300_translate_fragment_shader(
return;
}
+ /* Shaders with zero instructions are invalid,
+ * use the dummy shader instead. */
+ if (shader->code.code.r500.inst_end == -1) {
+ rc_destroy(&compiler.Base);
+ r300_dummy_fragment_shader(r300, shader);
+ return;
+ }
+
/* Initialize numbers of constants for each type. */
shader->externals_count = 0;
for (i = 0;