Kohi Game Engine
vulkan_utils.h
Go to the documentation of this file.
1 
12 #pragma once
13 #include "vulkan_types.h"
14 
22 const char* vulkan_result_string(VkResult result, b8 get_extended);
23 
29 b8 vulkan_result_is_success(VkResult result);
30 
31 #if defined(_DEBUG)
32 void vulkan_set_debug_object_name(vulkan_context* context, VkObjectType object_type, void* object_handle, const char* object_name);
33 void vulkan_set_debug_object_tag(vulkan_context* context, VkObjectType object_type, void* object_handle, u64 tag_size, const void* tag_data);
34 void vulkan_begin_label(vulkan_context* context, VkCommandBuffer buffer, const char* label_name, vec4 colour);
35 void vulkan_end_label(vulkan_context* context, VkCommandBuffer buffer);
36 
37 #define VK_SET_DEBUG_OBJECT_NAME(context, object_type, object_handle, object_name) vulkan_set_debug_object_name(context, object_type, object_handle, object_name)
38 #define VK_SET_DEBUG_OBJECT_TAG(context, object_type, object_handle, tag_size, tag_data) vulkan_set_debug_object_tag(context, object_type, object_handle, tag_size, tag_data)
39 #define VK_BEGIN_DEBUG_LABEL(context, command_buffer, label_name, colour) vulkan_begin_label(context, command_buffer, label_name, colour)
40 #define VK_END_DEBUG_LABEL(context, command_buffer) vulkan_end_label(context, command_buffer)
41 #else
42 // Does nothing in non-debug builds.
43 #define VK_SET_DEBUG_OBJECT_NAME(context, object_type, object_handle, object_name)
44 // Does nothing in non-debug builds.
45 #define VK_SET_DEBUG_OBJECT_TAG(context, object_type, object_handle, tag_size, tag_data)
46 // Does nothing in non-debug builds.
47 #define VK_BEGIN_DEBUG_LABEL(context, command_buffer, label_name, colour)
48 // Does nothing in non-debug builds.
49 #define VK_END_DEBUG_LABEL(context, command_buffer)
50 #endif
_Bool b8
8-bit boolean type
Definition: defines.h:58
unsigned long long u64
Unsigned 64-bit integer.
Definition: defines.h:28
The overall Vulkan context for the backend. Holds and maintains global renderer backend state,...
Definition: vulkan_types.h:564
A 4-element vector.
Definition: math_types.h:89
This file contains a collection fo Vulkan-specific types used for the Vulkan backend.
const char * vulkan_result_string(VkResult result, b8 get_extended)
Returns the string representation of result.
b8 vulkan_result_is_success(VkResult result)
Inticates if the passed result is a success or an error as defined by the Vulkan spec.