llvmpipe: cope with nr_cbufs == 0
authorKeith Whitwell <keithw@vmware.com>
Mon, 27 Jul 2009 10:23:51 +0000 (11:23 +0100)
committerJosé Fonseca <jfonseca@vmware.com>
Sat, 29 Aug 2009 08:21:21 +0000 (09:21 +0100)
Disable blend code when no color buffer

src/gallium/drivers/llvmpipe/lp_quad_blend.c

index 0ebe0e6c51f047c90d4560096534024df0e6f8a1..fe6d30d7c860053a5753586ab8b4a5c018bad24e 100644 (file)
@@ -924,6 +924,13 @@ single_output_color(struct quad_stage *qs,
    }
 }
 
+static void
+blend_noop(struct quad_stage *qs, 
+           struct quad_header *quads[],
+           unsigned nr)
+{
+}
+
 
 static void
 choose_blend_quad(struct quad_stage *qs, 
@@ -934,9 +941,12 @@ choose_blend_quad(struct quad_stage *qs,
    const struct pipe_blend_state *blend = llvmpipe->blend;
 
    qs->run = blend_fallback;
-
-   if (!llvmpipe->blend->logicop_enable &&
-       llvmpipe->blend->colormask == 0xf) 
+   
+   if (llvmpipe->framebuffer.nr_cbufs == 0) {
+      qs->run = blend_noop;
+   }
+   else if (!llvmpipe->blend->logicop_enable &&
+            llvmpipe->blend->colormask == 0xf) 
    {
       if (!blend->blend_enable) {
          qs->run = single_output_color;