From 56de72c78afdb14d842a8fabbe2613a4d5eebb8f Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Wed, 1 Sep 2010 00:59:52 +0200 Subject: r300g: only check for an empty shader if there are no compile errors --- src/gallium/drivers/r300/r300_fs.c | 16 ++++++++-------- 1 file 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; -- cgit v1.2.3