+ VkResult result;
+ if (cmd_buffer->device->physical->use_softpin) {
+ anv_block_pool_foreach_bo(bo, &ss_pool->block_pool) {
+ result = anv_execbuf_add_bo(cmd_buffer->device, execbuf,
+ bo, NULL, 0);
+ if (result != VK_SUCCESS)
+ return result;
+ }
+ /* Add surface dependencies (BOs) to the execbuf */
+ anv_execbuf_add_bo_bitset(cmd_buffer->device, execbuf,
+ cmd_buffer->surface_relocs.dep_words,
+ cmd_buffer->surface_relocs.deps, 0);
+
+ /* Add the BOs for all memory objects */
+ list_for_each_entry(struct anv_device_memory, mem,
+ &cmd_buffer->device->memory_objects, link) {
+ result = anv_execbuf_add_bo(cmd_buffer->device, execbuf,
+ mem->bo, NULL, 0);
+ if (result != VK_SUCCESS)
+ return result;
+ }
+
+ struct anv_block_pool *pool;
+ pool = &cmd_buffer->device->dynamic_state_pool.block_pool;
+ anv_block_pool_foreach_bo(bo, pool) {
+ result = anv_execbuf_add_bo(cmd_buffer->device, execbuf,
+ bo, NULL, 0);
+ if (result != VK_SUCCESS)
+ return result;
+ }
+
+ pool = &cmd_buffer->device->instruction_state_pool.block_pool;
+ anv_block_pool_foreach_bo(bo, pool) {
+ result = anv_execbuf_add_bo(cmd_buffer->device, execbuf,
+ bo, NULL, 0);
+ if (result != VK_SUCCESS)
+ return result;
+ }
+
+ pool = &cmd_buffer->device->binding_table_pool.block_pool;
+ anv_block_pool_foreach_bo(bo, pool) {
+ result = anv_execbuf_add_bo(cmd_buffer->device, execbuf,
+ bo, NULL, 0);
+ if (result != VK_SUCCESS)
+ return result;
+ }
+ } else {
+ /* Since we aren't in the softpin case, all of our STATE_BASE_ADDRESS BOs
+ * will get added automatically by processing relocations on the batch
+ * buffer. We have to add the surface state BO manually because it has
+ * relocations of its own that we need to be sure are processsed.
+ */
+ result = anv_execbuf_add_bo(cmd_buffer->device, execbuf,
+ ss_pool->block_pool.bo,
+ &cmd_buffer->surface_relocs, 0);
+ if (result != VK_SUCCESS)
+ return result;
+ }