i965: Return BRW_DEPTHBUFFER_D32_FLOAT as the null-depthbuffer format.
authorKenneth Graunke <kenneth@whitecape.org>
Wed, 7 Dec 2011 10:21:37 +0000 (02:21 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Wed, 7 Dec 2011 22:51:12 +0000 (14:51 -0800)
Fixes many crashes on Ivybridge due to upload_sf_state calling
brw_depthbuffer_format without an actual depth buffer.  This was a
recent regression on master.

+3992 piglits on Ivybridge.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
src/mesa/drivers/dri/i965/brw_misc_state.c

index 8a6ee708ccf120d405a8a77dbdf8c5c1091840ab..3e8cb3f5f0a6161ca75f015a1fe62da61161777b 100644 (file)
@@ -212,6 +212,9 @@ brw_depthbuffer_format(struct brw_context *brw)
       drb = srb;
    }
 
+   if (!drb)
+      return BRW_DEPTHFORMAT_D32_FLOAT;
+
    switch (drb->Base.Format) {
    case MESA_FORMAT_Z16:
       return BRW_DEPTHFORMAT_D16_UNORM;