Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 1 | #ifndef __VKDBG_H__ |
| 2 | #define __VKDBG_H__ |
Chia-I Wu | 68a5524 | 2014-08-01 11:18:21 +0800 | [diff] [blame] | 3 | |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 4 | #include <vulkan.h> |
Chia-I Wu | 68a5524 | 2014-08-01 11:18:21 +0800 | [diff] [blame] | 5 | |
| 6 | #ifdef __cplusplus |
| 7 | extern "C" |
| 8 | { |
| 9 | #endif // __cplusplus |
| 10 | |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 11 | typedef enum _VK_DBG_MSG_TYPE |
Chia-I Wu | 68a5524 | 2014-08-01 11:18:21 +0800 | [diff] [blame] | 12 | { |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 13 | VK_DBG_MSG_UNKNOWN = 0x0, |
| 14 | VK_DBG_MSG_ERROR = 0x1, |
| 15 | VK_DBG_MSG_WARNING = 0x2, |
| 16 | VK_DBG_MSG_PERF_WARNING = 0x3, |
Chia-I Wu | 68a5524 | 2014-08-01 11:18:21 +0800 | [diff] [blame] | 17 | |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 18 | VK_DBG_MSG_TYPE_BEGIN_RANGE = VK_DBG_MSG_UNKNOWN, |
| 19 | VK_DBG_MSG_TYPE_END_RANGE = VK_DBG_MSG_PERF_WARNING, |
| 20 | VK_NUM_DBG_MSG_TYPE = (VK_DBG_MSG_TYPE_END_RANGE - VK_DBG_MSG_TYPE_BEGIN_RANGE + 1), |
| 21 | } VK_DBG_MSG_TYPE; |
Chia-I Wu | 68a5524 | 2014-08-01 11:18:21 +0800 | [diff] [blame] | 22 | |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 23 | typedef enum _VK_DBG_MSG_FILTER |
Chia-I Wu | 68a5524 | 2014-08-01 11:18:21 +0800 | [diff] [blame] | 24 | { |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 25 | VK_DBG_MSG_FILTER_NONE = 0x0, |
| 26 | VK_DBG_MSG_FILTER_REPEATED = 0x1, |
| 27 | VK_DBG_MSG_FILTER_ALL = 0x2, |
Chia-I Wu | 68a5524 | 2014-08-01 11:18:21 +0800 | [diff] [blame] | 28 | |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 29 | VK_DBG_MSG_FILTER_BEGIN_RANGE = VK_DBG_MSG_FILTER_NONE, |
| 30 | VK_DBG_MSG_FILTER_END_RANGE = VK_DBG_MSG_FILTER_ALL, |
| 31 | VK_NUM_DBG_MSG_FILTER = (VK_DBG_MSG_FILTER_END_RANGE - VK_DBG_MSG_FILTER_BEGIN_RANGE + 1), |
| 32 | } VK_DBG_MSG_FILTER; |
Chia-I Wu | 68a5524 | 2014-08-01 11:18:21 +0800 | [diff] [blame] | 33 | |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 34 | typedef enum _VK_DBG_GLOBAL_OPTION |
Chia-I Wu | 68a5524 | 2014-08-01 11:18:21 +0800 | [diff] [blame] | 35 | { |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 36 | VK_DBG_OPTION_DEBUG_ECHO_ENABLE = 0x0, |
| 37 | VK_DBG_OPTION_BREAK_ON_ERROR = 0x1, |
| 38 | VK_DBG_OPTION_BREAK_ON_WARNING = 0x2, |
Chia-I Wu | 68a5524 | 2014-08-01 11:18:21 +0800 | [diff] [blame] | 39 | |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 40 | VK_DBG_GLOBAL_OPTION_BEGIN_RANGE = VK_DBG_OPTION_DEBUG_ECHO_ENABLE, |
| 41 | VK_DBG_GLOBAL_OPTION_END_RANGE = VK_DBG_OPTION_BREAK_ON_WARNING, |
| 42 | VK_NUM_DBG_GLOBAL_OPTION = (VK_DBG_GLOBAL_OPTION_END_RANGE - VK_DBG_GLOBAL_OPTION_BEGIN_RANGE + 1), |
| 43 | } VK_DBG_GLOBAL_OPTION; |
Chia-I Wu | 68a5524 | 2014-08-01 11:18:21 +0800 | [diff] [blame] | 44 | |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 45 | typedef enum _VK_DBG_DEVICE_OPTION |
Chia-I Wu | 68a5524 | 2014-08-01 11:18:21 +0800 | [diff] [blame] | 46 | { |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 47 | VK_DBG_OPTION_DISABLE_PIPELINE_LOADS = 0x0, |
| 48 | VK_DBG_OPTION_FORCE_OBJECT_MEMORY_REQS = 0x1, |
| 49 | VK_DBG_OPTION_FORCE_LARGE_IMAGE_ALIGNMENT = 0x2, |
Chia-I Wu | 68a5524 | 2014-08-01 11:18:21 +0800 | [diff] [blame] | 50 | |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 51 | VK_DBG_DEVICE_OPTION_BEGIN_RANGE = VK_DBG_OPTION_DISABLE_PIPELINE_LOADS, |
| 52 | VK_DBG_DEVICE_OPTION_END_RANGE = VK_DBG_OPTION_FORCE_LARGE_IMAGE_ALIGNMENT, |
| 53 | VK_NUM_DBG_DEVICE_OPTION = (VK_DBG_DEVICE_OPTION_END_RANGE - VK_DBG_DEVICE_OPTION_BEGIN_RANGE + 1), |
| 54 | } VK_DBG_DEVICE_OPTION; |
Chia-I Wu | 68a5524 | 2014-08-01 11:18:21 +0800 | [diff] [blame] | 55 | |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 56 | typedef enum _VK_DBG_OBJECT_TYPE |
Chia-I Wu | 450a423 | 2014-08-05 14:50:53 +0800 | [diff] [blame] | 57 | { |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 58 | VK_DBG_OBJECT_UNKNOWN = 0x00, |
| 59 | VK_DBG_OBJECT_DEVICE = 0x01, |
| 60 | VK_DBG_OBJECT_QUEUE = 0x02, |
| 61 | VK_DBG_OBJECT_GPU_MEMORY = 0x03, |
| 62 | VK_DBG_OBJECT_IMAGE = 0x04, |
| 63 | VK_DBG_OBJECT_IMAGE_VIEW = 0x05, |
| 64 | VK_DBG_OBJECT_COLOR_TARGET_VIEW = 0x06, |
| 65 | VK_DBG_OBJECT_DEPTH_STENCIL_VIEW = 0x07, |
| 66 | VK_DBG_OBJECT_SHADER = 0x08, |
| 67 | VK_DBG_OBJECT_GRAPHICS_PIPELINE = 0x09, |
| 68 | VK_DBG_OBJECT_COMPUTE_PIPELINE = 0x0a, |
| 69 | VK_DBG_OBJECT_SAMPLER = 0x0b, |
| 70 | VK_DBG_OBJECT_DESCRIPTOR_SET = 0x0c, |
| 71 | VK_DBG_OBJECT_VIEWPORT_STATE = 0x0d, |
| 72 | VK_DBG_OBJECT_RASTER_STATE = 0x0e, |
| 73 | VK_DBG_OBJECT_MSAA_STATE = 0x0f, |
| 74 | VK_DBG_OBJECT_COLOR_BLEND_STATE = 0x10, |
| 75 | VK_DBG_OBJECT_DEPTH_STENCIL_STATE = 0x11, |
| 76 | VK_DBG_OBJECT_CMD_BUFFER = 0x12, |
| 77 | VK_DBG_OBJECT_FENCE = 0x13, |
| 78 | VK_DBG_OBJECT_SEMAPHORE = 0x14, |
| 79 | VK_DBG_OBJECT_EVENT = 0x15, |
| 80 | VK_DBG_OBJECT_QUERY_POOL = 0x16, |
| 81 | VK_DBG_OBJECT_SHARED_GPU_MEMORY = 0x17, |
| 82 | VK_DBG_OBJECT_SHARED_SEMAPHORE = 0x18, |
| 83 | VK_DBG_OBJECT_PEER_GPU_MEMORY = 0x19, |
| 84 | VK_DBG_OBJECT_PEER_IMAGE = 0x1a, |
| 85 | VK_DBG_OBJECT_PINNED_GPU_MEMORY = 0x1b, |
| 86 | VK_DBG_OBJECT_INTERNAL_GPU_MEMORY = 0x1c, |
| 87 | VK_DBG_OBJECT_FRAMEBUFFER = 0x1d, |
| 88 | VK_DBG_OBJECT_RENDER_PASS = 0x1e, |
Chia-I Wu | 450a423 | 2014-08-05 14:50:53 +0800 | [diff] [blame] | 89 | |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 90 | VK_DBG_OBJECT_INSTANCE, |
| 91 | VK_DBG_OBJECT_BUFFER, |
| 92 | VK_DBG_OBJECT_BUFFER_VIEW, |
| 93 | VK_DBG_OBJECT_DESCRIPTOR_SET_LAYOUT, |
| 94 | VK_DBG_OBJECT_DESCRIPTOR_SET_LAYOUT_CHAIN, |
| 95 | VK_DBG_OBJECT_DESCRIPTOR_POOL, |
Chia-I Wu | 1a28fe0 | 2015-01-01 07:55:04 +0800 | [diff] [blame] | 96 | |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 97 | VK_DBG_OBJECT_TYPE_BEGIN_RANGE = VK_DBG_OBJECT_UNKNOWN, |
| 98 | VK_DBG_OBJECT_TYPE_END_RANGE = VK_DBG_OBJECT_DESCRIPTOR_POOL, |
| 99 | VK_NUM_DBG_OBJECT_TYPE = (VK_DBG_OBJECT_TYPE_END_RANGE - VK_DBG_OBJECT_TYPE_BEGIN_RANGE + 1), |
| 100 | } VK_DBG_OBJECT_TYPE; |
Chia-I Wu | 450a423 | 2014-08-05 14:50:53 +0800 | [diff] [blame] | 101 | |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 102 | typedef void (VKAPI *VK_DBG_MSG_CALLBACK_FUNCTION)( |
| 103 | VK_DBG_MSG_TYPE msgType, |
| 104 | VK_VALIDATION_LEVEL validationLevel, |
| 105 | VK_BASE_OBJECT srcObject, |
Mark Lobodzinski | 17caf57 | 2015-01-29 08:55:56 -0600 | [diff] [blame] | 106 | size_t location, |
| 107 | int32_t msgCode, |
| 108 | const char* pMsg, |
| 109 | void* pUserData); |
Chia-I Wu | 68a5524 | 2014-08-01 11:18:21 +0800 | [diff] [blame] | 110 | |
| 111 | // Debug functions |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 112 | typedef VK_RESULT (VKAPI *vkDbgSetValidationLevelType)(VK_DEVICE device, VK_VALIDATION_LEVEL validationLevel); |
| 113 | typedef VK_RESULT (VKAPI *vkDbgRegisterMsgCallbackType)(VK_INSTANCE instance, VK_DBG_MSG_CALLBACK_FUNCTION pfnMsgCallback, void* pUserData); |
| 114 | typedef VK_RESULT (VKAPI *vkDbgUnregisterMsgCallbackType)(VK_INSTANCE instance, VK_DBG_MSG_CALLBACK_FUNCTION pfnMsgCallback); |
| 115 | typedef VK_RESULT (VKAPI *vkDbgSetMessageFilterType)(VK_DEVICE device, int32_t msgCode, VK_DBG_MSG_FILTER filter); |
| 116 | typedef VK_RESULT (VKAPI *vkDbgSetObjectTagType)(VK_BASE_OBJECT object, size_t tagSize, const void* pTag); |
| 117 | typedef VK_RESULT (VKAPI *vkDbgSetGlobalOptionType)(VK_INSTANCE instance, VK_DBG_GLOBAL_OPTION dbgOption, size_t dataSize, const void* pData); |
| 118 | typedef VK_RESULT (VKAPI *vkDbgSetDeviceOptionType)(VK_DEVICE device, VK_DBG_DEVICE_OPTION dbgOption, size_t dataSize, const void* pData); |
| 119 | typedef void (VKAPI *vkCmdDbgMarkerBeginType)(VK_CMD_BUFFER cmdBuffer, const char* pMarker); |
| 120 | typedef void (VKAPI *vkCmdDbgMarkerEndType)(VK_CMD_BUFFER cmdBuffer); |
Chia-I Wu | 68a5524 | 2014-08-01 11:18:21 +0800 | [diff] [blame] | 121 | |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 122 | #ifdef VK_PROTOTYPES |
| 123 | VK_RESULT VKAPI vkDbgSetValidationLevel( |
| 124 | VK_DEVICE device, |
| 125 | VK_VALIDATION_LEVEL validationLevel); |
Chia-I Wu | 68a5524 | 2014-08-01 11:18:21 +0800 | [diff] [blame] | 126 | |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 127 | VK_RESULT VKAPI vkDbgRegisterMsgCallback( |
| 128 | VK_INSTANCE instance, |
| 129 | VK_DBG_MSG_CALLBACK_FUNCTION pfnMsgCallback, |
Mark Lobodzinski | 17caf57 | 2015-01-29 08:55:56 -0600 | [diff] [blame] | 130 | void* pUserData); |
Chia-I Wu | 68a5524 | 2014-08-01 11:18:21 +0800 | [diff] [blame] | 131 | |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 132 | VK_RESULT VKAPI vkDbgUnregisterMsgCallback( |
| 133 | VK_INSTANCE instance, |
| 134 | VK_DBG_MSG_CALLBACK_FUNCTION pfnMsgCallback); |
Chia-I Wu | 68a5524 | 2014-08-01 11:18:21 +0800 | [diff] [blame] | 135 | |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 136 | VK_RESULT VKAPI vkDbgSetMessageFilter( |
| 137 | VK_DEVICE device, |
Mark Lobodzinski | 17caf57 | 2015-01-29 08:55:56 -0600 | [diff] [blame] | 138 | int32_t msgCode, |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 139 | VK_DBG_MSG_FILTER filter); |
Chia-I Wu | 68a5524 | 2014-08-01 11:18:21 +0800 | [diff] [blame] | 140 | |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 141 | VK_RESULT VKAPI vkDbgSetObjectTag( |
| 142 | VK_BASE_OBJECT object, |
Mark Lobodzinski | 17caf57 | 2015-01-29 08:55:56 -0600 | [diff] [blame] | 143 | size_t tagSize, |
| 144 | const void* pTag); |
Chia-I Wu | 68a5524 | 2014-08-01 11:18:21 +0800 | [diff] [blame] | 145 | |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 146 | VK_RESULT VKAPI vkDbgSetGlobalOption( |
| 147 | VK_INSTANCE instance, |
| 148 | VK_DBG_GLOBAL_OPTION dbgOption, |
Mark Lobodzinski | 17caf57 | 2015-01-29 08:55:56 -0600 | [diff] [blame] | 149 | size_t dataSize, |
| 150 | const void* pData); |
Chia-I Wu | 68a5524 | 2014-08-01 11:18:21 +0800 | [diff] [blame] | 151 | |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 152 | VK_RESULT VKAPI vkDbgSetDeviceOption( |
| 153 | VK_DEVICE device, |
| 154 | VK_DBG_DEVICE_OPTION dbgOption, |
Mark Lobodzinski | 17caf57 | 2015-01-29 08:55:56 -0600 | [diff] [blame] | 155 | size_t dataSize, |
| 156 | const void* pData); |
Chia-I Wu | 68a5524 | 2014-08-01 11:18:21 +0800 | [diff] [blame] | 157 | |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 158 | void VKAPI vkCmdDbgMarkerBegin( |
| 159 | VK_CMD_BUFFER cmdBuffer, |
Mark Lobodzinski | 17caf57 | 2015-01-29 08:55:56 -0600 | [diff] [blame] | 160 | const char* pMarker); |
Chia-I Wu | 68a5524 | 2014-08-01 11:18:21 +0800 | [diff] [blame] | 161 | |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 162 | void VKAPI vkCmdDbgMarkerEnd( |
| 163 | VK_CMD_BUFFER cmdBuffer); |
Chia-I Wu | 68a5524 | 2014-08-01 11:18:21 +0800 | [diff] [blame] | 164 | |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 165 | #endif // VK_PROTOTYPES |
Jon Ashburn | bd03c35 | 2015-04-06 17:38:17 -0600 | [diff] [blame] | 166 | |
Chia-I Wu | 68a5524 | 2014-08-01 11:18:21 +0800 | [diff] [blame] | 167 | #ifdef __cplusplus |
| 168 | }; // extern "C" |
| 169 | #endif // __cplusplus |
| 170 | |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 171 | #endif // __VKDBG_H__ |