i965: Set vertical alignment unit to 4 on Broadwell.
authorKenneth Graunke <kenneth@whitecape.org>
Sat, 15 Dec 2012 09:14:03 +0000 (01:14 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Mon, 2 Dec 2013 21:25:11 +0000 (13:25 -0800)
Broadwell doesn't support a surface vertical alignment of 2.  It only
supports VALIGN_4, VALIGN_8, or VALIGN_16.  I chose 4 since it's the
least wasteful.

v2: Replace my comment with a better one from Eric.  Move Broadwell
    checks earlier so it's more obvious that "return 2" won't be hit.

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

index 2c81eed741f303ae83d2fe7e9faaf71374fc79e6..16af19f0090174710af259fd2f8135b4e5f5e25e 100644 (file)
@@ -117,6 +117,12 @@ intel_vertical_texture_alignment_unit(struct brw_context *brw,
    if (format == MESA_FORMAT_S8)
       return brw->gen >= 7 ? 8 : 4;
 
+   /* Broadwell only supports VALIGN of 4, 8, and 16.  The BSpec says 4
+    * should always be used, except for stencil buffers, which should be 8.
+    */
+   if (brw->gen >= 8)
+      return 4;
+
    if (multisampled)
       return 4;