diff options
author | Jason Ekstrand <[email protected]> | 2016-10-21 17:01:17 -0700 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2016-11-16 10:11:29 -0800 |
commit | e371850d94cf8cf9df678233d64411c783d95668 (patch) | |
tree | e19e7e111b9209b3a85d1db86b9a4aab4da4ad5f /src/intel/vulkan/anv_blorp.c | |
parent | 3c1ee052bdb3585d85ca6a95223de790cafe657a (diff) |
anv/blorp: Break the guts of alloc_binding_table into a shared helper
Signed-off-by: Jason Ekstrand <[email protected]>
Reviewed-by: Topi Pohjolainen <[email protected]>
Diffstat (limited to 'src/intel/vulkan/anv_blorp.c')
-rw-r--r-- | src/intel/vulkan/anv_blorp.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/intel/vulkan/anv_blorp.c b/src/intel/vulkan/anv_blorp.c index d59c1a73aed..3c415902aa4 100644 --- a/src/intel/vulkan/anv_blorp.c +++ b/src/intel/vulkan/anv_blorp.c @@ -883,6 +883,32 @@ void anv_CmdClearDepthStencilImage( blorp_batch_finish(&batch); } +struct anv_state +anv_cmd_buffer_alloc_blorp_binding_table(struct anv_cmd_buffer *cmd_buffer, + uint32_t num_entries, + uint32_t *state_offset) +{ + struct anv_state bt_state = + anv_cmd_buffer_alloc_binding_table(cmd_buffer, num_entries, + state_offset); + if (bt_state.map == NULL) { + /* We ran out of space. Grab a new binding table block. */ + VkResult result = anv_cmd_buffer_new_binding_table_block(cmd_buffer); + assert(result == VK_SUCCESS); + + /* Re-emit state base addresses so we get the new surface state base + * address before we start emitting binding tables etc. + */ + anv_cmd_buffer_emit_state_base_address(cmd_buffer); + + bt_state = anv_cmd_buffer_alloc_binding_table(cmd_buffer, num_entries, + state_offset); + assert(bt_state.map != NULL); + } + + return bt_state; +} + static void clear_color_attachment(struct anv_cmd_buffer *cmd_buffer, struct blorp_batch *batch, |