#include #include VK_NAMESPACE_BEGIN namespace { void debug_queue_family_properties_out(const char *front,const List &qfp_list) { constexpr char *queue_bit_name[]= { "Graphics", "Compute", "Transfer", "SparseBinding", "Protected", "VideoDecode", "VideoEncode" }; const int count=qfp_list.GetCount(); if(count<=0)return; const VkQueueFamilyProperties *p=qfp_list.GetData(); for(int i=0;iqueueCount <<", timestampValidBits: "<timestampValidBits <<", minImageTransferGranularity [" <minImageTransferGranularity.width<<"," <minImageTransferGranularity.height<<"," <minImageTransferGranularity.depth<<"], queueFlags["; uint32_t bits=p->queueFlags; for(uint i=0;i<7;i++) { if(bits&1) { std::cout<>=1; if(bits>0)std::cout<<","; } else { bits>>=1; } } std::cout<<"]"<>=1; } // No memory types matched, return failure return -1; } VkFormat GPUPhysicalDevice::GetDepthFormat(bool lower_to_high)const { constexpr VkFormat depthFormats[] = { PF_D16UN, PF_X8_D24UN, PF_D16UN_S8U, PF_D24UN_S8U, PF_D32F, PF_D32F_S8U }; VkFormat result=VK_FORMAT_UNDEFINED; for (auto& format : depthFormats) { if(IsDepthAttachmentOptimal(format)) { if(lower_to_high) return format; else result=format; } } return result; } VkFormat GPUPhysicalDevice::GetDepthStencilFormat(bool lower_to_high)const { constexpr VkFormat depthStencilFormats[] = { PF_D16UN_S8U, PF_D24UN_S8U, PF_D32F_S8U }; VkFormat result=VK_FORMAT_UNDEFINED; for (auto& format : depthStencilFormats) { if(IsDepthAttachmentOptimal(format)) { if(lower_to_high) return format; else result=format; } } return result; } VK_NAMESPACE_END