vulkan/overlay: update remaining manual error checks
Through a series of rebases, I forgot to switch a bunch of error checks to use a macro that will show where the problem is, rather than printing out a dumb "ERROR!". Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
This commit is contained in:
@@ -312,12 +312,6 @@ free_chain(struct VkBaseOutStructure *chain)
|
|||||||
|
|
||||||
/**/
|
/**/
|
||||||
|
|
||||||
static void check_vk_result(VkResult err)
|
|
||||||
{
|
|
||||||
if (err != VK_SUCCESS)
|
|
||||||
printf("ERROR!\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
static struct instance_data *new_instance_data(VkInstance instance)
|
static struct instance_data *new_instance_data(VkInstance instance)
|
||||||
{
|
{
|
||||||
struct instance_data *data = rzalloc(NULL, struct instance_data);
|
struct instance_data *data = rzalloc(NULL, struct instance_data);
|
||||||
@@ -385,11 +379,10 @@ static struct queue_data *new_queue_data(VkQueue queue,
|
|||||||
VkFenceCreateInfo fence_info = {};
|
VkFenceCreateInfo fence_info = {};
|
||||||
fence_info.sType = VK_STRUCTURE_TYPE_FENCE_CREATE_INFO;
|
fence_info.sType = VK_STRUCTURE_TYPE_FENCE_CREATE_INFO;
|
||||||
fence_info.flags = VK_FENCE_CREATE_SIGNALED_BIT;
|
fence_info.flags = VK_FENCE_CREATE_SIGNALED_BIT;
|
||||||
VkResult err = device_data->vtable.CreateFence(device_data->device,
|
VK_CHECK(device_data->vtable.CreateFence(device_data->device,
|
||||||
&fence_info,
|
&fence_info,
|
||||||
NULL,
|
NULL,
|
||||||
&data->queries_fence);
|
&data->queries_fence));
|
||||||
check_vk_result(err);
|
|
||||||
|
|
||||||
if (data->flags & VK_QUEUE_GRAPHICS_BIT)
|
if (data->flags & VK_QUEUE_GRAPHICS_BIT)
|
||||||
device_data->graphic_queue = data;
|
device_data->graphic_queue = data;
|
||||||
@@ -1584,15 +1577,12 @@ static VkResult overlay_QueuePresentKHR(
|
|||||||
/* Before getting the query results, make sure the operations have
|
/* Before getting the query results, make sure the operations have
|
||||||
* completed.
|
* completed.
|
||||||
*/
|
*/
|
||||||
VkResult err = device_data->vtable.ResetFences(device_data->device,
|
VK_CHECK(device_data->vtable.ResetFences(device_data->device,
|
||||||
1, &queue_data->queries_fence);
|
1, &queue_data->queries_fence));
|
||||||
check_vk_result(err);
|
VK_CHECK(device_data->vtable.QueueSubmit(queue, 0, NULL, queue_data->queries_fence));
|
||||||
err = device_data->vtable.QueueSubmit(queue, 0, NULL, queue_data->queries_fence);
|
VK_CHECK(device_data->vtable.WaitForFences(device_data->device,
|
||||||
check_vk_result(err);
|
|
||||||
err = device_data->vtable.WaitForFences(device_data->device,
|
|
||||||
1, &queue_data->queries_fence,
|
1, &queue_data->queries_fence,
|
||||||
VK_FALSE, UINT64_MAX);
|
VK_FALSE, UINT64_MAX));
|
||||||
check_vk_result(err);
|
|
||||||
|
|
||||||
/* Now get the results. */
|
/* Now get the results. */
|
||||||
list_for_each_entry_safe(struct command_buffer_data, cmd_buffer_data,
|
list_for_each_entry_safe(struct command_buffer_data, cmd_buffer_data,
|
||||||
@@ -1601,13 +1591,11 @@ static VkResult overlay_QueuePresentKHR(
|
|||||||
|
|
||||||
if (cmd_buffer_data->pipeline_query_pool) {
|
if (cmd_buffer_data->pipeline_query_pool) {
|
||||||
memset(query_results, 0, sizeof(query_results));
|
memset(query_results, 0, sizeof(query_results));
|
||||||
err =
|
VK_CHECK(device_data->vtable.GetQueryPoolResults(device_data->device,
|
||||||
device_data->vtable.GetQueryPoolResults(device_data->device,
|
|
||||||
cmd_buffer_data->pipeline_query_pool,
|
cmd_buffer_data->pipeline_query_pool,
|
||||||
cmd_buffer_data->query_index, 1,
|
cmd_buffer_data->query_index, 1,
|
||||||
sizeof(uint32_t) * OVERLAY_QUERY_COUNT,
|
sizeof(uint32_t) * OVERLAY_QUERY_COUNT,
|
||||||
query_results, 0, VK_QUERY_RESULT_WAIT_BIT);
|
query_results, 0, VK_QUERY_RESULT_WAIT_BIT));
|
||||||
check_vk_result(err);
|
|
||||||
|
|
||||||
for (uint32_t i = OVERLAY_PARAM_ENABLED_vertices;
|
for (uint32_t i = OVERLAY_PARAM_ENABLED_vertices;
|
||||||
i <= OVERLAY_PARAM_ENABLED_compute_invocations; i++) {
|
i <= OVERLAY_PARAM_ENABLED_compute_invocations; i++) {
|
||||||
@@ -1616,13 +1604,11 @@ static VkResult overlay_QueuePresentKHR(
|
|||||||
}
|
}
|
||||||
if (cmd_buffer_data->timestamp_query_pool) {
|
if (cmd_buffer_data->timestamp_query_pool) {
|
||||||
uint64_t gpu_timestamps[2] = { 0 };
|
uint64_t gpu_timestamps[2] = { 0 };
|
||||||
err =
|
VK_CHECK(device_data->vtable.GetQueryPoolResults(device_data->device,
|
||||||
device_data->vtable.GetQueryPoolResults(device_data->device,
|
|
||||||
cmd_buffer_data->timestamp_query_pool,
|
cmd_buffer_data->timestamp_query_pool,
|
||||||
cmd_buffer_data->query_index * 2, 2,
|
cmd_buffer_data->query_index * 2, 2,
|
||||||
2 * sizeof(uint64_t), gpu_timestamps, sizeof(uint64_t),
|
2 * sizeof(uint64_t), gpu_timestamps, sizeof(uint64_t),
|
||||||
VK_QUERY_RESULT_WAIT_BIT | VK_QUERY_RESULT_64_BIT);
|
VK_QUERY_RESULT_WAIT_BIT | VK_QUERY_RESULT_64_BIT));
|
||||||
check_vk_result(err);
|
|
||||||
|
|
||||||
gpu_timestamps[0] &= queue_data->timestamp_mask;
|
gpu_timestamps[0] &= queue_data->timestamp_mask;
|
||||||
gpu_timestamps[1] &= queue_data->timestamp_mask;
|
gpu_timestamps[1] &= queue_data->timestamp_mask;
|
||||||
@@ -1998,10 +1984,8 @@ static VkResult overlay_AllocateCommandBuffers(
|
|||||||
pAllocateInfo->commandBufferCount,
|
pAllocateInfo->commandBufferCount,
|
||||||
overlay_query_flags,
|
overlay_query_flags,
|
||||||
};
|
};
|
||||||
VkResult err =
|
VK_CHECK(device_data->vtable.CreateQueryPool(device_data->device, &pool_info,
|
||||||
device_data->vtable.CreateQueryPool(device_data->device, &pool_info,
|
NULL, &pipeline_query_pool));
|
||||||
NULL, &pipeline_query_pool);
|
|
||||||
check_vk_result(err);
|
|
||||||
}
|
}
|
||||||
if (device_data->instance->params.enabled[OVERLAY_PARAM_ENABLED_gpu_timing]) {
|
if (device_data->instance->params.enabled[OVERLAY_PARAM_ENABLED_gpu_timing]) {
|
||||||
VkQueryPoolCreateInfo pool_info = {
|
VkQueryPoolCreateInfo pool_info = {
|
||||||
@@ -2012,10 +1996,8 @@ static VkResult overlay_AllocateCommandBuffers(
|
|||||||
pAllocateInfo->commandBufferCount * 2,
|
pAllocateInfo->commandBufferCount * 2,
|
||||||
0,
|
0,
|
||||||
};
|
};
|
||||||
VkResult err =
|
VK_CHECK(device_data->vtable.CreateQueryPool(device_data->device, &pool_info,
|
||||||
device_data->vtable.CreateQueryPool(device_data->device, &pool_info,
|
NULL, ×tamp_query_pool));
|
||||||
NULL, ×tamp_query_pool);
|
|
||||||
check_vk_result(err);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (uint32_t i = 0; i < pAllocateInfo->commandBufferCount; i++) {
|
for (uint32_t i = 0; i < pAllocateInfo->commandBufferCount; i++) {
|
||||||
|
Reference in New Issue
Block a user