Change ColumnLimit with clang-format from 120 to 160.
This commit is contained in:
@@ -27,15 +27,14 @@ int main( int /*argc*/, char ** /*argv*/ )
|
||||
try
|
||||
{
|
||||
vk::raii::Context context;
|
||||
vk::raii::Instance instance =
|
||||
vk::raii::su::makeInstance( context, AppName, EngineName, {}, vk::su::getInstanceExtensions() );
|
||||
vk::raii::Instance instance = vk::raii::su::makeInstance( context, AppName, EngineName, {}, vk::su::getInstanceExtensions() );
|
||||
#if !defined( NDEBUG )
|
||||
vk::raii::DebugUtilsMessengerEXT debugUtilsMessenger( instance, vk::su::makeDebugUtilsMessengerCreateInfoEXT() );
|
||||
#endif
|
||||
vk::raii::PhysicalDevice physicalDevice = std::move( vk::raii::PhysicalDevices( instance ).front() );
|
||||
|
||||
std::vector<vk::QueueFamilyProperties> queueFamilyProperties = physicalDevice.getQueueFamilyProperties();
|
||||
uint32_t graphicsQueueFamilyIndex = vk::su::findGraphicsQueueFamilyIndex( queueFamilyProperties );
|
||||
std::vector<vk::QueueFamilyProperties> queueFamilyProperties = physicalDevice.getQueueFamilyProperties();
|
||||
uint32_t graphicsQueueFamilyIndex = vk::su::findGraphicsQueueFamilyIndex( queueFamilyProperties );
|
||||
|
||||
/* VULKAN_HPP_KEY_START */
|
||||
|
||||
@@ -79,31 +78,26 @@ int main( int /*argc*/, char ** /*argv*/ )
|
||||
}
|
||||
}
|
||||
}
|
||||
if ( ( graphicsQueueFamilyIndex == queueFamilyProperties.size() ) ||
|
||||
( presentQueueFamilyIndex == queueFamilyProperties.size() ) )
|
||||
if ( ( graphicsQueueFamilyIndex == queueFamilyProperties.size() ) || ( presentQueueFamilyIndex == queueFamilyProperties.size() ) )
|
||||
{
|
||||
throw std::runtime_error( "Could not find a queue for graphics or present -> terminating" );
|
||||
}
|
||||
|
||||
// create a device
|
||||
vk::raii::Device device =
|
||||
vk::raii::su::makeDevice( physicalDevice, graphicsQueueFamilyIndex, vk::su::getDeviceExtensions() );
|
||||
vk::raii::Device device = vk::raii::su::makeDevice( physicalDevice, graphicsQueueFamilyIndex, vk::su::getDeviceExtensions() );
|
||||
|
||||
// get the supported VkFormats
|
||||
std::vector<vk::SurfaceFormatKHR> formats = physicalDevice.getSurfaceFormatsKHR( *surface );
|
||||
assert( !formats.empty() );
|
||||
vk::Format format =
|
||||
( formats[0].format == vk::Format::eUndefined ) ? vk::Format::eB8G8R8A8Unorm : formats[0].format;
|
||||
vk::Format format = ( formats[0].format == vk::Format::eUndefined ) ? vk::Format::eB8G8R8A8Unorm : formats[0].format;
|
||||
|
||||
vk::SurfaceCapabilitiesKHR surfaceCapabilities = physicalDevice.getSurfaceCapabilitiesKHR( *surface );
|
||||
vk::Extent2D swapchainExtent;
|
||||
if ( surfaceCapabilities.currentExtent.width == std::numeric_limits<uint32_t>::max() )
|
||||
{
|
||||
// If the surface size is undefined, the size is set to the size of the images requested.
|
||||
swapchainExtent.width =
|
||||
vk::su::clamp( width, surfaceCapabilities.minImageExtent.width, surfaceCapabilities.maxImageExtent.width );
|
||||
swapchainExtent.height =
|
||||
vk::su::clamp( height, surfaceCapabilities.minImageExtent.height, surfaceCapabilities.maxImageExtent.height );
|
||||
swapchainExtent.width = vk::su::clamp( width, surfaceCapabilities.minImageExtent.width, surfaceCapabilities.maxImageExtent.width );
|
||||
swapchainExtent.height = vk::su::clamp( height, surfaceCapabilities.minImageExtent.height, surfaceCapabilities.maxImageExtent.height );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -114,19 +108,15 @@ int main( int /*argc*/, char ** /*argv*/ )
|
||||
// The FIFO present mode is guaranteed by the spec to be supported
|
||||
vk::PresentModeKHR swapchainPresentMode = vk::PresentModeKHR::eFifo;
|
||||
|
||||
vk::SurfaceTransformFlagBitsKHR preTransform =
|
||||
( surfaceCapabilities.supportedTransforms & vk::SurfaceTransformFlagBitsKHR::eIdentity )
|
||||
? vk::SurfaceTransformFlagBitsKHR::eIdentity
|
||||
: surfaceCapabilities.currentTransform;
|
||||
vk::SurfaceTransformFlagBitsKHR preTransform = ( surfaceCapabilities.supportedTransforms & vk::SurfaceTransformFlagBitsKHR::eIdentity )
|
||||
? vk::SurfaceTransformFlagBitsKHR::eIdentity
|
||||
: surfaceCapabilities.currentTransform;
|
||||
|
||||
vk::CompositeAlphaFlagBitsKHR compositeAlpha =
|
||||
( surfaceCapabilities.supportedCompositeAlpha & vk::CompositeAlphaFlagBitsKHR::ePreMultiplied )
|
||||
? vk::CompositeAlphaFlagBitsKHR::ePreMultiplied
|
||||
: ( surfaceCapabilities.supportedCompositeAlpha & vk::CompositeAlphaFlagBitsKHR::ePostMultiplied )
|
||||
? vk::CompositeAlphaFlagBitsKHR::ePostMultiplied
|
||||
: ( surfaceCapabilities.supportedCompositeAlpha & vk::CompositeAlphaFlagBitsKHR::eInherit )
|
||||
? vk::CompositeAlphaFlagBitsKHR::eInherit
|
||||
: vk::CompositeAlphaFlagBitsKHR::eOpaque;
|
||||
( surfaceCapabilities.supportedCompositeAlpha & vk::CompositeAlphaFlagBitsKHR::ePreMultiplied ) ? vk::CompositeAlphaFlagBitsKHR::ePreMultiplied
|
||||
: ( surfaceCapabilities.supportedCompositeAlpha & vk::CompositeAlphaFlagBitsKHR::ePostMultiplied ) ? vk::CompositeAlphaFlagBitsKHR::ePostMultiplied
|
||||
: ( surfaceCapabilities.supportedCompositeAlpha & vk::CompositeAlphaFlagBitsKHR::eInherit ) ? vk::CompositeAlphaFlagBitsKHR::eInherit
|
||||
: vk::CompositeAlphaFlagBitsKHR::eOpaque;
|
||||
|
||||
vk::SwapchainCreateInfoKHR swapChainCreateInfo( vk::SwapchainCreateFlagsKHR(),
|
||||
*surface,
|
||||
@@ -160,8 +150,7 @@ int main( int /*argc*/, char ** /*argv*/ )
|
||||
|
||||
std::vector<vk::raii::ImageView> imageViews;
|
||||
imageViews.reserve( swapChainImages.size() );
|
||||
vk::ImageViewCreateInfo imageViewCreateInfo(
|
||||
{}, {}, vk::ImageViewType::e2D, format, {}, { vk::ImageAspectFlagBits::eColor, 0, 1, 0, 1 } );
|
||||
vk::ImageViewCreateInfo imageViewCreateInfo( {}, {}, vk::ImageViewType::e2D, format, {}, { vk::ImageAspectFlagBits::eColor, 0, 1, 0, 1 } );
|
||||
for ( auto image : swapChainImages )
|
||||
{
|
||||
imageViewCreateInfo.image = static_cast<vk::Image>( image );
|
||||
|
||||
Reference in New Issue
Block a user