i965/gen4-5: Fix segfaults with stencil-only depth/stencil setups.
authorEric Anholt <eric@anholt.net>
Mon, 26 Nov 2012 22:46:11 +0000 (14:46 -0800)
committerEric Anholt <eric@anholt.net>
Wed, 28 Nov 2012 19:26:41 +0000 (11:26 -0800)
Fixes a ton of piglit regressions since the depthstencil fixes for gen6+.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=57309
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_misc_state.c

index 9c07be2c2194497559addc36f10e45d1b4289fd5..b0a19181fc3a4ac82a624882f846d8d86d81baac 100644 (file)
@@ -554,8 +554,10 @@ static void emit_depthbuffer(struct brw_context *brw)
    /* If there's a packed depth/stencil bound to stencil only, we need to
     * emit the packed depth/stencil buffer packet.
     */
-   if (!depth_irb && stencil_irb && !separate_stencil)
+   if (!depth_irb && stencil_irb && !separate_stencil) {
       depth_irb = stencil_irb;
+      depth_mt = stencil_mt;
+   }
 
    if (intel->gen >= 6)
       len = 7;