X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fgraphics%2Fvkxlib%2Fvulkancontext.cpp;h=f25349974c8adfd3d47b1bb44ad5a1a9737d2b4f;hb=fc345700e4d49b85e6d1029e8a0f5f442bc5280d;hp=51a623b8e2b15ddc1bd74e66b14fde7324292158;hpb=6e46970b67a6b53d13db97aaf6ea7690e8774c83;p=libs%2Fgui.git diff --git a/source/graphics/vkxlib/vulkancontext.cpp b/source/graphics/vkxlib/vulkancontext.cpp index 51a623b..f253499 100644 --- a/source/graphics/vkxlib/vulkancontext.cpp +++ b/source/graphics/vkxlib/vulkancontext.cpp @@ -3,6 +3,7 @@ #define VK_USE_PLATFORM_XLIB_KHR #include #include +#include #include #include "display_private.h" #include "vulkancontext.h" @@ -63,7 +64,8 @@ string vulkan_error::get_error_message(unsigned code) VulkanOptions::VulkanOptions(): enable_validation(false), enable_debug_report(false), - enable_geometry_shader(false) + enable_geometry_shader(false), + enable_tessellation_shader(false) { } @@ -121,7 +123,7 @@ void VulkanContext::platform_init(const VulkanOptions &opts) { VkDebugReportCallbackCreateInfoEXT debug_report_create_info = { }; debug_report_create_info.sType = VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT; - debug_report_create_info.flags = VK_DEBUG_REPORT_WARNING_BIT_EXT|VK_DEBUG_REPORT_ERROR_BIT_EXT|VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT; + debug_report_create_info.flags = VK_DEBUG_REPORT_WARNING_BIT_EXT|VK_DEBUG_REPORT_ERROR_BIT_EXT|VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT|VK_DEBUG_REPORT_INFORMATION_BIT_EXT; debug_report_create_info.pfnCallback = &Private::debug_report_func; debug_report_create_info.pUserData = this; @@ -199,6 +201,7 @@ void VulkanContext::platform_init(const VulkanOptions &opts) VkPhysicalDeviceFeatures features = { }; features.geometryShader = (opts.enable_geometry_shader ? VK_TRUE : VK_FALSE); + features.tessellationShader = (opts.enable_tessellation_shader ? VK_TRUE : VK_FALSE); VkDeviceCreateInfo device_create_info = { }; device_create_info.sType = VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO; @@ -254,9 +257,11 @@ VulkanContext::Private::Private(): debug_report_callback(0) { } -VkBool32 VulkanContext::Private::debug_report_func(VkDebugReportFlagsEXT, VkDebugReportObjectTypeEXT obj_type, uint64_t obj_id, size_t, int32_t, const char *layer_prefix, const char *message, void *) +VkBool32 VulkanContext::Private::debug_report_func(VkDebugReportFlagsEXT flags, VkDebugReportObjectTypeEXT, uint64_t, size_t, int32_t, const char *, const char *message, void *) { - IO::print(IO::cerr, "Vulkan debug report from %s: Object %d of type %d: %s\n", layer_prefix, obj_type, obj_id, message); + IO::print(IO::cerr, "%s\n", message); + if((flags&VK_DEBUG_REPORT_ERROR_BIT_EXT) && Debug::check_debugger()==Debug::GDB) + Debug::debug_break(); return VK_FALSE; }