Mesa (master): llvmpipe: don't try to emit non-existent color outputs

Keith Whitwell keithw at kemper.freedesktop.org
Thu Oct 14 13:08:35 UTC 2010


Module: Mesa
Branch: master
Commit: f0bd76f28d17da6eabf977a7e619e4ff943a70c7
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=f0bd76f28d17da6eabf977a7e619e4ff943a70c7

Author: Keith Whitwell <keithw at vmware.com>
Date:   Thu Oct 14 13:15:28 2010 +0100

llvmpipe: don't try to emit non-existent color outputs

---

 src/gallium/drivers/llvmpipe/lp_state_fs.c |   17 +++++++++--------
 1 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/src/gallium/drivers/llvmpipe/lp_state_fs.c b/src/gallium/drivers/llvmpipe/lp_state_fs.c
index c098356..6e3c27e 100644
--- a/src/gallium/drivers/llvmpipe/lp_state_fs.c
+++ b/src/gallium/drivers/llvmpipe/lp_state_fs.c
@@ -406,14 +406,15 @@ generate_fs(struct llvmpipe_context *lp,
       if (shader->info.base.output_semantic_name[attrib] == TGSI_SEMANTIC_COLOR)
       {
          unsigned cbuf = shader->info.base.output_semantic_index[attrib];
-         for(chan = 0; chan < NUM_CHANNELS; ++chan)
-         {
-            /* XXX: just initialize outputs to point at colors[] and
-             * skip this.
-             */
-            LLVMValueRef out = LLVMBuildLoad(builder, outputs[attrib][chan], "");
-            lp_build_name(out, "color%u.%u.%c", i, attrib, "rgba"[chan]);
-            LLVMBuildStore(builder, out, color[cbuf][chan]);
+         for(chan = 0; chan < NUM_CHANNELS; ++chan) {
+            if(outputs[attrib][chan]) {
+               /* XXX: just initialize outputs to point at colors[] and
+                * skip this.
+                */
+               LLVMValueRef out = LLVMBuildLoad(builder, outputs[attrib][chan], "");
+               lp_build_name(out, "color%u.%u.%c", i, attrib, "rgba"[chan]);
+               LLVMBuildStore(builder, out, color[cbuf][chan]);
+            }
          }
       }
    }




More information about the mesa-commit mailing list