From dd2effb0e75c614333c7e4e99ea47e29fd1ac415 Mon Sep 17 00:00:00 2001 From: Jordan Justen Date: Thu, 28 Jan 2016 17:19:15 -0800 Subject: [PATCH] anv/gen7: Subtract 1 from num_elements when setting up buffer surface state e8f51fe4 for gen7 Signed-off-by: Jordan Justen --- src/vulkan/gen7_state.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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, -- 2.30.2