anv: use helper function to get the buffer size
This ensures we get a properly aligned size for the buffer so we don't trip over HW limits for push constants. Closes #3703 Fixes dEQP-VK.robustness.image_robustness.push.* on HSW Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9699>
This commit is contained in:
@@ -1269,7 +1269,8 @@ anv_cmd_buffer_push_descriptor_set(struct anv_cmd_buffer *cmd_buffer,
|
|||||||
*/
|
*/
|
||||||
struct anv_state desc_mem =
|
struct anv_state desc_mem =
|
||||||
anv_state_stream_alloc(&cmd_buffer->dynamic_state_stream,
|
anv_state_stream_alloc(&cmd_buffer->dynamic_state_stream,
|
||||||
layout->descriptor_buffer_size, 32);
|
anv_descriptor_set_layout_descriptor_buffer_size(layout, 0),
|
||||||
|
ANV_UBO_ALIGNMENT);
|
||||||
if (set->desc_mem.alloc_size) {
|
if (set->desc_mem.alloc_size) {
|
||||||
/* TODO: Do we really need to copy all the time? */
|
/* TODO: Do we really need to copy all the time? */
|
||||||
memcpy(desc_mem.map, set->desc_mem.map,
|
memcpy(desc_mem.map, set->desc_mem.map,
|
||||||
|
@@ -607,8 +607,8 @@ set_layout_buffer_view_count(const struct anv_descriptor_set_layout *set_layout,
|
|||||||
return set_layout->buffer_view_count - shrink;
|
return set_layout->buffer_view_count - shrink;
|
||||||
}
|
}
|
||||||
|
|
||||||
static uint32_t
|
uint32_t
|
||||||
set_layout_descriptor_buffer_size(const struct anv_descriptor_set_layout *set_layout,
|
anv_descriptor_set_layout_descriptor_buffer_size(const struct anv_descriptor_set_layout *set_layout,
|
||||||
uint32_t var_desc_count)
|
uint32_t var_desc_count)
|
||||||
{
|
{
|
||||||
const struct anv_descriptor_set_binding_layout *dynamic_binding =
|
const struct anv_descriptor_set_binding_layout *dynamic_binding =
|
||||||
@@ -1070,7 +1070,7 @@ anv_descriptor_set_create(struct anv_device *device,
|
|||||||
return result;
|
return result;
|
||||||
|
|
||||||
uint32_t descriptor_buffer_size =
|
uint32_t descriptor_buffer_size =
|
||||||
set_layout_descriptor_buffer_size(layout, var_desc_count);
|
anv_descriptor_set_layout_descriptor_buffer_size(layout, var_desc_count);
|
||||||
if (descriptor_buffer_size) {
|
if (descriptor_buffer_size) {
|
||||||
uint64_t pool_vma_offset =
|
uint64_t pool_vma_offset =
|
||||||
util_vma_heap_alloc(&pool->bo_heap, descriptor_buffer_size,
|
util_vma_heap_alloc(&pool->bo_heap, descriptor_buffer_size,
|
||||||
|
@@ -2059,6 +2059,10 @@ size_t
|
|||||||
anv_descriptor_set_layout_size(const struct anv_descriptor_set_layout *layout,
|
anv_descriptor_set_layout_size(const struct anv_descriptor_set_layout *layout,
|
||||||
uint32_t var_desc_count);
|
uint32_t var_desc_count);
|
||||||
|
|
||||||
|
uint32_t
|
||||||
|
anv_descriptor_set_layout_descriptor_buffer_size(const struct anv_descriptor_set_layout *set_layout,
|
||||||
|
uint32_t var_desc_count);
|
||||||
|
|
||||||
void
|
void
|
||||||
anv_descriptor_set_write_image_view(struct anv_device *device,
|
anv_descriptor_set_write_image_view(struct anv_device *device,
|
||||||
struct anv_descriptor_set *set,
|
struct anv_descriptor_set *set,
|
||||||
|
Reference in New Issue
Block a user