Skip to content

Commit

Permalink
Introduce vk-version of the funcpointers
Browse files Browse the repository at this point in the history
  • Loading branch information
asuessenbach committed Dec 11, 2024
1 parent 07cdcb9 commit 1a3a61d
Show file tree
Hide file tree
Showing 9 changed files with 769 additions and 272 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,14 @@
static char const * AppName = "CreateDebugReportMessenger";
static char const * EngineName = "Vulkan.hpp";

VKAPI_ATTR VkBool32 VKAPI_CALL debugMessageFunc( VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity,
VkDebugUtilsMessageTypeFlagsEXT messageTypes,
VkDebugUtilsMessengerCallbackDataEXT const * pCallbackData,
VKAPI_ATTR VkBool32 VKAPI_CALL debugMessageFunc( vk::DebugUtilsMessageSeverityFlagBitsEXT messageSeverity,
vk::DebugUtilsMessageTypeFlagsEXT messageTypes,
vk::DebugUtilsMessengerCallbackDataEXT const * pCallbackData,
void * /*pUserData*/ )
{
std::ostringstream message;

message << vk::to_string( static_cast<vk::DebugUtilsMessageSeverityFlagBitsEXT>( messageSeverity ) ) << ": "
<< vk::to_string( static_cast<vk::DebugUtilsMessageTypeFlagsEXT>( messageTypes ) ) << ":\n";
message << vk::to_string( messageSeverity ) << ": " << vk::to_string( messageTypes ) << ":\n";
message << std::string( "\t" ) << "messageIDName = <" << pCallbackData->pMessageIdName << ">\n";
message << std::string( "\t" ) << "messageIdNumber = " << pCallbackData->messageIdNumber << "\n";
message << std::string( "\t" ) << "message = <" << pCallbackData->pMessage << ">\n";
Expand All @@ -58,7 +57,7 @@ VKAPI_ATTR VkBool32 VKAPI_CALL debugMessageFunc( VkDebugUtilsMessageSeverityFlag
for ( uint32_t i = 0; i < pCallbackData->objectCount; i++ )
{
message << std::string( "\t\t" ) << "Object " << i << "\n";
message << std::string( "\t\t\t" ) << "objectType = " << vk::to_string( static_cast<vk::ObjectType>( pCallbackData->pObjects[i].objectType ) ) << "\n";
message << std::string( "\t\t\t" ) << "objectType = " << vk::to_string( pCallbackData->pObjects[i].objectType ) << "\n";
message << std::string( "\t\t\t" ) << "objectHandle = " << pCallbackData->pObjects[i].objectHandle << "\n";
if ( pCallbackData->pObjects[i].pObjectName )
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,14 @@ VKAPI_ATTR void VKAPI_CALL vkDestroyDebugUtilsMessengerEXT( VkInstance instance,
return pfnVkDestroyDebugUtilsMessengerEXT( instance, messenger, pAllocator );
}

VKAPI_ATTR VkBool32 VKAPI_CALL debugMessageFunc( VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity,
VkDebugUtilsMessageTypeFlagsEXT messageTypes,
VkDebugUtilsMessengerCallbackDataEXT const * pCallbackData,
VKAPI_ATTR VkBool32 VKAPI_CALL debugMessageFunc( vk::DebugUtilsMessageSeverityFlagBitsEXT messageSeverity,
vk::DebugUtilsMessageTypeFlagsEXT messageTypes,
vk::DebugUtilsMessengerCallbackDataEXT const * pCallbackData,
void * /*pUserData*/ )
{
std::string message;

message += vk::to_string( static_cast<vk::DebugUtilsMessageSeverityFlagBitsEXT>( messageSeverity ) ) + ": " +
vk::to_string( static_cast<vk::DebugUtilsMessageTypeFlagsEXT>( messageTypes ) ) + ":\n";
message += vk::to_string( messageSeverity ) + ": " + vk::to_string( messageTypes ) + ":\n";
message += std::string( "\t" ) + "messageIDName = <" + pCallbackData->pMessageIdName + ">\n";
message += std::string( "\t" ) + "messageIdNumber = " + std::to_string( pCallbackData->messageIdNumber ) + "\n";
message += std::string( "\t" ) + "message = <" + pCallbackData->pMessage + ">\n";
Expand All @@ -84,7 +83,7 @@ VKAPI_ATTR VkBool32 VKAPI_CALL debugMessageFunc( VkDebugUtilsMessageSeverityFlag
for ( uint32_t i = 0; i < pCallbackData->objectCount; i++ )
{
message += std::string( "\t" ) + "Object " + std::to_string( i ) + "\n";
message += std::string( "\t\t" ) + "objectType = " + vk::to_string( static_cast<vk::ObjectType>( pCallbackData->pObjects[i].objectType ) ) + "\n";
message += std::string( "\t\t" ) + "objectType = " + vk::to_string( pCallbackData->pObjects[i].objectType ) + "\n";
message += std::string( "\t\t" ) + "objectHandle = " + std::to_string( pCallbackData->pObjects[i].objectHandle ) + "\n";
if ( pCallbackData->pObjects[i].pObjectName )
{
Expand Down
Loading

0 comments on commit 1a3a61d

Please sign in to comment.