Introduce usage of clang-format to format vulkan.hpp and the other sources.
This commit is contained in:
@@ -17,18 +17,19 @@
|
||||
|
||||
#include "../utils/utils.hpp"
|
||||
#include "vulkan/vulkan.hpp"
|
||||
|
||||
#include <vector>
|
||||
|
||||
static char const* AppName = "DeviceExtensionProperties";
|
||||
static char const* EngineName = "Vulkan.hpp";
|
||||
static char const * AppName = "DeviceExtensionProperties";
|
||||
static char const * EngineName = "Vulkan.hpp";
|
||||
|
||||
int main(int /*argc*/, char ** /*argv*/)
|
||||
int main( int /*argc*/, char ** /*argv*/ )
|
||||
{
|
||||
try
|
||||
{
|
||||
vk::UniqueInstance instance = vk::su::createInstance(AppName, EngineName);
|
||||
#if !defined(NDEBUG)
|
||||
vk::UniqueDebugUtilsMessengerEXT debugUtilsMessenger = vk::su::createDebugUtilsMessenger(instance);
|
||||
vk::UniqueInstance instance = vk::su::createInstance( AppName, EngineName );
|
||||
#if !defined( NDEBUG )
|
||||
vk::UniqueDebugUtilsMessengerEXT debugUtilsMessenger = vk::su::createDebugUtilsMessenger( instance );
|
||||
#endif
|
||||
|
||||
// enumerate the physicalDevices
|
||||
@@ -36,14 +37,19 @@ int main(int /*argc*/, char ** /*argv*/)
|
||||
|
||||
/* VULKAN_KEY_START */
|
||||
|
||||
for (size_t i=0 ; i<physicalDevices.size() ; i++)
|
||||
for ( size_t i = 0; i < physicalDevices.size(); i++ )
|
||||
{
|
||||
std::cout << "PhysicalDevice " << i << "\n";
|
||||
std::vector<vk::ExtensionProperties> extensionProperties = physicalDevices[i].enumerateDeviceExtensionProperties();
|
||||
std::vector<vk::ExtensionProperties> extensionProperties =
|
||||
physicalDevices[i].enumerateDeviceExtensionProperties();
|
||||
|
||||
// sort the extensions alphabetically
|
||||
std::sort(extensionProperties.begin(), extensionProperties.end(), [](vk::ExtensionProperties const& a, vk::ExtensionProperties const& b) { return strcmp(a.extensionName, b.extensionName) < 0; });
|
||||
for (auto const& ep : extensionProperties)
|
||||
std::sort( extensionProperties.begin(),
|
||||
extensionProperties.end(),
|
||||
[]( vk::ExtensionProperties const & a, vk::ExtensionProperties const & b ) {
|
||||
return strcmp( a.extensionName, b.extensionName ) < 0;
|
||||
} );
|
||||
for ( auto const & ep : extensionProperties )
|
||||
{
|
||||
std::cout << "\t" << ep.extensionName << ":" << std::endl;
|
||||
std::cout << "\t\tVersion: " << ep.specVersion << std::endl;
|
||||
@@ -53,20 +59,20 @@ int main(int /*argc*/, char ** /*argv*/)
|
||||
|
||||
/* VULKAN_KEY_END */
|
||||
}
|
||||
catch (vk::SystemError& err)
|
||||
catch ( vk::SystemError & err )
|
||||
{
|
||||
std::cout << "vk::SystemError: " << err.what() << std::endl;
|
||||
exit(-1);
|
||||
exit( -1 );
|
||||
}
|
||||
catch (std::runtime_error& err)
|
||||
catch ( std::runtime_error & err )
|
||||
{
|
||||
std::cout << "std::runtime_error: " << err.what() << std::endl;
|
||||
exit(-1);
|
||||
exit( -1 );
|
||||
}
|
||||
catch (...)
|
||||
catch ( ... )
|
||||
{
|
||||
std::cout << "unknown error\n";
|
||||
exit(-1);
|
||||
exit( -1 );
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user