summaryrefslogtreecommitdiffstats
path: root/src/intel/vulkan/anv_private.h
diff options
context:
space:
mode:
authorTapani Pälli <[email protected]>2017-08-23 11:25:57 +0300
committerTapani Pälli <[email protected]>2017-09-12 09:39:29 +0300
commit086cfa5652ec202f87c14d11e0f6c959d75987d8 (patch)
tree8d64eee5da48c69e7bddc0b0e60f805800dfba09 /src/intel/vulkan/anv_private.h
parentab6f874439943837c06d3346385f75145e6d2775 (diff)
anv: implementation of VK_EXT_debug_report extension
Patch adds required functionality for extension to manage a list of application provided callbacks and handle debug reporting from driver and application side. v2: remove useless helper anv_debug_report_call add locking around callbacks list use vk_alloc2, vk_free2 refactor CreateDebugReportCallbackEXT fix bugs found with crucible testing v3: provide ANV_FROM_HANDLE and use it misc fixes for issues Jason found use vk_find_struct_const for finding ctor_cb Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/intel/vulkan/anv_private.h')
-rw-r--r--src/intel/vulkan/anv_private.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h
index 674bc28cc02..1b71093f949 100644
--- a/src/intel/vulkan/anv_private.h
+++ b/src/intel/vulkan/anv_private.h
@@ -61,6 +61,8 @@ typedef uint32_t xcb_window_t;
struct anv_buffer;
struct anv_buffer_view;
struct anv_image_view;
+struct anv_instance;
+struct anv_debug_report_callback;
struct gen_l3_config;
@@ -237,6 +239,15 @@ void __anv_perf_warn(const char *file, int line, const char *format, ...)
void anv_loge(const char *format, ...) anv_printflike(1, 2);
void anv_loge_v(const char *format, va_list va);
+void anv_debug_report(struct anv_instance *instance,
+ VkDebugReportFlagsEXT flags,
+ VkDebugReportObjectTypeEXT object_type,
+ uint64_t handle,
+ size_t location,
+ int32_t messageCode,
+ const char* pLayerPrefix,
+ const char *pMessage);
+
/**
* Print a FINISHME message, including its source location.
*/
@@ -666,6 +677,14 @@ struct anv_physical_device {
int local_fd;
};
+struct anv_debug_report_callback {
+ /* Link in the 'callbacks' list in anv_instance struct. */
+ struct list_head link;
+ VkDebugReportFlagsEXT flags;
+ PFN_vkDebugReportCallbackEXT callback;
+ void * data;
+};
+
struct anv_instance {
VK_LOADER_DATA _loader_data;
@@ -674,6 +693,11 @@ struct anv_instance {
uint32_t apiVersion;
int physicalDeviceCount;
struct anv_physical_device physicalDevice;
+
+ /* VK_EXT_debug_report debug callbacks */
+ pthread_mutex_t callbacks_mutex;
+ struct list_head callbacks;
+ struct anv_debug_report_callback destroy_debug_cb;
};
VkResult anv_init_wsi(struct anv_physical_device *physical_device);
@@ -2493,6 +2517,7 @@ ANV_DEFINE_NONDISP_HANDLE_CASTS(anv_render_pass, VkRenderPass)
ANV_DEFINE_NONDISP_HANDLE_CASTS(anv_sampler, VkSampler)
ANV_DEFINE_NONDISP_HANDLE_CASTS(anv_semaphore, VkSemaphore)
ANV_DEFINE_NONDISP_HANDLE_CASTS(anv_shader_module, VkShaderModule)
+ANV_DEFINE_NONDISP_HANDLE_CASTS(anv_debug_report_callback, VkDebugReportCallbackEXT)
/* Gen-specific function declarations */
#ifdef genX