anv/gen7: Subtract 1 from num_elements when setting up buffer surface state
authorJordan Justen <jordan.l.justen@intel.com>
Fri, 29 Jan 2016 01:19:15 +0000 (17:19 -0800)
committerJordan Justen <jordan.l.justen@intel.com>
Sat, 30 Jan 2016 17:00:00 +0000 (09:00 -0800)
e8f51fe4 for gen7

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
src/vulkan/gen7_state.c

index 4c27716d18e76d20af34e70ea16412b0514eb329..2375070636e139929832fc04ec31c7413228b868 100644 (file)
@@ -49,9 +49,9 @@ genX(fill_buffer_surface_state)(void *state, enum isl_format format,
       .TiledSurface                             = false,
       .RenderCacheReadWriteMode                 = false,
       .SurfaceObjectControlState                = GENX(MOCS),
-      .Height                                   = (num_elements >> 7) & 0x3fff,
-      .Width                                    = num_elements & 0x7f,
-      .Depth                                    = (num_elements >> 21) & 0x3f,
+      .Height                                   = ((num_elements - 1) >> 7) & 0x3fff,
+      .Width                                    = (num_elements - 1) & 0x7f,
+      .Depth                                    = ((num_elements - 1) >> 21) & 0x3f,
       .SurfacePitch                             = stride - 1,
 #  if (ANV_IS_HASWELL)
       .ShaderChannelSelectR                     = SCS_RED,