Refactor the CMakeLists for all the samples; use vulkan.hpp/vulkan_raii.hpp as precompiled header.

This commit is contained in:
asuessenbach
2022-08-10 11:19:06 +02:00
parent 1a64b5fcc0
commit 5480d192f5
200 changed files with 299 additions and 2068 deletions

View File

@@ -16,7 +16,6 @@
// Initialize a swapchain
#include "../utils/utils.hpp"
#include "vulkan/vulkan.hpp"
#include <iostream>
@@ -52,8 +51,8 @@ int main( int /*argc*/, char ** /*argv*/ )
// determine a queueFamilyIndex that suports present
// first check if the graphicsQueueFamiliyIndex is good enough
size_t presentQueueFamilyIndex = physicalDevice.getSurfaceSupportKHR( static_cast<uint32_t>( graphicsQueueFamilyIndex ), surface )
? graphicsQueueFamilyIndex
: queueFamilyProperties.size();
? graphicsQueueFamilyIndex
: queueFamilyProperties.size();
if ( presentQueueFamilyIndex == queueFamilyProperties.size() )
{
// the graphicsQueueFamilyIndex doesn't support present -> look for an other family index that supports both
@@ -113,8 +112,8 @@ int main( int /*argc*/, char ** /*argv*/ )
vk::PresentModeKHR swapchainPresentMode = vk::PresentModeKHR::eFifo;
vk::SurfaceTransformFlagBitsKHR preTransform = ( surfaceCapabilities.supportedTransforms & vk::SurfaceTransformFlagBitsKHR::eIdentity )
? vk::SurfaceTransformFlagBitsKHR::eIdentity
: surfaceCapabilities.currentTransform;
? vk::SurfaceTransformFlagBitsKHR::eIdentity
: surfaceCapabilities.currentTransform;
vk::CompositeAlphaFlagBitsKHR compositeAlpha =
( surfaceCapabilities.supportedCompositeAlpha & vk::CompositeAlphaFlagBitsKHR::ePreMultiplied ) ? vk::CompositeAlphaFlagBitsKHR::ePreMultiplied

View File

@@ -14,22 +14,4 @@
cmake_minimum_required(VERSION 3.2)
project(05_InitSwapchain)
set(HEADERS
)
set(SOURCES
05_InitSwapchain.cpp
)
source_group(headers FILES ${HEADERS})
source_group(sources FILES ${SOURCES})
add_executable(05_InitSwapchain
${HEADERS}
${SOURCES}
)
set_target_properties(05_InitSwapchain PROPERTIES FOLDER "Samples")
target_link_libraries(05_InitSwapchain PRIVATE utils)
vulkan_hpp__setup_sample_dynamic( NAME 05_InitSwapchain )