summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2015-11-13 22:50:52 -0800
committerJason Ekstrand <[email protected]>2015-11-13 22:50:54 -0800
commite8f51fe4deb5082fece5f8cb167b89b0f03eb244 (patch)
tree3eef238684348f72cd3b7dc113fc6a78851b0579 /src
parent91bc4e7cec4098000f3d9a265e7db7907a686e5a (diff)
anv/gen8: Subtract 1 from num_elements when setting up buffer surface state
Diffstat (limited to 'src')
-rw-r--r--src/vulkan/gen8_state.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/vulkan/gen8_state.c b/src/vulkan/gen8_state.c
index 22fe21db1a8..6eb65e6ec4e 100644
--- a/src/vulkan/gen8_state.c
+++ b/src/vulkan/gen8_state.c
@@ -45,9 +45,9 @@ gen8_fill_buffer_surface_state(void *state, const struct anv_format *format,
.SamplerL2BypassModeDisable = true,
.RenderCacheReadWriteMode = WriteOnlyCache,
.MemoryObjectControlState = GEN8_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,
.NumberofMultisamples = MULTISAMPLECOUNT_1,
.ShaderChannelSelectRed = SCS_RED,