Introduce VULKAN_HPP_NO_TO_STRING to optionally remove the various vk::to_string functions.

Also extend the samples to hold some local version of the needed to_string functions in case VULKAN_HPP_NO_TO_STRING is defined.
This commit is contained in:
asuessenbach
2022-07-25 17:11:30 +02:00
parent 3610b08409
commit 527e52a1bd
24 changed files with 4170 additions and 1570 deletions

View File

@@ -26,6 +26,100 @@ static char const * EngineName = "Vulkan.hpp";
PFN_vkCreateDebugUtilsMessengerEXT pfnVkCreateDebugUtilsMessengerEXT;
PFN_vkDestroyDebugUtilsMessengerEXT pfnVkDestroyDebugUtilsMessengerEXT;
#if defined( VULKAN_HPP_NO_TO_STRING )
namespace local
{
std::string to_string( vk::DebugUtilsMessageSeverityFlagBitsEXT value )
{
switch ( value )
{
case vk::DebugUtilsMessageSeverityFlagBitsEXT::eVerbose: return "Verbose";
case vk::DebugUtilsMessageSeverityFlagBitsEXT::eInfo: return "Info";
case vk::DebugUtilsMessageSeverityFlagBitsEXT::eWarning: return "Warning";
case vk::DebugUtilsMessageSeverityFlagBitsEXT::eError: return "Error";
default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast<uint32_t>( value ) ) + " )";
}
}
std::string to_string( vk::DebugUtilsMessageTypeFlagsEXT value )
{
if ( !value )
return "{}";
std::string result;
if ( value & vk::DebugUtilsMessageTypeFlagBitsEXT::eGeneral )
result += "General | ";
if ( value & vk::DebugUtilsMessageTypeFlagBitsEXT::eValidation )
result += "Validation | ";
if ( value & vk::DebugUtilsMessageTypeFlagBitsEXT::ePerformance )
result += "Performance | ";
return "{ " + result.substr( 0, result.size() - 3 ) + " }";
}
std::string to_string( vk::ObjectType value )
{
switch ( value )
{
case vk::ObjectType::eUnknown: return "Unknown";
case vk::ObjectType::eInstance: return "Instance";
case vk::ObjectType::ePhysicalDevice: return "PhysicalDevice";
case vk::ObjectType::eDevice: return "Device";
case vk::ObjectType::eQueue: return "Queue";
case vk::ObjectType::eSemaphore: return "Semaphore";
case vk::ObjectType::eCommandBuffer: return "CommandBuffer";
case vk::ObjectType::eFence: return "Fence";
case vk::ObjectType::eDeviceMemory: return "DeviceMemory";
case vk::ObjectType::eBuffer: return "Buffer";
case vk::ObjectType::eImage: return "Image";
case vk::ObjectType::eEvent: return "Event";
case vk::ObjectType::eQueryPool: return "QueryPool";
case vk::ObjectType::eBufferView: return "BufferView";
case vk::ObjectType::eImageView: return "ImageView";
case vk::ObjectType::eShaderModule: return "ShaderModule";
case vk::ObjectType::ePipelineCache: return "PipelineCache";
case vk::ObjectType::ePipelineLayout: return "PipelineLayout";
case vk::ObjectType::eRenderPass: return "RenderPass";
case vk::ObjectType::ePipeline: return "Pipeline";
case vk::ObjectType::eDescriptorSetLayout: return "DescriptorSetLayout";
case vk::ObjectType::eSampler: return "Sampler";
case vk::ObjectType::eDescriptorPool: return "DescriptorPool";
case vk::ObjectType::eDescriptorSet: return "DescriptorSet";
case vk::ObjectType::eFramebuffer: return "Framebuffer";
case vk::ObjectType::eCommandPool: return "CommandPool";
case vk::ObjectType::eSamplerYcbcrConversion: return "SamplerYcbcrConversion";
case vk::ObjectType::eDescriptorUpdateTemplate: return "DescriptorUpdateTemplate";
case vk::ObjectType::ePrivateDataSlot: return "PrivateDataSlot";
case vk::ObjectType::eSurfaceKHR: return "SurfaceKHR";
case vk::ObjectType::eSwapchainKHR: return "SwapchainKHR";
case vk::ObjectType::eDisplayKHR: return "DisplayKHR";
case vk::ObjectType::eDisplayModeKHR: return "DisplayModeKHR";
case vk::ObjectType::eDebugReportCallbackEXT: return "DebugReportCallbackEXT";
# if defined( VK_ENABLE_BETA_EXTENSIONS )
case vk::ObjectType::eVideoSessionKHR: return "VideoSessionKHR";
case vk::ObjectType::eVideoSessionParametersKHR: return "VideoSessionParametersKHR";
# endif /*VK_ENABLE_BETA_EXTENSIONS*/
case vk::ObjectType::eCuModuleNVX: return "CuModuleNVX";
case vk::ObjectType::eCuFunctionNVX: return "CuFunctionNVX";
case vk::ObjectType::eDebugUtilsMessengerEXT: return "DebugUtilsMessengerEXT";
case vk::ObjectType::eAccelerationStructureKHR: return "AccelerationStructureKHR";
case vk::ObjectType::eValidationCacheEXT: return "ValidationCacheEXT";
case vk::ObjectType::eAccelerationStructureNV: return "AccelerationStructureNV";
case vk::ObjectType::ePerformanceConfigurationINTEL: return "PerformanceConfigurationINTEL";
case vk::ObjectType::eDeferredOperationKHR: return "DeferredOperationKHR";
case vk::ObjectType::eIndirectCommandsLayoutNV: return "IndirectCommandsLayoutNV";
# if defined( VK_USE_PLATFORM_FUCHSIA )
case vk::ObjectType::eBufferCollectionFUCHSIA: return "BufferCollectionFUCHSIA";
# endif /*VK_USE_PLATFORM_FUCHSIA*/
default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast<uint32_t>( value ) ) + " )";
}
}
} // namespace local
using local::to_string;
#else
using vk::to_string;
#endif
VKAPI_ATTR VkResult VKAPI_CALL vkCreateDebugUtilsMessengerEXT( VkInstance instance,
const VkDebugUtilsMessengerCreateInfoEXT * pCreateInfo,
const VkAllocationCallbacks * pAllocator,
@@ -46,50 +140,38 @@ VKAPI_ATTR VkBool32 VKAPI_CALL debugMessageFunc( VkDebugUtilsMessageSeverityFlag
{
std::ostringstream message;
message << vk::to_string( static_cast<vk::DebugUtilsMessageSeverityFlagBitsEXT>( messageSeverity ) ) << ": "
<< vk::to_string( static_cast<vk::DebugUtilsMessageTypeFlagsEXT>( messageTypes ) ) << ":\n";
message << "\t"
<< "messageIDName = <" << pCallbackData->pMessageIdName << ">\n";
message << "\t"
<< "messageIdNumber = " << pCallbackData->messageIdNumber << "\n";
message << "\t"
<< "message = <" << pCallbackData->pMessage << ">\n";
message << to_string( static_cast<vk::DebugUtilsMessageSeverityFlagBitsEXT>( messageSeverity ) ) << ": "
<< to_string( static_cast<vk::DebugUtilsMessageTypeFlagsEXT>( 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";
if ( 0 < pCallbackData->queueLabelCount )
{
message << "\t"
<< "Queue Labels:\n";
message << std::string( "\t" ) << "Queue Labels:\n";
for ( uint32_t i = 0; i < pCallbackData->queueLabelCount; i++ )
{
message << "\t\t"
<< "labelName = <" << pCallbackData->pQueueLabels[i].pLabelName << ">\n";
message << std::string( "\t\t" ) << "labelName = <" << pCallbackData->pQueueLabels[i].pLabelName << ">\n";
}
}
if ( 0 < pCallbackData->cmdBufLabelCount )
{
message << "\t"
<< "CommandBuffer Labels:\n";
message << std::string( "\t" ) << "CommandBuffer Labels:\n";
for ( uint32_t i = 0; i < pCallbackData->cmdBufLabelCount; i++ )
{
message << "\t\t"
<< "labelName = <" << pCallbackData->pCmdBufLabels[i].pLabelName << ">\n";
message << std::string( "\t\t" ) << "labelName = <" << pCallbackData->pCmdBufLabels[i].pLabelName << ">\n";
}
}
if ( 0 < pCallbackData->objectCount )
{
message << "\t"
<< "Objects:\n";
message << std::string( "\t" ) << "Objects:\n";
for ( uint32_t i = 0; i < pCallbackData->objectCount; i++ )
{
message << "\t\t"
<< "Object " << i << "\n";
message << "\t\t\t"
<< "objectType = " << vk::to_string( static_cast<vk::ObjectType>( pCallbackData->pObjects[i].objectType ) ) << "\n";
message << "\t\t\t"
<< "objectHandle = " << pCallbackData->pObjects[i].objectHandle << "\n";
message << std::string( "\t\t" ) << "Object " << i << "\n";
message << std::string( "\t\t\t" ) << "objectType = " << to_string( static_cast<vk::ObjectType>( pCallbackData->pObjects[i].objectType ) ) << "\n";
message << std::string( "\t\t\t" ) << "objectHandle = " << pCallbackData->pObjects[i].objectHandle << "\n";
if ( pCallbackData->pObjects[i].pObjectName )
{
message << "\t\t\t"
<< "objectName = <" << pCallbackData->pObjects[i].pObjectName << ">\n";
message << std::string( "\t\t\t" ) << "objectName = <" << pCallbackData->pObjects[i].pObjectName << ">\n";
}
}
}

View File

@@ -38,6 +38,100 @@ static char const * EngineName = "Vulkan.hpp";
PFN_vkCreateDebugUtilsMessengerEXT pfnVkCreateDebugUtilsMessengerEXT;
PFN_vkDestroyDebugUtilsMessengerEXT pfnVkDestroyDebugUtilsMessengerEXT;
#if defined( VULKAN_HPP_NO_TO_STRING )
namespace local
{
std::string to_string( vk::DebugUtilsMessageSeverityFlagBitsEXT value )
{
switch ( value )
{
case vk::DebugUtilsMessageSeverityFlagBitsEXT::eVerbose: return "Verbose";
case vk::DebugUtilsMessageSeverityFlagBitsEXT::eInfo: return "Info";
case vk::DebugUtilsMessageSeverityFlagBitsEXT::eWarning: return "Warning";
case vk::DebugUtilsMessageSeverityFlagBitsEXT::eError: return "Error";
default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast<uint32_t>( value ) ) + " )";
}
}
std::string to_string( vk::DebugUtilsMessageTypeFlagsEXT value )
{
if ( !value )
return "{}";
std::string result;
if ( value & vk::DebugUtilsMessageTypeFlagBitsEXT::eGeneral )
result += "General | ";
if ( value & vk::DebugUtilsMessageTypeFlagBitsEXT::eValidation )
result += "Validation | ";
if ( value & vk::DebugUtilsMessageTypeFlagBitsEXT::ePerformance )
result += "Performance | ";
return "{ " + result.substr( 0, result.size() - 3 ) + " }";
}
std::string to_string( vk::ObjectType value )
{
switch ( value )
{
case vk::ObjectType::eUnknown: return "Unknown";
case vk::ObjectType::eInstance: return "Instance";
case vk::ObjectType::ePhysicalDevice: return "PhysicalDevice";
case vk::ObjectType::eDevice: return "Device";
case vk::ObjectType::eQueue: return "Queue";
case vk::ObjectType::eSemaphore: return "Semaphore";
case vk::ObjectType::eCommandBuffer: return "CommandBuffer";
case vk::ObjectType::eFence: return "Fence";
case vk::ObjectType::eDeviceMemory: return "DeviceMemory";
case vk::ObjectType::eBuffer: return "Buffer";
case vk::ObjectType::eImage: return "Image";
case vk::ObjectType::eEvent: return "Event";
case vk::ObjectType::eQueryPool: return "QueryPool";
case vk::ObjectType::eBufferView: return "BufferView";
case vk::ObjectType::eImageView: return "ImageView";
case vk::ObjectType::eShaderModule: return "ShaderModule";
case vk::ObjectType::ePipelineCache: return "PipelineCache";
case vk::ObjectType::ePipelineLayout: return "PipelineLayout";
case vk::ObjectType::eRenderPass: return "RenderPass";
case vk::ObjectType::ePipeline: return "Pipeline";
case vk::ObjectType::eDescriptorSetLayout: return "DescriptorSetLayout";
case vk::ObjectType::eSampler: return "Sampler";
case vk::ObjectType::eDescriptorPool: return "DescriptorPool";
case vk::ObjectType::eDescriptorSet: return "DescriptorSet";
case vk::ObjectType::eFramebuffer: return "Framebuffer";
case vk::ObjectType::eCommandPool: return "CommandPool";
case vk::ObjectType::eSamplerYcbcrConversion: return "SamplerYcbcrConversion";
case vk::ObjectType::eDescriptorUpdateTemplate: return "DescriptorUpdateTemplate";
case vk::ObjectType::ePrivateDataSlot: return "PrivateDataSlot";
case vk::ObjectType::eSurfaceKHR: return "SurfaceKHR";
case vk::ObjectType::eSwapchainKHR: return "SwapchainKHR";
case vk::ObjectType::eDisplayKHR: return "DisplayKHR";
case vk::ObjectType::eDisplayModeKHR: return "DisplayModeKHR";
case vk::ObjectType::eDebugReportCallbackEXT: return "DebugReportCallbackEXT";
# if defined( VK_ENABLE_BETA_EXTENSIONS )
case vk::ObjectType::eVideoSessionKHR: return "VideoSessionKHR";
case vk::ObjectType::eVideoSessionParametersKHR: return "VideoSessionParametersKHR";
# endif /*VK_ENABLE_BETA_EXTENSIONS*/
case vk::ObjectType::eCuModuleNVX: return "CuModuleNVX";
case vk::ObjectType::eCuFunctionNVX: return "CuFunctionNVX";
case vk::ObjectType::eDebugUtilsMessengerEXT: return "DebugUtilsMessengerEXT";
case vk::ObjectType::eAccelerationStructureKHR: return "AccelerationStructureKHR";
case vk::ObjectType::eValidationCacheEXT: return "ValidationCacheEXT";
case vk::ObjectType::eAccelerationStructureNV: return "AccelerationStructureNV";
case vk::ObjectType::ePerformanceConfigurationINTEL: return "PerformanceConfigurationINTEL";
case vk::ObjectType::eDeferredOperationKHR: return "DeferredOperationKHR";
case vk::ObjectType::eIndirectCommandsLayoutNV: return "IndirectCommandsLayoutNV";
# if defined( VK_USE_PLATFORM_FUCHSIA )
case vk::ObjectType::eBufferCollectionFUCHSIA: return "BufferCollectionFUCHSIA";
# endif /*VK_USE_PLATFORM_FUCHSIA*/
default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast<uint32_t>( value ) ) + " )";
}
}
} // namespace local
using local::to_string;
#else
using vk::to_string;
#endif
VKAPI_ATTR VkResult VKAPI_CALL vkCreateDebugUtilsMessengerEXT( VkInstance instance,
const VkDebugUtilsMessengerCreateInfoEXT * pCreateInfo,
const VkAllocationCallbacks * pAllocator,
@@ -58,8 +152,8 @@ VKAPI_ATTR VkBool32 VKAPI_CALL debugMessageFunc( VkDebugUtilsMessageSeverityFlag
{
std::string message;
message += vk::to_string( static_cast<vk::DebugUtilsMessageSeverityFlagBitsEXT>( messageSeverity ) ) + ": " +
vk::to_string( static_cast<vk::DebugUtilsMessageTypeFlagsEXT>( messageTypes ) ) + ":\n";
message += to_string( static_cast<vk::DebugUtilsMessageSeverityFlagBitsEXT>( messageSeverity ) ) + ": " +
to_string( static_cast<vk::DebugUtilsMessageTypeFlagsEXT>( 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";
@@ -84,7 +178,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 = " + to_string( static_cast<vk::ObjectType>( pCallbackData->pObjects[i].objectType ) ) + "\n";
message += std::string( "\t\t" ) + "objectHandle = " + std::to_string( pCallbackData->pObjects[i].objectHandle ) + "\n";
if ( pCallbackData->pObjects[i].pObjectName )
{

View File

@@ -24,6 +24,27 @@
static char const * AppName = "EnumerateDevicesAdvanced";
static char const * EngineName = "Vulkan.hpp";
#if defined( VULKAN_HPP_NO_TO_STRING )
namespace local
{
std::string to_string( vk::PhysicalDeviceType value )
{
switch ( value )
{
case vk::PhysicalDeviceType::eOther: return "Other";
case vk::PhysicalDeviceType::eIntegratedGpu: return "IntegratedGpu";
case vk::PhysicalDeviceType::eDiscreteGpu: return "DiscreteGpu";
case vk::PhysicalDeviceType::eVirtualGpu: return "VirtualGpu";
case vk::PhysicalDeviceType::eCpu: return "Cpu";
default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast<uint32_t>( value ) ) + " )";
}
}
} // namespace local
using local::to_string;
#else
using vk::to_string;
#endif
int main( int /*argc*/, char ** /*argv*/ )
{
try
@@ -55,7 +76,7 @@ int main( int /*argc*/, char ** /*argv*/ )
std::cout << "deviceId: " << std::setw( 6 ) << properties.deviceID << '\n';
std::cout << std::noshowbase << std::right << std::setfill( ' ' ) << std::dec;
std::cout << "deviceType: " << vk::to_string( properties.deviceType ) << "\n";
std::cout << "deviceType: " << to_string( properties.deviceType ) << "\n";
std::cout << "deviceName: " << properties.deviceName << '\n';

View File

@@ -46,7 +46,57 @@ std::string formatSize( vk::DeviceSize size )
return oss.str();
}
int main( int /*argc*/, char ** /*argv*/ )
#if defined( VULKAN_HPP_NO_TO_STRING )
namespace local
{
std::string to_string( vk::MemoryHeapFlags value )
{
if ( !value )
return "{}";
std::string result;
if ( value & vk::MemoryHeapFlagBits::eDeviceLocal )
result += "DeviceLocal | ";
if ( value & vk::MemoryHeapFlagBits::eMultiInstance )
result += "MultiInstance | ";
return "{ " + result.substr( 0, result.size() - 3 ) + " }";
}
std::string to_string( vk::MemoryPropertyFlags value )
{
if ( !value )
return "{}";
std::string result;
if ( value & vk::MemoryPropertyFlagBits::eDeviceLocal )
result += "DeviceLocal | ";
if ( value & vk::MemoryPropertyFlagBits::eHostVisible )
result += "HostVisible | ";
if ( value & vk::MemoryPropertyFlagBits::eHostCoherent )
result += "HostCoherent | ";
if ( value & vk::MemoryPropertyFlagBits::eHostCached )
result += "HostCached | ";
if ( value & vk::MemoryPropertyFlagBits::eLazilyAllocated )
result += "LazilyAllocated | ";
if ( value & vk::MemoryPropertyFlagBits::eProtected )
result += "Protected | ";
if ( value & vk::MemoryPropertyFlagBits::eDeviceCoherentAMD )
result += "DeviceCoherentAMD | ";
if ( value & vk::MemoryPropertyFlagBits::eDeviceUncachedAMD )
result += "DeviceUncachedAMD | ";
if ( value & vk::MemoryPropertyFlagBits::eRdmaCapableNV )
result += "RdmaCapableNV | ";
return "{ " + result.substr( 0, result.size() - 3 ) + " }";
}
} // namespace local
using local::to_string;
#else
using vk::to_string;
#endif
int main( int /*argc*/, char ** /*argv*/ )
{
try
{
@@ -74,7 +124,7 @@ int main( int /*argc*/, char ** /*argv*/ )
for ( uint32_t j = 0; j < memoryProperties.memoryHeapCount; j++ )
{
std::cout << " " << j << ": size = " << formatSize( memoryProperties.memoryHeaps[j].size )
<< ", flags = " << vk::to_string( memoryProperties.memoryHeaps[j].flags ) << "\n";
<< ", flags = " << to_string( memoryProperties.memoryHeaps[j].flags ) << "\n";
if ( containsMemoryBudget )
{
std::cout << " heapBudget = " << formatSize( memoryBudgetProperties.heapBudget[j] )
@@ -85,7 +135,7 @@ int main( int /*argc*/, char ** /*argv*/ )
for ( uint32_t j = 0; j < memoryProperties.memoryTypeCount; j++ )
{
std::cout << " " << j << ": heapIndex = " << memoryProperties.memoryTypes[j].heapIndex
<< ", flags = " << vk::to_string( memoryProperties.memoryTypes[j].propertyFlags ) << "\n";
<< ", flags = " << to_string( memoryProperties.memoryTypes[j].propertyFlags ) << "\n";
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -25,6 +25,102 @@
static char const * AppName = "PhysicalDeviceQueueFamilyProperties";
static char const * EngineName = "Vulkan.hpp";
#if defined( VULKAN_HPP_NO_TO_STRING )
namespace local
{
std::string to_string( vk::PipelineStageFlags value )
{
if ( !value )
return "{}";
std::string result;
if ( value & vk::PipelineStageFlagBits::eTopOfPipe )
result += "TopOfPipe | ";
if ( value & vk::PipelineStageFlagBits::eDrawIndirect )
result += "DrawIndirect | ";
if ( value & vk::PipelineStageFlagBits::eVertexInput )
result += "VertexInput | ";
if ( value & vk::PipelineStageFlagBits::eVertexShader )
result += "VertexShader | ";
if ( value & vk::PipelineStageFlagBits::eTessellationControlShader )
result += "TessellationControlShader | ";
if ( value & vk::PipelineStageFlagBits::eTessellationEvaluationShader )
result += "TessellationEvaluationShader | ";
if ( value & vk::PipelineStageFlagBits::eGeometryShader )
result += "GeometryShader | ";
if ( value & vk::PipelineStageFlagBits::eFragmentShader )
result += "FragmentShader | ";
if ( value & vk::PipelineStageFlagBits::eEarlyFragmentTests )
result += "EarlyFragmentTests | ";
if ( value & vk::PipelineStageFlagBits::eLateFragmentTests )
result += "LateFragmentTests | ";
if ( value & vk::PipelineStageFlagBits::eColorAttachmentOutput )
result += "ColorAttachmentOutput | ";
if ( value & vk::PipelineStageFlagBits::eComputeShader )
result += "ComputeShader | ";
if ( value & vk::PipelineStageFlagBits::eTransfer )
result += "Transfer | ";
if ( value & vk::PipelineStageFlagBits::eBottomOfPipe )
result += "BottomOfPipe | ";
if ( value & vk::PipelineStageFlagBits::eHost )
result += "Host | ";
if ( value & vk::PipelineStageFlagBits::eAllGraphics )
result += "AllGraphics | ";
if ( value & vk::PipelineStageFlagBits::eAllCommands )
result += "AllCommands | ";
if ( value & vk::PipelineStageFlagBits::eTransformFeedbackEXT )
result += "TransformFeedbackEXT | ";
if ( value & vk::PipelineStageFlagBits::eConditionalRenderingEXT )
result += "ConditionalRenderingEXT | ";
if ( value & vk::PipelineStageFlagBits::eAccelerationStructureBuildKHR )
result += "AccelerationStructureBuildKHR | ";
if ( value & vk::PipelineStageFlagBits::eRayTracingShaderKHR )
result += "RayTracingShaderKHR | ";
if ( value & vk::PipelineStageFlagBits::eTaskShaderNV )
result += "TaskShaderNV | ";
if ( value & vk::PipelineStageFlagBits::eMeshShaderNV )
result += "MeshShaderNV | ";
if ( value & vk::PipelineStageFlagBits::eFragmentDensityProcessEXT )
result += "FragmentDensityProcessEXT | ";
if ( value & vk::PipelineStageFlagBits::eFragmentShadingRateAttachmentKHR )
result += "FragmentShadingRateAttachmentKHR | ";
if ( value & vk::PipelineStageFlagBits::eCommandPreprocessNV )
result += "CommandPreprocessNV | ";
return "{ " + result.substr( 0, result.size() - 3 ) + " }";
}
std::string to_string( vk::QueueFlags value )
{
if ( !value )
return "{}";
std::string result;
if ( value & vk::QueueFlagBits::eGraphics )
result += "Graphics | ";
if ( value & vk::QueueFlagBits::eCompute )
result += "Compute | ";
if ( value & vk::QueueFlagBits::eTransfer )
result += "Transfer | ";
if ( value & vk::QueueFlagBits::eSparseBinding )
result += "SparseBinding | ";
if ( value & vk::QueueFlagBits::eProtected )
result += "Protected | ";
# if defined( VK_ENABLE_BETA_EXTENSIONS )
if ( value & vk::QueueFlagBits::eVideoDecodeKHR )
result += "VideoDecodeKHR | ";
if ( value & vk::QueueFlagBits::eVideoEncodeKHR )
result += "VideoEncodeKHR | ";
# endif /*VK_ENABLE_BETA_EXTENSIONS*/
return "{ " + result.substr( 0, result.size() - 3 ) + " }";
}
} // namespace local
using local::to_string;
#else
using vk::to_string;
#endif
int main( int /*argc*/, char ** /*argv*/ )
{
try
@@ -52,29 +148,21 @@ int main( int /*argc*/, char ** /*argv*/ )
auto queueFamilyProperties2 = physicalDevices[i].getQueueFamilyProperties2<Chain, std::allocator<Chain>, vk::DispatchLoaderDynamic>();
for ( size_t j = 0; j < queueFamilyProperties2.size(); j++ )
{
std::cout << "\t"
<< "QueueFamily " << j << "\n";
std::cout << std::string( "\t" ) << "QueueFamily " << j << "\n";
vk::QueueFamilyProperties const & properties = queueFamilyProperties2[j].get<vk::QueueFamilyProperties2>().queueFamilyProperties;
std::cout << "\t\t"
<< "QueueFamilyProperties:\n";
std::cout << "\t\t\t"
<< "queueFlags = " << vk::to_string( properties.queueFlags ) << "\n";
std::cout << "\t\t\t"
<< "queueCount = " << properties.queueCount << "\n";
std::cout << "\t\t\t"
<< "timestampValidBits = " << properties.timestampValidBits << "\n";
std::cout << "\t\t\t"
<< "minImageTransferGranularity = " << properties.minImageTransferGranularity.width << " x " << properties.minImageTransferGranularity.height
<< " x " << properties.minImageTransferGranularity.depth << "\n";
std::cout << std::string( "\t\t" ) << "QueueFamilyProperties:\n";
std::cout << std::string( "\t\t\t" ) << "queueFlags = " << to_string( properties.queueFlags ) << "\n";
std::cout << std::string( "\t\t\t" ) << "queueCount = " << properties.queueCount << "\n";
std::cout << std::string( "\t\t\t" ) << "timestampValidBits = " << properties.timestampValidBits << "\n";
std::cout << std::string( "\t\t\t" ) << "minImageTransferGranularity = " << properties.minImageTransferGranularity.width << " x "
<< properties.minImageTransferGranularity.height << " x " << properties.minImageTransferGranularity.depth << "\n";
std::cout << "\n";
if ( vk::su::contains( extensionProperties, "VK_NV_device_diagnostic_checkpoints" ) )
{
vk::QueueFamilyCheckpointPropertiesNV const & checkpointProperties = queueFamilyProperties2[j].get<vk::QueueFamilyCheckpointPropertiesNV>();
std::cout << "\t\t"
<< "CheckPointPropertiesNV:\n";
std::cout << "\t\t\t"
<< "checkpointExecutionStageMask = " << vk::to_string( checkpointProperties.checkpointExecutionStageMask ) << "\n";
std::cout << std::string( "\t\t" ) << "CheckPointPropertiesNV:\n";
std::cout << std::string( "\t\t\t" ) << "checkpointExecutionStageMask = " << to_string( checkpointProperties.checkpointExecutionStageMask ) << "\n";
std::cout << "\n";
}
}

View File

@@ -52,6 +52,71 @@
static char const * AppName = "RayTracing";
static char const * EngineName = "Vulkan.hpp";
#if defined( VULKAN_HPP_NO_TO_STRING )
namespace local
{
std::string to_string( vk::Result value )
{
switch ( value )
{
case vk::Result::eSuccess: return "Success";
case vk::Result::eNotReady: return "NotReady";
case vk::Result::eTimeout: return "Timeout";
case vk::Result::eEventSet: return "EventSet";
case vk::Result::eEventReset: return "EventReset";
case vk::Result::eIncomplete: return "Incomplete";
case vk::Result::eErrorOutOfHostMemory: return "ErrorOutOfHostMemory";
case vk::Result::eErrorOutOfDeviceMemory: return "ErrorOutOfDeviceMemory";
case vk::Result::eErrorInitializationFailed: return "ErrorInitializationFailed";
case vk::Result::eErrorDeviceLost: return "ErrorDeviceLost";
case vk::Result::eErrorMemoryMapFailed: return "ErrorMemoryMapFailed";
case vk::Result::eErrorLayerNotPresent: return "ErrorLayerNotPresent";
case vk::Result::eErrorExtensionNotPresent: return "ErrorExtensionNotPresent";
case vk::Result::eErrorFeatureNotPresent: return "ErrorFeatureNotPresent";
case vk::Result::eErrorIncompatibleDriver: return "ErrorIncompatibleDriver";
case vk::Result::eErrorTooManyObjects: return "ErrorTooManyObjects";
case vk::Result::eErrorFormatNotSupported: return "ErrorFormatNotSupported";
case vk::Result::eErrorFragmentedPool: return "ErrorFragmentedPool";
case vk::Result::eErrorUnknown: return "ErrorUnknown";
case vk::Result::eErrorOutOfPoolMemory: return "ErrorOutOfPoolMemory";
case vk::Result::eErrorInvalidExternalHandle: return "ErrorInvalidExternalHandle";
case vk::Result::eErrorFragmentation: return "ErrorFragmentation";
case vk::Result::eErrorInvalidOpaqueCaptureAddress: return "ErrorInvalidOpaqueCaptureAddress";
case vk::Result::ePipelineCompileRequired: return "PipelineCompileRequired";
case vk::Result::eErrorSurfaceLostKHR: return "ErrorSurfaceLostKHR";
case vk::Result::eErrorNativeWindowInUseKHR: return "ErrorNativeWindowInUseKHR";
case vk::Result::eSuboptimalKHR: return "SuboptimalKHR";
case vk::Result::eErrorOutOfDateKHR: return "ErrorOutOfDateKHR";
case vk::Result::eErrorIncompatibleDisplayKHR: return "ErrorIncompatibleDisplayKHR";
case vk::Result::eErrorValidationFailedEXT: return "ErrorValidationFailedEXT";
case vk::Result::eErrorInvalidShaderNV: return "ErrorInvalidShaderNV";
# if defined( VK_ENABLE_BETA_EXTENSIONS )
case vk::Result::eErrorImageUsageNotSupportedKHR: return "ErrorImageUsageNotSupportedKHR";
case vk::Result::eErrorVideoPictureLayoutNotSupportedKHR: return "ErrorVideoPictureLayoutNotSupportedKHR";
case vk::Result::eErrorVideoProfileOperationNotSupportedKHR: return "ErrorVideoProfileOperationNotSupportedKHR";
case vk::Result::eErrorVideoProfileFormatNotSupportedKHR: return "ErrorVideoProfileFormatNotSupportedKHR";
case vk::Result::eErrorVideoProfileCodecNotSupportedKHR: return "ErrorVideoProfileCodecNotSupportedKHR";
case vk::Result::eErrorVideoStdVersionNotSupportedKHR: return "ErrorVideoStdVersionNotSupportedKHR";
# endif /*VK_ENABLE_BETA_EXTENSIONS*/
case vk::Result::eErrorInvalidDrmFormatModifierPlaneLayoutEXT: return "ErrorInvalidDrmFormatModifierPlaneLayoutEXT";
case vk::Result::eErrorNotPermittedKHR: return "ErrorNotPermittedKHR";
# if defined( VK_USE_PLATFORM_WIN32_KHR )
case vk::Result::eErrorFullScreenExclusiveModeLostEXT: return "ErrorFullScreenExclusiveModeLostEXT";
# endif /*VK_USE_PLATFORM_WIN32_KHR*/
case vk::Result::eThreadIdleKHR: return "ThreadIdleKHR";
case vk::Result::eThreadDoneKHR: return "ThreadDoneKHR";
case vk::Result::eOperationDeferredKHR: return "OperationDeferredKHR";
case vk::Result::eOperationNotDeferredKHR: return "OperationNotDeferredKHR";
case vk::Result::eErrorCompressionExhaustedEXT: return "ErrorCompressionExhaustedEXT";
default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast<uint32_t>( value ) ) + " )";
}
}
} // namespace local
using local::to_string;
#else
using vk::to_string;
#endif
struct GeometryInstanceData
{
GeometryInstanceData(
@@ -536,7 +601,7 @@ static void check_vk_result( VkResult err )
{
if ( err != 0 )
{
std::cerr << AppName << ": Vulkan error " << vk::to_string( static_cast<vk::Result>( err ) );
std::cerr << AppName << ": Vulkan error " << to_string( static_cast<vk::Result>( err ) );
if ( err < 0 )
{
abort();

View File

@@ -25,29 +25,145 @@
static char const * AppName = "SurfaceCapabilities";
static char const * EngineName = "Vulkan.hpp";
#if defined( VULKAN_HPP_NO_TO_STRING )
namespace local
{
std::string to_string( vk::CompositeAlphaFlagsKHR value )
{
if ( !value )
return "{}";
std::string result;
if ( value & vk::CompositeAlphaFlagBitsKHR::eOpaque )
result += "Opaque | ";
if ( value & vk::CompositeAlphaFlagBitsKHR::ePreMultiplied )
result += "PreMultiplied | ";
if ( value & vk::CompositeAlphaFlagBitsKHR::ePostMultiplied )
result += "PostMultiplied | ";
if ( value & vk::CompositeAlphaFlagBitsKHR::eInherit )
result += "Inherit | ";
return "{ " + result.substr( 0, result.size() - 3 ) + " }";
}
std::string to_string( vk::ImageUsageFlags value )
{
if ( !value )
return "{}";
std::string result;
if ( value & vk::ImageUsageFlagBits::eTransferSrc )
result += "TransferSrc | ";
if ( value & vk::ImageUsageFlagBits::eTransferDst )
result += "TransferDst | ";
if ( value & vk::ImageUsageFlagBits::eSampled )
result += "Sampled | ";
if ( value & vk::ImageUsageFlagBits::eStorage )
result += "Storage | ";
if ( value & vk::ImageUsageFlagBits::eColorAttachment )
result += "ColorAttachment | ";
if ( value & vk::ImageUsageFlagBits::eDepthStencilAttachment )
result += "DepthStencilAttachment | ";
if ( value & vk::ImageUsageFlagBits::eTransientAttachment )
result += "TransientAttachment | ";
if ( value & vk::ImageUsageFlagBits::eInputAttachment )
result += "InputAttachment | ";
# if defined( VK_ENABLE_BETA_EXTENSIONS )
if ( value & vk::ImageUsageFlagBits::eVideoDecodeDstKHR )
result += "VideoDecodeDstKHR | ";
if ( value & vk::ImageUsageFlagBits::eVideoDecodeSrcKHR )
result += "VideoDecodeSrcKHR | ";
if ( value & vk::ImageUsageFlagBits::eVideoDecodeDpbKHR )
result += "VideoDecodeDpbKHR | ";
# endif /*VK_ENABLE_BETA_EXTENSIONS*/
if ( value & vk::ImageUsageFlagBits::eFragmentDensityMapEXT )
result += "FragmentDensityMapEXT | ";
if ( value & vk::ImageUsageFlagBits::eFragmentShadingRateAttachmentKHR )
result += "FragmentShadingRateAttachmentKHR | ";
# if defined( VK_ENABLE_BETA_EXTENSIONS )
if ( value & vk::ImageUsageFlagBits::eVideoEncodeDstKHR )
result += "VideoEncodeDstKHR | ";
if ( value & vk::ImageUsageFlagBits::eVideoEncodeSrcKHR )
result += "VideoEncodeSrcKHR | ";
if ( value & vk::ImageUsageFlagBits::eVideoEncodeDpbKHR )
result += "VideoEncodeDpbKHR | ";
# endif /*VK_ENABLE_BETA_EXTENSIONS*/
if ( value & vk::ImageUsageFlagBits::eInvocationMaskHUAWEI )
result += "InvocationMaskHUAWEI | ";
if ( value & vk::ImageUsageFlagBits::eSampleWeightQCOM )
result += "SampleWeightQCOM | ";
if ( value & vk::ImageUsageFlagBits::eSampleBlockMatchQCOM )
result += "SampleBlockMatchQCOM | ";
return "{ " + result.substr( 0, result.size() - 3 ) + " }";
}
std::string to_string( vk::SurfaceTransformFlagBitsKHR value )
{
switch ( value )
{
case vk::SurfaceTransformFlagBitsKHR::eIdentity: return "Identity";
case vk::SurfaceTransformFlagBitsKHR::eRotate90: return "Rotate90";
case vk::SurfaceTransformFlagBitsKHR::eRotate180: return "Rotate180";
case vk::SurfaceTransformFlagBitsKHR::eRotate270: return "Rotate270";
case vk::SurfaceTransformFlagBitsKHR::eHorizontalMirror: return "HorizontalMirror";
case vk::SurfaceTransformFlagBitsKHR::eHorizontalMirrorRotate90: return "HorizontalMirrorRotate90";
case vk::SurfaceTransformFlagBitsKHR::eHorizontalMirrorRotate180: return "HorizontalMirrorRotate180";
case vk::SurfaceTransformFlagBitsKHR::eHorizontalMirrorRotate270: return "HorizontalMirrorRotate270";
case vk::SurfaceTransformFlagBitsKHR::eInherit: return "Inherit";
default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast<uint32_t>( value ) ) + " )";
}
}
std::string to_string( vk::SurfaceTransformFlagsKHR value )
{
if ( !value )
return "{}";
std::string result;
if ( value & vk::SurfaceTransformFlagBitsKHR::eIdentity )
result += "Identity | ";
if ( value & vk::SurfaceTransformFlagBitsKHR::eRotate90 )
result += "Rotate90 | ";
if ( value & vk::SurfaceTransformFlagBitsKHR::eRotate180 )
result += "Rotate180 | ";
if ( value & vk::SurfaceTransformFlagBitsKHR::eRotate270 )
result += "Rotate270 | ";
if ( value & vk::SurfaceTransformFlagBitsKHR::eHorizontalMirror )
result += "HorizontalMirror | ";
if ( value & vk::SurfaceTransformFlagBitsKHR::eHorizontalMirrorRotate90 )
result += "HorizontalMirrorRotate90 | ";
if ( value & vk::SurfaceTransformFlagBitsKHR::eHorizontalMirrorRotate180 )
result += "HorizontalMirrorRotate180 | ";
if ( value & vk::SurfaceTransformFlagBitsKHR::eHorizontalMirrorRotate270 )
result += "HorizontalMirrorRotate270 | ";
if ( value & vk::SurfaceTransformFlagBitsKHR::eInherit )
result += "Inherit | ";
return "{ " + result.substr( 0, result.size() - 3 ) + " }";
}
} // namespace local
using local::to_string;
#else
using vk::to_string;
#endif
void cout( vk::SurfaceCapabilitiesKHR const & surfaceCapabilities )
{
std::cout << "\tCapabilities:\n";
std::cout << "\t\t"
<< "currentExtent = " << surfaceCapabilities.currentExtent.width << " x " << surfaceCapabilities.currentExtent.height << "\n";
std::cout << "\t\t"
<< "currentTransform = " << vk::to_string( surfaceCapabilities.currentTransform ) << "\n";
std::cout << "\t\t"
<< "maxImageArrayLayers = " << surfaceCapabilities.maxImageArrayLayers << "\n";
std::cout << "\t\t"
<< "maxImageCount = " << surfaceCapabilities.maxImageCount << "\n";
std::cout << "\t\t"
<< "maxImageExtent = " << surfaceCapabilities.maxImageExtent.width << " x " << surfaceCapabilities.maxImageExtent.height << "\n";
std::cout << "\t\t"
<< "minImageCount = " << surfaceCapabilities.minImageCount << "\n";
std::cout << "\t\t"
<< "minImageExtent = " << surfaceCapabilities.minImageExtent.width << " x " << surfaceCapabilities.minImageExtent.height << "\n";
std::cout << "\t\t"
<< "supportedCompositeAlpha = " << vk::to_string( surfaceCapabilities.supportedCompositeAlpha ) << "\n";
std::cout << "\t\t"
<< "supportedTransforms = " << vk::to_string( surfaceCapabilities.supportedTransforms ) << "\n";
std::cout << "\t\t"
<< "supportedUsageFlags = " << vk::to_string( surfaceCapabilities.supportedUsageFlags ) << "\n";
std::cout << std::string( "\t" ) << "Capabilities:\n";
std::cout << std::string( "\t\t" ) << "currentExtent = " << surfaceCapabilities.currentExtent.width << " x "
<< surfaceCapabilities.currentExtent.height << "\n";
std::cout << std::string( "\t\t" ) << "currentTransform = " << to_string( surfaceCapabilities.currentTransform ) << "\n";
std::cout << std::string( "\t\t" ) << "maxImageArrayLayers = " << surfaceCapabilities.maxImageArrayLayers << "\n";
std::cout << std::string( "\t\t" ) << "maxImageCount = " << surfaceCapabilities.maxImageCount << "\n";
std::cout << std::string( "\t\t" ) << "maxImageExtent = " << surfaceCapabilities.maxImageExtent.width << " x "
<< surfaceCapabilities.maxImageExtent.height << "\n";
std::cout << std::string( "\t\t" ) << "minImageCount = " << surfaceCapabilities.minImageCount << "\n";
std::cout << std::string( "\t\t" ) << "minImageExtent = " << surfaceCapabilities.minImageExtent.width << " x "
<< surfaceCapabilities.minImageExtent.height << "\n";
std::cout << std::string( "\t\t" ) << "supportedCompositeAlpha = " << to_string( surfaceCapabilities.supportedCompositeAlpha ) << "\n";
std::cout << std::string( "\t\t" ) << "supportedTransforms = " << to_string( surfaceCapabilities.supportedTransforms ) << "\n";
std::cout << std::string( "\t\t" ) << "supportedUsageFlags = " << to_string( surfaceCapabilities.supportedUsageFlags ) << "\n";
std::cout << "\n";
}
@@ -110,18 +226,17 @@ int main( int /*argc*/, char ** /*argv*/ )
{
vk::DisplayNativeHdrSurfaceCapabilitiesAMD displayNativeHdrSurfaceCapabilities =
surfaceCapabilities2.get<vk::DisplayNativeHdrSurfaceCapabilitiesAMD>();
std::cout << "\tDisplayNativeHdrSurfaceCapabilitiesAMD:\n";
std::cout << "\t\t"
<< "localDimmingSupport = " << !!displayNativeHdrSurfaceCapabilities.localDimmingSupport << "\n";
std::cout << std::string( "\t" ) << "DisplayNativeHdrSurfaceCapabilitiesAMD:\n";
std::cout << std::string( "\t\t" ) << "localDimmingSupport = " << !!displayNativeHdrSurfaceCapabilities.localDimmingSupport << "\n";
std::cout << "\n";
}
if ( vk::su::contains( extensionProperties, "VK_KHR_shared_presentable_image" ) )
{
vk::SharedPresentSurfaceCapabilitiesKHR sharedPresentSurfaceCapabilities = surfaceCapabilities2.get<vk::SharedPresentSurfaceCapabilitiesKHR>();
std::cout << "\tSharedPresentSurfaceCapabilitiesKHR:\n";
std::cout << "\t\t"
<< "sharedPresentSupportedUsageFlags = " << vk::to_string( sharedPresentSurfaceCapabilities.sharedPresentSupportedUsageFlags ) << "\n";
std::cout << std::string( "\t" ) << "SharedPresentSurfaceCapabilitiesKHR:\n";
std::cout << std::string( "\t\t" )
<< "sharedPresentSupportedUsageFlags = " << to_string( sharedPresentSurfaceCapabilities.sharedPresentSupportedUsageFlags ) << "\n";
std::cout << "\n";
}
@@ -129,18 +244,17 @@ int main( int /*argc*/, char ** /*argv*/ )
{
vk::SurfaceCapabilitiesFullScreenExclusiveEXT surfaceCapabilitiesFullScreenExclusive =
surfaceCapabilities2.get<vk::SurfaceCapabilitiesFullScreenExclusiveEXT>();
std::cout << "\tSurfaceCapabilitiesFullScreenExclusiveEXT:\n";
std::cout << "\t\t"
<< "fullScreenExclusiveSupported = " << !!surfaceCapabilitiesFullScreenExclusive.fullScreenExclusiveSupported << "\n";
std::cout << std::string( "\t" ) << "SurfaceCapabilitiesFullScreenExclusiveEXT:\n";
std::cout << std::string( "\t\t" ) << "fullScreenExclusiveSupported = " << !!surfaceCapabilitiesFullScreenExclusive.fullScreenExclusiveSupported
<< "\n";
std::cout << "\n";
}
if ( vk::su::contains( extensionProperties, "VK_KHR_surface_protected_capabilities" ) )
{
vk::SurfaceProtectedCapabilitiesKHR surfaceProtectedCapabilities = surfaceCapabilities2.get<vk::SurfaceProtectedCapabilitiesKHR>();
std::cout << "\tSurfaceProtectedCapabilitiesKHR:\n";
std::cout << "\t\t"
<< "supportsProtected = " << !!surfaceProtectedCapabilities.supportsProtected << "\n";
std::cout << std::string( "\t" ) << "SurfaceProtectedCapabilitiesKHR:\n";
std::cout << std::string( "\t\t" ) << "supportsProtected = " << !!surfaceProtectedCapabilities.supportsProtected << "\n";
std::cout << "\n";
}
}

View File

@@ -25,6 +25,293 @@
static char const * AppName = "SurfaceFormats";
static char const * EngineName = "Vulkan.hpp";
#if defined( VULKAN_HPP_NO_TO_STRING )
namespace local
{
std::string to_string( vk::ColorSpaceKHR value )
{
switch ( value )
{
case vk::ColorSpaceKHR::eSrgbNonlinear: return "SrgbNonlinear";
case vk::ColorSpaceKHR::eDisplayP3NonlinearEXT: return "DisplayP3NonlinearEXT";
case vk::ColorSpaceKHR::eExtendedSrgbLinearEXT: return "ExtendedSrgbLinearEXT";
case vk::ColorSpaceKHR::eDisplayP3LinearEXT: return "DisplayP3LinearEXT";
case vk::ColorSpaceKHR::eDciP3NonlinearEXT: return "DciP3NonlinearEXT";
case vk::ColorSpaceKHR::eBt709LinearEXT: return "Bt709LinearEXT";
case vk::ColorSpaceKHR::eBt709NonlinearEXT: return "Bt709NonlinearEXT";
case vk::ColorSpaceKHR::eBt2020LinearEXT: return "Bt2020LinearEXT";
case vk::ColorSpaceKHR::eHdr10St2084EXT: return "Hdr10St2084EXT";
case vk::ColorSpaceKHR::eDolbyvisionEXT: return "DolbyvisionEXT";
case vk::ColorSpaceKHR::eHdr10HlgEXT: return "Hdr10HlgEXT";
case vk::ColorSpaceKHR::eAdobergbLinearEXT: return "AdobergbLinearEXT";
case vk::ColorSpaceKHR::eAdobergbNonlinearEXT: return "AdobergbNonlinearEXT";
case vk::ColorSpaceKHR::ePassThroughEXT: return "PassThroughEXT";
case vk::ColorSpaceKHR::eExtendedSrgbNonlinearEXT: return "ExtendedSrgbNonlinearEXT";
case vk::ColorSpaceKHR::eDisplayNativeAMD: return "DisplayNativeAMD";
default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast<uint32_t>( value ) ) + " )";
}
}
std::string to_string( vk::Format value )
{
switch ( value )
{
case vk::Format::eUndefined: return "Undefined";
case vk::Format::eR4G4UnormPack8: return "R4G4UnormPack8";
case vk::Format::eR4G4B4A4UnormPack16: return "R4G4B4A4UnormPack16";
case vk::Format::eB4G4R4A4UnormPack16: return "B4G4R4A4UnormPack16";
case vk::Format::eR5G6B5UnormPack16: return "R5G6B5UnormPack16";
case vk::Format::eB5G6R5UnormPack16: return "B5G6R5UnormPack16";
case vk::Format::eR5G5B5A1UnormPack16: return "R5G5B5A1UnormPack16";
case vk::Format::eB5G5R5A1UnormPack16: return "B5G5R5A1UnormPack16";
case vk::Format::eA1R5G5B5UnormPack16: return "A1R5G5B5UnormPack16";
case vk::Format::eR8Unorm: return "R8Unorm";
case vk::Format::eR8Snorm: return "R8Snorm";
case vk::Format::eR8Uscaled: return "R8Uscaled";
case vk::Format::eR8Sscaled: return "R8Sscaled";
case vk::Format::eR8Uint: return "R8Uint";
case vk::Format::eR8Sint: return "R8Sint";
case vk::Format::eR8Srgb: return "R8Srgb";
case vk::Format::eR8G8Unorm: return "R8G8Unorm";
case vk::Format::eR8G8Snorm: return "R8G8Snorm";
case vk::Format::eR8G8Uscaled: return "R8G8Uscaled";
case vk::Format::eR8G8Sscaled: return "R8G8Sscaled";
case vk::Format::eR8G8Uint: return "R8G8Uint";
case vk::Format::eR8G8Sint: return "R8G8Sint";
case vk::Format::eR8G8Srgb: return "R8G8Srgb";
case vk::Format::eR8G8B8Unorm: return "R8G8B8Unorm";
case vk::Format::eR8G8B8Snorm: return "R8G8B8Snorm";
case vk::Format::eR8G8B8Uscaled: return "R8G8B8Uscaled";
case vk::Format::eR8G8B8Sscaled: return "R8G8B8Sscaled";
case vk::Format::eR8G8B8Uint: return "R8G8B8Uint";
case vk::Format::eR8G8B8Sint: return "R8G8B8Sint";
case vk::Format::eR8G8B8Srgb: return "R8G8B8Srgb";
case vk::Format::eB8G8R8Unorm: return "B8G8R8Unorm";
case vk::Format::eB8G8R8Snorm: return "B8G8R8Snorm";
case vk::Format::eB8G8R8Uscaled: return "B8G8R8Uscaled";
case vk::Format::eB8G8R8Sscaled: return "B8G8R8Sscaled";
case vk::Format::eB8G8R8Uint: return "B8G8R8Uint";
case vk::Format::eB8G8R8Sint: return "B8G8R8Sint";
case vk::Format::eB8G8R8Srgb: return "B8G8R8Srgb";
case vk::Format::eR8G8B8A8Unorm: return "R8G8B8A8Unorm";
case vk::Format::eR8G8B8A8Snorm: return "R8G8B8A8Snorm";
case vk::Format::eR8G8B8A8Uscaled: return "R8G8B8A8Uscaled";
case vk::Format::eR8G8B8A8Sscaled: return "R8G8B8A8Sscaled";
case vk::Format::eR8G8B8A8Uint: return "R8G8B8A8Uint";
case vk::Format::eR8G8B8A8Sint: return "R8G8B8A8Sint";
case vk::Format::eR8G8B8A8Srgb: return "R8G8B8A8Srgb";
case vk::Format::eB8G8R8A8Unorm: return "B8G8R8A8Unorm";
case vk::Format::eB8G8R8A8Snorm: return "B8G8R8A8Snorm";
case vk::Format::eB8G8R8A8Uscaled: return "B8G8R8A8Uscaled";
case vk::Format::eB8G8R8A8Sscaled: return "B8G8R8A8Sscaled";
case vk::Format::eB8G8R8A8Uint: return "B8G8R8A8Uint";
case vk::Format::eB8G8R8A8Sint: return "B8G8R8A8Sint";
case vk::Format::eB8G8R8A8Srgb: return "B8G8R8A8Srgb";
case vk::Format::eA8B8G8R8UnormPack32: return "A8B8G8R8UnormPack32";
case vk::Format::eA8B8G8R8SnormPack32: return "A8B8G8R8SnormPack32";
case vk::Format::eA8B8G8R8UscaledPack32: return "A8B8G8R8UscaledPack32";
case vk::Format::eA8B8G8R8SscaledPack32: return "A8B8G8R8SscaledPack32";
case vk::Format::eA8B8G8R8UintPack32: return "A8B8G8R8UintPack32";
case vk::Format::eA8B8G8R8SintPack32: return "A8B8G8R8SintPack32";
case vk::Format::eA8B8G8R8SrgbPack32: return "A8B8G8R8SrgbPack32";
case vk::Format::eA2R10G10B10UnormPack32: return "A2R10G10B10UnormPack32";
case vk::Format::eA2R10G10B10SnormPack32: return "A2R10G10B10SnormPack32";
case vk::Format::eA2R10G10B10UscaledPack32: return "A2R10G10B10UscaledPack32";
case vk::Format::eA2R10G10B10SscaledPack32: return "A2R10G10B10SscaledPack32";
case vk::Format::eA2R10G10B10UintPack32: return "A2R10G10B10UintPack32";
case vk::Format::eA2R10G10B10SintPack32: return "A2R10G10B10SintPack32";
case vk::Format::eA2B10G10R10UnormPack32: return "A2B10G10R10UnormPack32";
case vk::Format::eA2B10G10R10SnormPack32: return "A2B10G10R10SnormPack32";
case vk::Format::eA2B10G10R10UscaledPack32: return "A2B10G10R10UscaledPack32";
case vk::Format::eA2B10G10R10SscaledPack32: return "A2B10G10R10SscaledPack32";
case vk::Format::eA2B10G10R10UintPack32: return "A2B10G10R10UintPack32";
case vk::Format::eA2B10G10R10SintPack32: return "A2B10G10R10SintPack32";
case vk::Format::eR16Unorm: return "R16Unorm";
case vk::Format::eR16Snorm: return "R16Snorm";
case vk::Format::eR16Uscaled: return "R16Uscaled";
case vk::Format::eR16Sscaled: return "R16Sscaled";
case vk::Format::eR16Uint: return "R16Uint";
case vk::Format::eR16Sint: return "R16Sint";
case vk::Format::eR16Sfloat: return "R16Sfloat";
case vk::Format::eR16G16Unorm: return "R16G16Unorm";
case vk::Format::eR16G16Snorm: return "R16G16Snorm";
case vk::Format::eR16G16Uscaled: return "R16G16Uscaled";
case vk::Format::eR16G16Sscaled: return "R16G16Sscaled";
case vk::Format::eR16G16Uint: return "R16G16Uint";
case vk::Format::eR16G16Sint: return "R16G16Sint";
case vk::Format::eR16G16Sfloat: return "R16G16Sfloat";
case vk::Format::eR16G16B16Unorm: return "R16G16B16Unorm";
case vk::Format::eR16G16B16Snorm: return "R16G16B16Snorm";
case vk::Format::eR16G16B16Uscaled: return "R16G16B16Uscaled";
case vk::Format::eR16G16B16Sscaled: return "R16G16B16Sscaled";
case vk::Format::eR16G16B16Uint: return "R16G16B16Uint";
case vk::Format::eR16G16B16Sint: return "R16G16B16Sint";
case vk::Format::eR16G16B16Sfloat: return "R16G16B16Sfloat";
case vk::Format::eR16G16B16A16Unorm: return "R16G16B16A16Unorm";
case vk::Format::eR16G16B16A16Snorm: return "R16G16B16A16Snorm";
case vk::Format::eR16G16B16A16Uscaled: return "R16G16B16A16Uscaled";
case vk::Format::eR16G16B16A16Sscaled: return "R16G16B16A16Sscaled";
case vk::Format::eR16G16B16A16Uint: return "R16G16B16A16Uint";
case vk::Format::eR16G16B16A16Sint: return "R16G16B16A16Sint";
case vk::Format::eR16G16B16A16Sfloat: return "R16G16B16A16Sfloat";
case vk::Format::eR32Uint: return "R32Uint";
case vk::Format::eR32Sint: return "R32Sint";
case vk::Format::eR32Sfloat: return "R32Sfloat";
case vk::Format::eR32G32Uint: return "R32G32Uint";
case vk::Format::eR32G32Sint: return "R32G32Sint";
case vk::Format::eR32G32Sfloat: return "R32G32Sfloat";
case vk::Format::eR32G32B32Uint: return "R32G32B32Uint";
case vk::Format::eR32G32B32Sint: return "R32G32B32Sint";
case vk::Format::eR32G32B32Sfloat: return "R32G32B32Sfloat";
case vk::Format::eR32G32B32A32Uint: return "R32G32B32A32Uint";
case vk::Format::eR32G32B32A32Sint: return "R32G32B32A32Sint";
case vk::Format::eR32G32B32A32Sfloat: return "R32G32B32A32Sfloat";
case vk::Format::eR64Uint: return "R64Uint";
case vk::Format::eR64Sint: return "R64Sint";
case vk::Format::eR64Sfloat: return "R64Sfloat";
case vk::Format::eR64G64Uint: return "R64G64Uint";
case vk::Format::eR64G64Sint: return "R64G64Sint";
case vk::Format::eR64G64Sfloat: return "R64G64Sfloat";
case vk::Format::eR64G64B64Uint: return "R64G64B64Uint";
case vk::Format::eR64G64B64Sint: return "R64G64B64Sint";
case vk::Format::eR64G64B64Sfloat: return "R64G64B64Sfloat";
case vk::Format::eR64G64B64A64Uint: return "R64G64B64A64Uint";
case vk::Format::eR64G64B64A64Sint: return "R64G64B64A64Sint";
case vk::Format::eR64G64B64A64Sfloat: return "R64G64B64A64Sfloat";
case vk::Format::eB10G11R11UfloatPack32: return "B10G11R11UfloatPack32";
case vk::Format::eE5B9G9R9UfloatPack32: return "E5B9G9R9UfloatPack32";
case vk::Format::eD16Unorm: return "D16Unorm";
case vk::Format::eX8D24UnormPack32: return "X8D24UnormPack32";
case vk::Format::eD32Sfloat: return "D32Sfloat";
case vk::Format::eS8Uint: return "S8Uint";
case vk::Format::eD16UnormS8Uint: return "D16UnormS8Uint";
case vk::Format::eD24UnormS8Uint: return "D24UnormS8Uint";
case vk::Format::eD32SfloatS8Uint: return "D32SfloatS8Uint";
case vk::Format::eBc1RgbUnormBlock: return "Bc1RgbUnormBlock";
case vk::Format::eBc1RgbSrgbBlock: return "Bc1RgbSrgbBlock";
case vk::Format::eBc1RgbaUnormBlock: return "Bc1RgbaUnormBlock";
case vk::Format::eBc1RgbaSrgbBlock: return "Bc1RgbaSrgbBlock";
case vk::Format::eBc2UnormBlock: return "Bc2UnormBlock";
case vk::Format::eBc2SrgbBlock: return "Bc2SrgbBlock";
case vk::Format::eBc3UnormBlock: return "Bc3UnormBlock";
case vk::Format::eBc3SrgbBlock: return "Bc3SrgbBlock";
case vk::Format::eBc4UnormBlock: return "Bc4UnormBlock";
case vk::Format::eBc4SnormBlock: return "Bc4SnormBlock";
case vk::Format::eBc5UnormBlock: return "Bc5UnormBlock";
case vk::Format::eBc5SnormBlock: return "Bc5SnormBlock";
case vk::Format::eBc6HUfloatBlock: return "Bc6HUfloatBlock";
case vk::Format::eBc6HSfloatBlock: return "Bc6HSfloatBlock";
case vk::Format::eBc7UnormBlock: return "Bc7UnormBlock";
case vk::Format::eBc7SrgbBlock: return "Bc7SrgbBlock";
case vk::Format::eEtc2R8G8B8UnormBlock: return "Etc2R8G8B8UnormBlock";
case vk::Format::eEtc2R8G8B8SrgbBlock: return "Etc2R8G8B8SrgbBlock";
case vk::Format::eEtc2R8G8B8A1UnormBlock: return "Etc2R8G8B8A1UnormBlock";
case vk::Format::eEtc2R8G8B8A1SrgbBlock: return "Etc2R8G8B8A1SrgbBlock";
case vk::Format::eEtc2R8G8B8A8UnormBlock: return "Etc2R8G8B8A8UnormBlock";
case vk::Format::eEtc2R8G8B8A8SrgbBlock: return "Etc2R8G8B8A8SrgbBlock";
case vk::Format::eEacR11UnormBlock: return "EacR11UnormBlock";
case vk::Format::eEacR11SnormBlock: return "EacR11SnormBlock";
case vk::Format::eEacR11G11UnormBlock: return "EacR11G11UnormBlock";
case vk::Format::eEacR11G11SnormBlock: return "EacR11G11SnormBlock";
case vk::Format::eAstc4x4UnormBlock: return "Astc4x4UnormBlock";
case vk::Format::eAstc4x4SrgbBlock: return "Astc4x4SrgbBlock";
case vk::Format::eAstc5x4UnormBlock: return "Astc5x4UnormBlock";
case vk::Format::eAstc5x4SrgbBlock: return "Astc5x4SrgbBlock";
case vk::Format::eAstc5x5UnormBlock: return "Astc5x5UnormBlock";
case vk::Format::eAstc5x5SrgbBlock: return "Astc5x5SrgbBlock";
case vk::Format::eAstc6x5UnormBlock: return "Astc6x5UnormBlock";
case vk::Format::eAstc6x5SrgbBlock: return "Astc6x5SrgbBlock";
case vk::Format::eAstc6x6UnormBlock: return "Astc6x6UnormBlock";
case vk::Format::eAstc6x6SrgbBlock: return "Astc6x6SrgbBlock";
case vk::Format::eAstc8x5UnormBlock: return "Astc8x5UnormBlock";
case vk::Format::eAstc8x5SrgbBlock: return "Astc8x5SrgbBlock";
case vk::Format::eAstc8x6UnormBlock: return "Astc8x6UnormBlock";
case vk::Format::eAstc8x6SrgbBlock: return "Astc8x6SrgbBlock";
case vk::Format::eAstc8x8UnormBlock: return "Astc8x8UnormBlock";
case vk::Format::eAstc8x8SrgbBlock: return "Astc8x8SrgbBlock";
case vk::Format::eAstc10x5UnormBlock: return "Astc10x5UnormBlock";
case vk::Format::eAstc10x5SrgbBlock: return "Astc10x5SrgbBlock";
case vk::Format::eAstc10x6UnormBlock: return "Astc10x6UnormBlock";
case vk::Format::eAstc10x6SrgbBlock: return "Astc10x6SrgbBlock";
case vk::Format::eAstc10x8UnormBlock: return "Astc10x8UnormBlock";
case vk::Format::eAstc10x8SrgbBlock: return "Astc10x8SrgbBlock";
case vk::Format::eAstc10x10UnormBlock: return "Astc10x10UnormBlock";
case vk::Format::eAstc10x10SrgbBlock: return "Astc10x10SrgbBlock";
case vk::Format::eAstc12x10UnormBlock: return "Astc12x10UnormBlock";
case vk::Format::eAstc12x10SrgbBlock: return "Astc12x10SrgbBlock";
case vk::Format::eAstc12x12UnormBlock: return "Astc12x12UnormBlock";
case vk::Format::eAstc12x12SrgbBlock: return "Astc12x12SrgbBlock";
case vk::Format::eG8B8G8R8422Unorm: return "G8B8G8R8422Unorm";
case vk::Format::eB8G8R8G8422Unorm: return "B8G8R8G8422Unorm";
case vk::Format::eG8B8R83Plane420Unorm: return "G8B8R83Plane420Unorm";
case vk::Format::eG8B8R82Plane420Unorm: return "G8B8R82Plane420Unorm";
case vk::Format::eG8B8R83Plane422Unorm: return "G8B8R83Plane422Unorm";
case vk::Format::eG8B8R82Plane422Unorm: return "G8B8R82Plane422Unorm";
case vk::Format::eG8B8R83Plane444Unorm: return "G8B8R83Plane444Unorm";
case vk::Format::eR10X6UnormPack16: return "R10X6UnormPack16";
case vk::Format::eR10X6G10X6Unorm2Pack16: return "R10X6G10X6Unorm2Pack16";
case vk::Format::eR10X6G10X6B10X6A10X6Unorm4Pack16: return "R10X6G10X6B10X6A10X6Unorm4Pack16";
case vk::Format::eG10X6B10X6G10X6R10X6422Unorm4Pack16: return "G10X6B10X6G10X6R10X6422Unorm4Pack16";
case vk::Format::eB10X6G10X6R10X6G10X6422Unorm4Pack16: return "B10X6G10X6R10X6G10X6422Unorm4Pack16";
case vk::Format::eG10X6B10X6R10X63Plane420Unorm3Pack16: return "G10X6B10X6R10X63Plane420Unorm3Pack16";
case vk::Format::eG10X6B10X6R10X62Plane420Unorm3Pack16: return "G10X6B10X6R10X62Plane420Unorm3Pack16";
case vk::Format::eG10X6B10X6R10X63Plane422Unorm3Pack16: return "G10X6B10X6R10X63Plane422Unorm3Pack16";
case vk::Format::eG10X6B10X6R10X62Plane422Unorm3Pack16: return "G10X6B10X6R10X62Plane422Unorm3Pack16";
case vk::Format::eG10X6B10X6R10X63Plane444Unorm3Pack16: return "G10X6B10X6R10X63Plane444Unorm3Pack16";
case vk::Format::eR12X4UnormPack16: return "R12X4UnormPack16";
case vk::Format::eR12X4G12X4Unorm2Pack16: return "R12X4G12X4Unorm2Pack16";
case vk::Format::eR12X4G12X4B12X4A12X4Unorm4Pack16: return "R12X4G12X4B12X4A12X4Unorm4Pack16";
case vk::Format::eG12X4B12X4G12X4R12X4422Unorm4Pack16: return "G12X4B12X4G12X4R12X4422Unorm4Pack16";
case vk::Format::eB12X4G12X4R12X4G12X4422Unorm4Pack16: return "B12X4G12X4R12X4G12X4422Unorm4Pack16";
case vk::Format::eG12X4B12X4R12X43Plane420Unorm3Pack16: return "G12X4B12X4R12X43Plane420Unorm3Pack16";
case vk::Format::eG12X4B12X4R12X42Plane420Unorm3Pack16: return "G12X4B12X4R12X42Plane420Unorm3Pack16";
case vk::Format::eG12X4B12X4R12X43Plane422Unorm3Pack16: return "G12X4B12X4R12X43Plane422Unorm3Pack16";
case vk::Format::eG12X4B12X4R12X42Plane422Unorm3Pack16: return "G12X4B12X4R12X42Plane422Unorm3Pack16";
case vk::Format::eG12X4B12X4R12X43Plane444Unorm3Pack16: return "G12X4B12X4R12X43Plane444Unorm3Pack16";
case vk::Format::eG16B16G16R16422Unorm: return "G16B16G16R16422Unorm";
case vk::Format::eB16G16R16G16422Unorm: return "B16G16R16G16422Unorm";
case vk::Format::eG16B16R163Plane420Unorm: return "G16B16R163Plane420Unorm";
case vk::Format::eG16B16R162Plane420Unorm: return "G16B16R162Plane420Unorm";
case vk::Format::eG16B16R163Plane422Unorm: return "G16B16R163Plane422Unorm";
case vk::Format::eG16B16R162Plane422Unorm: return "G16B16R162Plane422Unorm";
case vk::Format::eG16B16R163Plane444Unorm: return "G16B16R163Plane444Unorm";
case vk::Format::eG8B8R82Plane444Unorm: return "G8B8R82Plane444Unorm";
case vk::Format::eG10X6B10X6R10X62Plane444Unorm3Pack16: return "G10X6B10X6R10X62Plane444Unorm3Pack16";
case vk::Format::eG12X4B12X4R12X42Plane444Unorm3Pack16: return "G12X4B12X4R12X42Plane444Unorm3Pack16";
case vk::Format::eG16B16R162Plane444Unorm: return "G16B16R162Plane444Unorm";
case vk::Format::eA4R4G4B4UnormPack16: return "A4R4G4B4UnormPack16";
case vk::Format::eA4B4G4R4UnormPack16: return "A4B4G4R4UnormPack16";
case vk::Format::eAstc4x4SfloatBlock: return "Astc4x4SfloatBlock";
case vk::Format::eAstc5x4SfloatBlock: return "Astc5x4SfloatBlock";
case vk::Format::eAstc5x5SfloatBlock: return "Astc5x5SfloatBlock";
case vk::Format::eAstc6x5SfloatBlock: return "Astc6x5SfloatBlock";
case vk::Format::eAstc6x6SfloatBlock: return "Astc6x6SfloatBlock";
case vk::Format::eAstc8x5SfloatBlock: return "Astc8x5SfloatBlock";
case vk::Format::eAstc8x6SfloatBlock: return "Astc8x6SfloatBlock";
case vk::Format::eAstc8x8SfloatBlock: return "Astc8x8SfloatBlock";
case vk::Format::eAstc10x5SfloatBlock: return "Astc10x5SfloatBlock";
case vk::Format::eAstc10x6SfloatBlock: return "Astc10x6SfloatBlock";
case vk::Format::eAstc10x8SfloatBlock: return "Astc10x8SfloatBlock";
case vk::Format::eAstc10x10SfloatBlock: return "Astc10x10SfloatBlock";
case vk::Format::eAstc12x10SfloatBlock: return "Astc12x10SfloatBlock";
case vk::Format::eAstc12x12SfloatBlock: return "Astc12x12SfloatBlock";
case vk::Format::ePvrtc12BppUnormBlockIMG: return "Pvrtc12BppUnormBlockIMG";
case vk::Format::ePvrtc14BppUnormBlockIMG: return "Pvrtc14BppUnormBlockIMG";
case vk::Format::ePvrtc22BppUnormBlockIMG: return "Pvrtc22BppUnormBlockIMG";
case vk::Format::ePvrtc24BppUnormBlockIMG: return "Pvrtc24BppUnormBlockIMG";
case vk::Format::ePvrtc12BppSrgbBlockIMG: return "Pvrtc12BppSrgbBlockIMG";
case vk::Format::ePvrtc14BppSrgbBlockIMG: return "Pvrtc14BppSrgbBlockIMG";
case vk::Format::ePvrtc22BppSrgbBlockIMG: return "Pvrtc22BppSrgbBlockIMG";
case vk::Format::ePvrtc24BppSrgbBlockIMG: return "Pvrtc24BppSrgbBlockIMG";
default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast<uint32_t>( value ) ) + " )";
}
}
} // namespace local
using local::to_string;
#else
using vk::to_string;
#endif
int main( int /*argc*/, char ** /*argv*/ )
{
try
@@ -48,11 +335,9 @@ int main( int /*argc*/, char ** /*argv*/ )
std::vector<vk::SurfaceFormatKHR> surfaceFormats = physicalDevices[i].getSurfaceFormatsKHR( surfaceData.surface );
for ( size_t j = 0; j < surfaceFormats.size(); j++ )
{
std::cout << "\tFormat " << j << "\n";
std::cout << "\t\t"
<< "colorSpace = " << vk::to_string( surfaceFormats[j].colorSpace ) << "\n";
std::cout << "\t\t"
<< "format = " << vk::to_string( surfaceFormats[j].format ) << "\n";
std::cout << std::string( "\t" ) << "Format " << j << "\n";
std::cout << std::string( "\t\t" ) << "colorSpace = " << to_string( surfaceFormats[j].colorSpace ) << "\n";
std::cout << std::string( "\t\t" ) << "format = " << to_string( surfaceFormats[j].format ) << "\n";
std::cout << "\n";
}
}

View File

@@ -361,6 +361,97 @@ namespace vk
return device.createRenderPass( vk::RenderPassCreateInfo( vk::RenderPassCreateFlags(), attachmentDescriptions, subpassDescription ) );
}
#if defined( VULKAN_HPP_NO_TO_STRING )
namespace local
{
std::string to_string( vk::DebugUtilsMessageSeverityFlagBitsEXT value )
{
switch ( value )
{
case vk::DebugUtilsMessageSeverityFlagBitsEXT::eVerbose: return "Verbose";
case vk::DebugUtilsMessageSeverityFlagBitsEXT::eInfo: return "Info";
case vk::DebugUtilsMessageSeverityFlagBitsEXT::eWarning: return "Warning";
case vk::DebugUtilsMessageSeverityFlagBitsEXT::eError: return "Error";
default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast<uint32_t>( value ) ) + " )";
}
}
std::string to_string( vk::DebugUtilsMessageTypeFlagsEXT value )
{
if ( !value )
return "{}";
std::string result;
if ( value & vk::DebugUtilsMessageTypeFlagBitsEXT::eGeneral )
result += "General | ";
if ( value & vk::DebugUtilsMessageTypeFlagBitsEXT::eValidation )
result += "Validation | ";
if ( value & vk::DebugUtilsMessageTypeFlagBitsEXT::ePerformance )
result += "Performance | ";
return "{ " + result.substr( 0, result.size() - 3 ) + " }";
}
std::string to_string( vk::ObjectType value )
{
switch ( value )
{
case vk::ObjectType::eUnknown: return "Unknown";
case vk::ObjectType::eInstance: return "Instance";
case vk::ObjectType::ePhysicalDevice: return "PhysicalDevice";
case vk::ObjectType::eDevice: return "Device";
case vk::ObjectType::eQueue: return "Queue";
case vk::ObjectType::eSemaphore: return "Semaphore";
case vk::ObjectType::eCommandBuffer: return "CommandBuffer";
case vk::ObjectType::eFence: return "Fence";
case vk::ObjectType::eDeviceMemory: return "DeviceMemory";
case vk::ObjectType::eBuffer: return "Buffer";
case vk::ObjectType::eImage: return "Image";
case vk::ObjectType::eEvent: return "Event";
case vk::ObjectType::eQueryPool: return "QueryPool";
case vk::ObjectType::eBufferView: return "BufferView";
case vk::ObjectType::eImageView: return "ImageView";
case vk::ObjectType::eShaderModule: return "ShaderModule";
case vk::ObjectType::ePipelineCache: return "PipelineCache";
case vk::ObjectType::ePipelineLayout: return "PipelineLayout";
case vk::ObjectType::eRenderPass: return "RenderPass";
case vk::ObjectType::ePipeline: return "Pipeline";
case vk::ObjectType::eDescriptorSetLayout: return "DescriptorSetLayout";
case vk::ObjectType::eSampler: return "Sampler";
case vk::ObjectType::eDescriptorPool: return "DescriptorPool";
case vk::ObjectType::eDescriptorSet: return "DescriptorSet";
case vk::ObjectType::eFramebuffer: return "Framebuffer";
case vk::ObjectType::eCommandPool: return "CommandPool";
case vk::ObjectType::eSamplerYcbcrConversion: return "SamplerYcbcrConversion";
case vk::ObjectType::eDescriptorUpdateTemplate: return "DescriptorUpdateTemplate";
case vk::ObjectType::ePrivateDataSlot: return "PrivateDataSlot";
case vk::ObjectType::eSurfaceKHR: return "SurfaceKHR";
case vk::ObjectType::eSwapchainKHR: return "SwapchainKHR";
case vk::ObjectType::eDisplayKHR: return "DisplayKHR";
case vk::ObjectType::eDisplayModeKHR: return "DisplayModeKHR";
case vk::ObjectType::eDebugReportCallbackEXT: return "DebugReportCallbackEXT";
# if defined( VK_ENABLE_BETA_EXTENSIONS )
case vk::ObjectType::eVideoSessionKHR: return "VideoSessionKHR";
case vk::ObjectType::eVideoSessionParametersKHR: return "VideoSessionParametersKHR";
# endif /*VK_ENABLE_BETA_EXTENSIONS*/
case vk::ObjectType::eCuModuleNVX: return "CuModuleNVX";
case vk::ObjectType::eCuFunctionNVX: return "CuFunctionNVX";
case vk::ObjectType::eDebugUtilsMessengerEXT: return "DebugUtilsMessengerEXT";
case vk::ObjectType::eAccelerationStructureKHR: return "AccelerationStructureKHR";
case vk::ObjectType::eValidationCacheEXT: return "ValidationCacheEXT";
case vk::ObjectType::eAccelerationStructureNV: return "AccelerationStructureNV";
case vk::ObjectType::ePerformanceConfigurationINTEL: return "PerformanceConfigurationINTEL";
case vk::ObjectType::eDeferredOperationKHR: return "DeferredOperationKHR";
case vk::ObjectType::eIndirectCommandsLayoutNV: return "IndirectCommandsLayoutNV";
# if defined( VK_USE_PLATFORM_FUCHSIA )
case vk::ObjectType::eBufferCollectionFUCHSIA: return "BufferCollectionFUCHSIA";
# endif /*VK_USE_PLATFORM_FUCHSIA*/
default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast<uint32_t>( value ) ) + " )";
}
}
} // namespace local
#endif
VKAPI_ATTR VkBool32 VKAPI_CALL debugUtilsMessengerCallback( VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity,
VkDebugUtilsMessageTypeFlagsEXT messageTypes,
VkDebugUtilsMessengerCallbackDataEXT const * pCallbackData,
@@ -379,50 +470,49 @@ namespace vk
}
#endif
#if defined( VULKAN_HPP_NO_TO_STRING )
std::cerr << local::to_string( static_cast<vk::DebugUtilsMessageSeverityFlagBitsEXT>( messageSeverity ) ) << ": "
<< local::to_string( static_cast<vk::DebugUtilsMessageTypeFlagsEXT>( messageTypes ) ) << ":\n";
#else
std::cerr << vk::to_string( static_cast<vk::DebugUtilsMessageSeverityFlagBitsEXT>( messageSeverity ) ) << ": "
<< vk::to_string( static_cast<vk::DebugUtilsMessageTypeFlagsEXT>( messageTypes ) ) << ":\n";
std::cerr << "\t"
<< "messageIDName = <" << pCallbackData->pMessageIdName << ">\n";
std::cerr << "\t"
<< "messageIdNumber = " << pCallbackData->messageIdNumber << "\n";
std::cerr << "\t"
<< "message = <" << pCallbackData->pMessage << ">\n";
#endif
std::cerr << std::string( "\t" ) << "messageIDName = <" << pCallbackData->pMessageIdName << ">\n";
std::cerr << std::string( "\t" ) << "messageIdNumber = " << pCallbackData->messageIdNumber << "\n";
std::cerr << std::string( "\t" ) << "message = <" << pCallbackData->pMessage << ">\n";
if ( 0 < pCallbackData->queueLabelCount )
{
std::cerr << "\t"
<< "Queue Labels:\n";
std::cerr << std::string( "\t" ) << "Queue Labels:\n";
for ( uint32_t i = 0; i < pCallbackData->queueLabelCount; i++ )
{
std::cerr << "\t\t"
<< "labelName = <" << pCallbackData->pQueueLabels[i].pLabelName << ">\n";
std::cerr << std::string( "\t\t" ) << "labelName = <" << pCallbackData->pQueueLabels[i].pLabelName << ">\n";
}
}
if ( 0 < pCallbackData->cmdBufLabelCount )
{
std::cerr << "\t"
<< "CommandBuffer Labels:\n";
std::cerr << std::string( "\t" ) << "CommandBuffer Labels:\n";
for ( uint32_t i = 0; i < pCallbackData->cmdBufLabelCount; i++ )
{
std::cerr << "\t\t"
<< "labelName = <" << pCallbackData->pCmdBufLabels[i].pLabelName << ">\n";
std::cerr << std::string( "\t\t" ) << "labelName = <" << pCallbackData->pCmdBufLabels[i].pLabelName << ">\n";
}
}
if ( 0 < pCallbackData->objectCount )
{
std::cerr << "\t"
<< "Objects:\n";
std::cerr << std::string( "\t" ) << "Objects:\n";
for ( uint32_t i = 0; i < pCallbackData->objectCount; i++ )
{
std::cerr << "\t\t"
<< "Object " << i << "\n";
std::cerr << "\t\t\t"
<< "objectType = " << vk::to_string( static_cast<vk::ObjectType>( pCallbackData->pObjects[i].objectType ) ) << "\n";
std::cerr << "\t\t\t"
<< "objectHandle = " << pCallbackData->pObjects[i].objectHandle << "\n";
std::cerr << std::string( "\t\t" ) << "Object " << i << "\n";
#if defined( VULKAN_HPP_NO_TO_STRING )
std::cerr << std::string( "\t\t\t" ) << "objectType = " << local::to_string( static_cast<vk::ObjectType>( pCallbackData->pObjects[i].objectType ) )
<< "\n";
#else
std::cerr << std::string( "\t\t\t" ) << "objectType = " << vk::to_string( static_cast<vk::ObjectType>( pCallbackData->pObjects[i].objectType ) )
<< "\n";
#endif
std::cerr << std::string( "\t\t\t" ) << "objectHandle = " << pCallbackData->pObjects[i].objectHandle << "\n";
if ( pCallbackData->pObjects[i].pObjectName )
{
std::cerr << "\t\t\t"
<< "objectName = <" << pCallbackData->pObjects[i].pObjectName << ">\n";
std::cerr << std::string( "\t\t\t" ) << "objectName = <" << pCallbackData->pObjects[i].pObjectName << ">\n";
}
}
}