diff options
Diffstat (limited to 'src/vulkan')
-rw-r--r-- | src/vulkan/anv_batch_chain.c | 7 | ||||
-rw-r--r-- | src/vulkan/anv_cmd_buffer.c | 6 | ||||
-rw-r--r-- | src/vulkan/anv_private.h | 3 |
3 files changed, 13 insertions, 3 deletions
diff --git a/src/vulkan/anv_batch_chain.c b/src/vulkan/anv_batch_chain.c index aaf65c33f84..51ba7ef4a31 100644 --- a/src/vulkan/anv_batch_chain.c +++ b/src/vulkan/anv_batch_chain.c @@ -489,6 +489,13 @@ anv_cmd_buffer_alloc_surface_state(struct anv_cmd_buffer *cmd_buffer, } struct anv_state +anv_cmd_buffer_alloc_binding_table(struct anv_cmd_buffer *cmd_buffer, + uint32_t entries) +{ + return anv_cmd_buffer_alloc_surface_state(cmd_buffer, entries * 4, 32); +} + +struct anv_state anv_cmd_buffer_alloc_dynamic_state(struct anv_cmd_buffer *cmd_buffer, uint32_t size, uint32_t alignment) { diff --git a/src/vulkan/anv_cmd_buffer.c b/src/vulkan/anv_cmd_buffer.c index 38d032b3661..5dc338782b3 100644 --- a/src/vulkan/anv_cmd_buffer.c +++ b/src/vulkan/anv_cmd_buffer.c @@ -395,7 +395,7 @@ anv_cmd_buffer_emit_binding_table(struct anv_cmd_buffer *cmd_buffer, struct anv_framebuffer *fb = cmd_buffer->state.framebuffer; struct anv_subpass *subpass = cmd_buffer->state.subpass; struct anv_pipeline_layout *layout; - uint32_t attachments, bias, size; + uint32_t attachments, bias; if (stage == VK_SHADER_STAGE_COMPUTE) layout = cmd_buffer->state.compute_pipeline->layout; @@ -418,8 +418,8 @@ anv_cmd_buffer_emit_binding_table(struct anv_cmd_buffer *cmd_buffer, if (attachments + surface_count == 0) return VK_SUCCESS; - size = (bias + surface_count) * sizeof(uint32_t); - *bt_state = anv_cmd_buffer_alloc_surface_state(cmd_buffer, size, 32); + *bt_state = anv_cmd_buffer_alloc_binding_table(cmd_buffer, + bias + surface_count); uint32_t *bt_map = bt_state->map; if (bt_state->map == NULL) diff --git a/src/vulkan/anv_private.h b/src/vulkan/anv_private.h index 8839e875656..6b9b12fd8ec 100644 --- a/src/vulkan/anv_private.h +++ b/src/vulkan/anv_private.h @@ -933,6 +933,9 @@ struct anv_state anv_cmd_buffer_alloc_surface_state(struct anv_cmd_buffer *cmd_buffer, uint32_t size, uint32_t alignment); struct anv_state +anv_cmd_buffer_alloc_binding_table(struct anv_cmd_buffer *cmd_buffer, + uint32_t entries); +struct anv_state anv_cmd_buffer_alloc_dynamic_state(struct anv_cmd_buffer *cmd_buffer, uint32_t size, uint32_t alignment); |