diff options
author | Jason Ekstrand <[email protected]> | 2020-02-11 10:12:06 -0600 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-03-07 04:51:28 +0000 |
commit | 61ac8cf08381f7df05b477cfc6854b3b4b88f03f (patch) | |
tree | e7af4c3f9642bcd27e8f90ec020cfc123245592b /src/intel/vulkan/anv_descriptor_set.c | |
parent | 4610d69e37fd9472b88fcc7f1bad6530242aa105 (diff) |
anv: Align UBO sizes to 32B
This makes all of our bounds checking consistent with the block loads we
do for constant offset UBO accesses.
Reviewed-by: Lionel Landwerlin <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3777>
Diffstat (limited to 'src/intel/vulkan/anv_descriptor_set.c')
-rw-r--r-- | src/intel/vulkan/anv_descriptor_set.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/intel/vulkan/anv_descriptor_set.c b/src/intel/vulkan/anv_descriptor_set.c index 585ff89306a..b9d7eea86eb 100644 --- a/src/intel/vulkan/anv_descriptor_set.c +++ b/src/intel/vulkan/anv_descriptor_set.c @@ -1304,6 +1304,13 @@ anv_descriptor_set_write_buffer(struct anv_device *device, struct anv_address bind_addr = anv_address_add(buffer->address, offset); uint64_t bind_range = anv_buffer_get_range(buffer, offset, range); + /* We report a bounds checking alignment of 32B for the sake of block + * messages which read an entire register worth at a time. + */ + if (type == VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER || + type == VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC) + bind_range = align_u64(bind_range, ANV_UBO_BOUNDS_CHECK_ALIGNMENT); + if (type == VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC || type == VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC) { *desc = (struct anv_descriptor) { |