summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorKeith Whitwell <[email protected]>2009-07-27 11:23:51 +0100
committerKeith Whitwell <[email protected]>2009-07-27 11:23:51 +0100
commit1078844d18367b4259cd3b6a3a73e3cd72ea019f (patch)
tree67912f291052519a291698ba6db81eb53b47c1d0 /src/gallium
parentbac8e34c9e4077d370923773d67fe565ce154849 (diff)
softpipe: cope with nr_cbufs == 0
Disable blend code when no color buffer
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/softpipe/sp_quad_blend.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/gallium/drivers/softpipe/sp_quad_blend.c b/src/gallium/drivers/softpipe/sp_quad_blend.c
index e1f0e772554..e243c63fa23 100644
--- a/src/gallium/drivers/softpipe/sp_quad_blend.c
+++ b/src/gallium/drivers/softpipe/sp_quad_blend.c
@@ -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 = softpipe->blend;
qs->run = blend_fallback;
-
- if (!softpipe->blend->logicop_enable &&
- softpipe->blend->colormask == 0xf)
+
+ if (softpipe->framebuffer.nr_cbufs == 0) {
+ qs->run = blend_noop;
+ }
+ else if (!softpipe->blend->logicop_enable &&
+ softpipe->blend->colormask == 0xf)
{
if (!blend->blend_enable) {
qs->run = single_output_color;