radv: always check the return error when submitting a CS
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 21 Jun 2018 12:39:30 +0000 (14:39 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Fri, 22 Jun 2018 15:47:10 +0000 (17:47 +0200)
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/vulkan/radv_device.c

index 681d8a12c75a9d061f5178ced47599e85e5dd7e7..b72b5d969df82f3b5d40b7dcccf04e75762b17d2 100644 (file)
@@ -3175,6 +3175,7 @@ radv_sparse_image_opaque_bind_memory(struct radv_device *device,
        struct radeon_winsys_fence *base_fence = fence ? fence->fence : NULL;
        bool fence_emitted = false;
        VkResult result;
+       int ret;
 
        for (uint32_t i = 0; i < bindInfoCount; ++i) {
                struct radv_winsys_sem_info sem_info;
@@ -3200,11 +3201,16 @@ radv_sparse_image_opaque_bind_memory(struct radv_device *device,
                        return result;
 
                if (pBindInfo[i].waitSemaphoreCount || pBindInfo[i].signalSemaphoreCount) {
-                       queue->device->ws->cs_submit(queue->hw_ctx, queue->queue_idx,
-                                                    &queue->device->empty_cs[queue->queue_family_index],
-                                                    1, NULL, NULL,
-                                                    &sem_info, NULL,
-                                                    false, base_fence);
+                       ret = queue->device->ws->cs_submit(queue->hw_ctx, queue->queue_idx,
+                                                         &queue->device->empty_cs[queue->queue_family_index],
+                                                         1, NULL, NULL,
+                                                         &sem_info, NULL,
+                                                         false, base_fence);
+                       if (ret) {
+                               radv_loge("failed to submit CS %d\n", i);
+                               abort();
+                       }
+
                        fence_emitted = true;
                        if (fence)
                                fence->submitted = true;