summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/gen6_cc.c
diff options
context:
space:
mode:
authorChad Versace <chad@chad-versace.us>2011-10-08 20:00:50 -0700
committerChad Versace <chad@chad-versace.us>2011-10-18 11:42:54 -0700
commitb48e02383e6bf8a4e1c05d11c6dce25cb796fcf4 (patch)
tree1dd74f75b3770422cad3fd2e040aadc03c8a70f1 /src/mesa/drivers/dri/i965/gen6_cc.c
parent8c7c589c4e70d7cdcceb350aa4edd3d9eec4403e (diff)
downloadexternal_mesa3d-b48e02383e6bf8a4e1c05d11c6dce25cb796fcf4.zip
external_mesa3d-b48e02383e6bf8a4e1c05d11c6dce25cb796fcf4.tar.gz
external_mesa3d-b48e02383e6bf8a4e1c05d11c6dce25cb796fcf4.tar.bz2
i965/gen6: Fix segfault in prepare_blend_state()
Don't dereference the color buffer if one isn't attached. This fixes the following Piglit tests in my experimental HiZ branch: glean/logicOp glean/paths Note: This is a candidate for the stable branches. Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Chad Versace <chad@chad-versace.us>
Diffstat (limited to 'src/mesa/drivers/dri/i965/gen6_cc.c')
-rw-r--r--src/mesa/drivers/dri/i965/gen6_cc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/i965/gen6_cc.c b/src/mesa/drivers/dri/i965/gen6_cc.c
index 1e6c4cf..b3ad157 100644
--- a/src/mesa/drivers/dri/i965/gen6_cc.c
+++ b/src/mesa/drivers/dri/i965/gen6_cc.c
@@ -64,7 +64,7 @@ prepare_blend_state(struct brw_context *brw)
/* Floating point RTs should have no effect from LogicOp,
* except for disabling of blending
*/
- if (_mesa_get_format_datatype(rb->Format) != GL_FLOAT) {
+ if (rb && _mesa_get_format_datatype(rb->Format) != GL_FLOAT) {
blend[b].blend1.logic_op_enable = 1;
blend[b].blend1.logic_op_func =
intel_translate_logic_op(ctx->Color.LogicOp);