From: Jordan Justen Date: Fri, 29 Jan 2016 01:19:15 +0000 (-0800) Subject: anv/gen7: Subtract 1 from num_elements when setting up buffer surface state X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=dd2effb0e75c614333c7e4e99ea47e29fd1ac415;p=mesa.git anv/gen7: Subtract 1 from num_elements when setting up buffer surface state e8f51fe4 for gen7 Signed-off-by: Jordan Justen --- diff --git a/src/vulkan/gen7_state.c b/src/vulkan/gen7_state.c index 4c27716d18e..2375070636e 100644 --- a/src/vulkan/gen7_state.c +++ b/src/vulkan/gen7_state.c @@ -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,