i965: Don't use BRW_DEPTHFORMAT_D24_UNORM_X8_UINT on Gen4.
authorKenneth Graunke <kenneth@whitecape.org>
Tue, 20 Dec 2011 23:26:21 +0000 (15:26 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Fri, 23 Dec 2011 20:15:20 +0000 (12:15 -0800)
X8 depth formats weren't supported until Ironlake (Gen 5).

Fixes GPU hangs introduced in d84a180417d1eabd680554970f1eaaa93abcd41e.
One example test case was "fbo-missing-attachment-blit from".

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

index 7b1398134bf59fe438a2be0fab05739133d0fba6..e2ac170d0868edacd303f4117d7691a3f42e7fc7 100644 (file)
@@ -223,7 +223,10 @@ brw_depthbuffer_format(struct brw_context *brw)
    case MESA_FORMAT_Z32_FLOAT:
       return BRW_DEPTHFORMAT_D32_FLOAT;
    case MESA_FORMAT_X8_Z24:
-      return BRW_DEPTHFORMAT_D24_UNORM_X8_UINT;
+      if (intel->gen >= 5)
+        return BRW_DEPTHFORMAT_D24_UNORM_X8_UINT;
+      else /* Gen4 doesn't support X8; use S8 instead. */
+        return BRW_DEPTHFORMAT_D24_UNORM_S8_UINT;
    case MESA_FORMAT_S8_Z24:
       return BRW_DEPTHFORMAT_D24_UNORM_S8_UINT;
    case MESA_FORMAT_Z32_FLOAT_X24S8: