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,45 +17,46 @@
#define VULKAN_HPP_DISPATCH_LOADER_DYNAMIC 1
#include <vulkan/vulkan.h>
#include "vulkan/vulkan.hpp"
#include <iostream>
#include <map>
#include <vulkan/vulkan.h>
VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE
int main(int /*argc*/, char ** /*argv*/)
int main( int /*argc*/, char ** /*argv*/ )
{
try
{
vk::DynamicLoader dl;
PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr = dl.getProcAddress<PFN_vkGetInstanceProcAddr>("vkGetInstanceProcAddr");
VULKAN_HPP_DEFAULT_DISPATCHER.init(vkGetInstanceProcAddr);
vk::DynamicLoader dl;
PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr =
dl.getProcAddress<PFN_vkGetInstanceProcAddr>( "vkGetInstanceProcAddr" );
VULKAN_HPP_DEFAULT_DISPATCHER.init( vkGetInstanceProcAddr );
vk::Instance instance = vk::createInstance({}, nullptr);
vk::Instance instance = vk::createInstance( {}, nullptr );
// initialize function pointers for instance
VULKAN_HPP_DEFAULT_DISPATCHER.init(instance);
VULKAN_HPP_DEFAULT_DISPATCHER.init( instance );
// create a dispatcher, based on additional vkDevice/vkGetDeviceProcAddr
std::vector<vk::PhysicalDevice> physicalDevices = instance.enumeratePhysicalDevices();
assert(!physicalDevices.empty());
assert( !physicalDevices.empty() );
vk::Device device = physicalDevices[0].createDevice({}, nullptr);
vk::Device device = physicalDevices[0].createDevice( {}, nullptr );
// function pointer specialization for device
VULKAN_HPP_DEFAULT_DISPATCHER.init(device);
VULKAN_HPP_DEFAULT_DISPATCHER.init( device );
}
catch (vk::SystemError const& err)
catch ( vk::SystemError const & 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;