From: Marek Olšák Date: Tue, 31 Aug 2010 22:59:52 +0000 (+0200) Subject: r300g: only check for an empty shader if there are no compile errors X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=56de72c78afdb14d842a8fabbe2613a4d5eebb8f;p=mesa.git r300g: only check for an empty shader if there are no compile errors --- 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;