Beispiel #1
0
VKAPI_ATTR VkResult VKAPI_CALL vkEndCommandBuffer(
    VkCommandBuffer                              commandBuffer)
{
    struct intel_cmd *cmd = intel_cmd(commandBuffer);

    return intel_cmd_end(cmd);
}
Beispiel #2
0
VKAPI_ATTR VkResult VKAPI_CALL vkBeginCommandBuffer(
    VkCommandBuffer                              commandBuffer,
    const VkCommandBufferBeginInfo            *info)
{
    struct intel_cmd *cmd = intel_cmd(commandBuffer);

    return intel_cmd_begin(cmd, info);
}
Beispiel #3
0
VKAPI_ATTR VkResult VKAPI_CALL vkResetCommandBuffer(
    VkCommandBuffer                              commandBuffer,
    VkCommandBufferResetFlags                    flags)
{
    struct intel_cmd *cmd = intel_cmd(commandBuffer);

    cmd_reset(cmd);

    return VK_SUCCESS;
}
Beispiel #4
0
VKAPI_ATTR VkResult VKAPI_CALL vkQueueSubmit(
    VkQueue                                   queue_,
    uint32_t                                  submitCount,
    const VkSubmitInfo*                       pSubmits,
    VkFence                                   fence_)
{
    struct intel_queue *queue = intel_queue(queue_);
    VkResult ret = VK_SUCCESS;
    struct intel_cmd *last_cmd;
    uint32_t i;

    for (uint32_t submit_idx = 0; submit_idx < submitCount; submit_idx++) {

        const VkSubmitInfo *submit = &pSubmits[submit_idx];

        for (i = 0; i < submit->waitSemaphoreCount; i++) {
            struct intel_semaphore *pSemaphore = intel_semaphore(submit->pWaitSemaphores[i]);
            intel_wait_queue_semaphore(queue, pSemaphore);
        }

        if (unlikely(intel_debug)) {
            for (i = 0; i < submit->commandBufferCount; i++) {
                struct intel_cmd *cmd = intel_cmd(submit->pCommandBuffers[i]);
                ret = queue_submit_cmd_debug(queue, cmd);
                if (ret != VK_SUCCESS)
                    break;
            }
        } else {
            for (i = 0; i < submit->commandBufferCount; i++) {
                struct intel_cmd *cmd = intel_cmd(submit->pCommandBuffers[i]);
                ret = queue_submit_cmd(queue, cmd);
                if (ret != VK_SUCCESS)
                    break;
            }
        }

        /* no cmd submitted */
        if (i == 0)
            return ret;

        last_cmd = intel_cmd(submit->pCommandBuffers[i - 1]);

        if (ret == VK_SUCCESS) {
            intel_fence_set_seqno(queue->fence,
                    intel_cmd_get_batch(last_cmd, NULL));

            if (fence_ != VK_NULL_HANDLE) {
                struct intel_fence *fence = intel_fence(fence_);
                intel_fence_copy(fence, queue->fence);
            }
        } else {
            struct intel_bo *last_bo;

            /* unbusy submitted BOs */
            last_bo = intel_cmd_get_batch(last_cmd, NULL);
            intel_bo_wait(last_bo, -1);
        }

        for (i = 0; i < submit->signalSemaphoreCount; i++) {
            struct intel_semaphore *pSemaphore = intel_semaphore(submit->pSignalSemaphores[i]);
            intel_signal_queue_semaphore(queue, pSemaphore);
        }
    }

    return ret;
}