diff options
author | Jason Ekstrand <[email protected]> | 2015-12-02 17:18:41 -0800 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2015-12-03 13:44:02 -0800 |
commit | 4e904a0310be8a5c311355473e70df4fd4d9caa1 (patch) | |
tree | 07872f76727c71d1507b1e4c5ecebd1cdfadb5b0 /src | |
parent | 5757ad2959a91f71dcc4a3661cce0e5ab065052b (diff) |
vk/0.210.0: Rework vkQueueSubmit
Diffstat (limited to 'src')
-rw-r--r-- | src/vulkan/anv_device.c | 38 | ||||
-rw-r--r-- | src/vulkan/anv_dump.c | 8 |
2 files changed, 26 insertions, 20 deletions
diff --git a/src/vulkan/anv_device.c b/src/vulkan/anv_device.c index 5b300afc0a8..e3b3541d251 100644 --- a/src/vulkan/anv_device.c +++ b/src/vulkan/anv_device.c @@ -808,8 +808,8 @@ void anv_GetDeviceQueue( VkResult anv_QueueSubmit( VkQueue _queue, - uint32_t commandBufferCount, - const VkCommandBuffer* pCommandBuffers, + uint32_t submitCount, + const VkSubmitInfo* pSubmits, VkFence _fence) { ANV_FROM_HANDLE(anv_queue, queue, _queue); @@ -817,29 +817,31 @@ VkResult anv_QueueSubmit( struct anv_device *device = queue->device; int ret; - for (uint32_t i = 0; i < commandBufferCount; i++) { - ANV_FROM_HANDLE(anv_cmd_buffer, cmd_buffer, pCommandBuffers[i]); + for (uint32_t i = 0; i < submitCount; i++) { + for (uint32_t j = 0; j < pSubmits[i].commandBufferCount; j++) { + ANV_FROM_HANDLE(anv_cmd_buffer, cmd_buffer, + pSubmits[i].pCommandBuffers[j]); + assert(cmd_buffer->level == VK_COMMAND_BUFFER_LEVEL_PRIMARY); - assert(cmd_buffer->level == VK_COMMAND_BUFFER_LEVEL_PRIMARY); - - ret = anv_gem_execbuffer(device, &cmd_buffer->execbuf2.execbuf); - if (ret != 0) { - /* We don't know the real error. */ - return vk_errorf(VK_ERROR_OUT_OF_DEVICE_MEMORY, - "execbuf2 failed: %m"); - } - - if (fence) { - ret = anv_gem_execbuffer(device, &fence->execbuf); + ret = anv_gem_execbuffer(device, &cmd_buffer->execbuf2.execbuf); if (ret != 0) { /* We don't know the real error. */ return vk_errorf(VK_ERROR_OUT_OF_DEVICE_MEMORY, "execbuf2 failed: %m"); } - } - for (uint32_t i = 0; i < cmd_buffer->execbuf2.bo_count; i++) - cmd_buffer->execbuf2.bos[i]->offset = cmd_buffer->execbuf2.objects[i].offset; + if (fence) { + ret = anv_gem_execbuffer(device, &fence->execbuf); + if (ret != 0) { + /* We don't know the real error. */ + return vk_errorf(VK_ERROR_OUT_OF_DEVICE_MEMORY, + "execbuf2 failed: %m"); + } + } + + for (uint32_t k = 0; k < cmd_buffer->execbuf2.bo_count; k++) + cmd_buffer->execbuf2.bos[k]->offset = cmd_buffer->execbuf2.objects[k].offset; + } } return VK_SUCCESS; diff --git a/src/vulkan/anv_dump.c b/src/vulkan/anv_dump.c index 4db7c2539e1..3a1430d49a0 100644 --- a/src/vulkan/anv_dump.c +++ b/src/vulkan/anv_dump.c @@ -161,8 +161,12 @@ anv_dump_image_to_ppm(struct anv_device *device, }, NULL, &fence); assert(result == VK_SUCCESS); - result = anv_QueueSubmit(anv_queue_to_handle(&device->queue), - 1, &cmd, fence); + result = anv_QueueSubmit(anv_queue_to_handle(&device->queue), 1, + &(VkSubmitInfo) { + .sType = VK_STRUCTURE_TYPE_SUBMIT_INFO, + .commandBufferCount = 1, + .pCommandBuffers = &cmd, + }, fence); assert(result == VK_SUCCESS); result = anv_WaitForFences(vk_device, 1, &fence, true, UINT64_MAX); |