Introduce usage of clang-format to format vulkan.hpp and the other sources.

This commit is contained in:
asuessenbach
2020-04-12 21:49:12 +02:00
parent ce9fd81bd9
commit f5e59484a6
68 changed files with 56064 additions and 35586 deletions

View File

@@ -17,19 +17,20 @@
#include "../utils/utils.hpp"
#include "vulkan/vulkan.hpp"
#include <iomanip>
#include <iostream>
static char const* AppName = "EnumerateDevicesAdvanced";
static char const* EngineName = "Vulkan.hpp";
static char const * AppName = "EnumerateDevicesAdvanced";
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
/* VULKAN_HPP_KEY_START */
@@ -37,41 +38,41 @@ int main(int /*argc*/, char ** /*argv*/)
// enumerate the physicalDevices
std::vector<vk::PhysicalDevice> physicalDevices = instance->enumeratePhysicalDevices();
for (auto const& physicalDevice : physicalDevices)
for ( auto const & physicalDevice : physicalDevices )
{
vk::PhysicalDeviceProperties properties = physicalDevice.getProperties();
std::cout << "apiVersion: ";
std::cout << ((properties.apiVersion >> 22) & 0xfff) << '.'; // Major.
std::cout << ((properties.apiVersion >> 12) & 0x3ff) << '.'; // Minor.
std::cout << (properties.apiVersion & 0xfff); // Patch.
std::cout << ( ( properties.apiVersion >> 22 ) & 0xfff ) << '.'; // Major.
std::cout << ( ( properties.apiVersion >> 12 ) & 0x3ff ) << '.'; // Minor.
std::cout << ( properties.apiVersion & 0xfff ); // Patch.
std::cout << '\n';
std::cout << "driverVersion: " << properties.driverVersion << '\n';
std::cout << std::showbase << std::internal << std::setfill('0') << std::hex;
std::cout << "vendorId: " << std::setw(6) << properties.vendorID << '\n';
std::cout << "deviceId: " << std::setw(6) << properties.deviceID << '\n';
std::cout << std::noshowbase << std::right << std::setfill(' ') << std::dec;
std::cout << std::showbase << std::internal << std::setfill( '0' ) << std::hex;
std::cout << "vendorId: " << std::setw( 6 ) << properties.vendorID << '\n';
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: " << vk::to_string( properties.deviceType ) << "\n";
std::cout << "deviceName: " << properties.deviceName << '\n';
std::cout << "pipelineCacheUUID: " << vk::su::UUID(properties.pipelineCacheUUID) << "\n\n";
std::cout << "pipelineCacheUUID: " << vk::su::UUID( properties.pipelineCacheUUID ) << "\n\n";
}
/* VULKAN_HPP_KEY_END */
}
catch (vk::SystemError& err)
catch ( vk::SystemError & err )
{
std::cout << "vk::SystemError: " << err.what() << std::endl;
exit(-1);
exit( -1 );
}
catch (...)
catch ( ... )
{
std::cout << "unknown error\n";
exit(-1);
exit( -1 );
}
return 0;
}