From 4c9b1f87b3d5b0fea95cb5349accd8eaf38ea28c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20S=C3=BC=C3=9Fenbach?= Date: Mon, 7 May 2018 14:28:11 +0200 Subject: [PATCH] Samples on vulkan.hpp: 09_InitDescriptorSet.cpp, 10_InitRenderPass. (#211) + add some missing exit code to some samples. --- samples/05_InitSwapchain/05_InitSwapchain.cpp | 1 + .../06_InitDepthBuffer/06_InitDepthBuffer.cpp | 1 + .../07_InitUniformBuffer.cpp | 1 + .../08_InitPipelineLayout.cpp | 1 + .../09_InitDescriptorSet.cpp | 92 +++++++ samples/09_InitDescriptorSet/CMakeLists.txt | 35 +++ .../10_InitRenderPass/10_InitRenderPass.cpp | 252 ++++++++++++++++++ samples/10_InitRenderPass/CMakeLists.txt | 35 +++ 8 files changed, 418 insertions(+) create mode 100644 samples/09_InitDescriptorSet/09_InitDescriptorSet.cpp create mode 100644 samples/09_InitDescriptorSet/CMakeLists.txt create mode 100644 samples/10_InitRenderPass/10_InitRenderPass.cpp create mode 100644 samples/10_InitRenderPass/CMakeLists.txt diff --git a/samples/05_InitSwapchain/05_InitSwapchain.cpp b/samples/05_InitSwapchain/05_InitSwapchain.cpp index 80f262d..b7242b6 100644 --- a/samples/05_InitSwapchain/05_InitSwapchain.cpp +++ b/samples/05_InitSwapchain/05_InitSwapchain.cpp @@ -271,6 +271,7 @@ int main(int argc, char *argv[]) catch (std::runtime_error err) { std::cout << "std::runtime_error: " << err.what() << std::endl; + exit(-1); } catch (...) { diff --git a/samples/06_InitDepthBuffer/06_InitDepthBuffer.cpp b/samples/06_InitDepthBuffer/06_InitDepthBuffer.cpp index adfc183..fc0d6c3 100644 --- a/samples/06_InitDepthBuffer/06_InitDepthBuffer.cpp +++ b/samples/06_InitDepthBuffer/06_InitDepthBuffer.cpp @@ -252,6 +252,7 @@ int main(int argc, char *argv[]) catch (std::runtime_error err) { std::cout << "std::runtime_error: " << err.what() << std::endl; + exit(-1); } catch (...) { diff --git a/samples/07_InitUniformBuffer/07_InitUniformBuffer.cpp b/samples/07_InitUniformBuffer/07_InitUniformBuffer.cpp index e035c52..7aa58be 100644 --- a/samples/07_InitUniformBuffer/07_InitUniformBuffer.cpp +++ b/samples/07_InitUniformBuffer/07_InitUniformBuffer.cpp @@ -94,6 +94,7 @@ int main(int argc, char *argv[]) catch (std::runtime_error err) { std::cout << "std::runtime_error: " << err.what() << std::endl; + exit(-1); } catch (...) { diff --git a/samples/08_InitPipelineLayout/08_InitPipelineLayout.cpp b/samples/08_InitPipelineLayout/08_InitPipelineLayout.cpp index db6b902..a0a8f6d 100644 --- a/samples/08_InitPipelineLayout/08_InitPipelineLayout.cpp +++ b/samples/08_InitPipelineLayout/08_InitPipelineLayout.cpp @@ -66,6 +66,7 @@ int main(int argc, char *argv[]) catch (std::runtime_error err) { std::cout << "std::runtime_error: " << err.what() << std::endl; + exit(-1); } catch (...) { diff --git a/samples/09_InitDescriptorSet/09_InitDescriptorSet.cpp b/samples/09_InitDescriptorSet/09_InitDescriptorSet.cpp new file mode 100644 index 0000000..110e73d --- /dev/null +++ b/samples/09_InitDescriptorSet/09_InitDescriptorSet.cpp @@ -0,0 +1,92 @@ +// Copyright(c) 2018, NVIDIA CORPORATION. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// VulkanHpp Samples : 09_InitDescriptorSet +// Initialize a descriptor set + +#include +#include "vulkan/vulkan.hpp" + +#define GLM_FORCE_RADIANS +#include + +static char const* AppName = "09_InitDescriptorSet"; +static char const* EngineName = "Vulkan.hpp"; + +int main(int argc, char *argv[]) +{ + try + { + vk::ApplicationInfo appInfo(AppName, 1, EngineName, 1, VK_API_VERSION_1_1); + vk::InstanceCreateInfo instanceCreateInfo({}, &appInfo); + vk::UniqueInstance instance = vk::createInstanceUnique(instanceCreateInfo); + + std::vector physicalDevices = instance->enumeratePhysicalDevices(); + assert(!physicalDevices.empty()); + + // determine a queueFamilyIndex that supports graphics + std::vector queueFamilyProperties = physicalDevices[0].getQueueFamilyProperties(); + size_t graphicsQueueFamilyIndex = std::distance(queueFamilyProperties.begin(), + std::find_if(queueFamilyProperties.begin(), + queueFamilyProperties.end(), + [](vk::QueueFamilyProperties const& qfp) { return qfp.queueFlags & vk::QueueFlagBits::eGraphics; })); + + // create a device + float queuePriority = 0.0f; + vk::DeviceQueueCreateInfo deviceQueueCreateInfo({}, static_cast(graphicsQueueFamilyIndex), 1, &queuePriority); + vk::UniqueDevice device = physicalDevices[0].createDeviceUnique(vk::DeviceCreateInfo({}, 1, &deviceQueueCreateInfo, 0, nullptr)); + + glm::mat4x4 projection = glm::perspective(glm::radians(45.0f), 1.0f, 0.1f, 100.0f); + glm::mat4x4 view = glm::lookAt(glm::vec3(-5.0f, 3.0f, -10.0f), glm::vec3(0.0f, 0.0f, 0.0f), glm::vec3(0.0f, -1.0f, 0.0f)); + glm::mat4x4 model = glm::mat4x4(1.0f); + glm::mat4x4 clip = glm::mat4x4(1.0f, 0.0f, 0.0f, 0.0f, 0.0f, -1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.5f, 0.0f, 0.0f, 0.0f, 0.5f, 1.0f); // vulkan clip space has inverted y and half z ! + glm::mat4x4 mvpc = clip * projection * view * model; + + vk::UniqueBuffer buffer = device->createBufferUnique(vk::BufferCreateInfo(vk::BufferCreateFlags(), sizeof(mvpc), vk::BufferUsageFlagBits::eUniformBuffer)); + + // create a DescriptorSetLayout + vk::DescriptorSetLayoutBinding descriptorSetLayoutBinding(0, vk::DescriptorType::eUniformBuffer, 1, vk::ShaderStageFlagBits::eVertex); + vk::UniqueDescriptorSetLayout descriptorSetLayout = device->createDescriptorSetLayoutUnique(vk::DescriptorSetLayoutCreateInfo({}, 1, &descriptorSetLayoutBinding)); + + /* VULKAN_HPP_KEY_START */ + + // create a descriptor pool + vk::DescriptorPoolSize poolSize(vk::DescriptorType::eUniformBuffer, 1); + vk::UniqueDescriptorPool descriptorPool = device->createDescriptorPoolUnique(vk::DescriptorPoolCreateInfo(vk::DescriptorPoolCreateFlags(), 1, 1, &poolSize)); + + // allocate a descriptor set + std::vector descriptorSets = device->allocateDescriptorSetsUnique(vk::DescriptorSetAllocateInfo(descriptorPool.get(), 1, &descriptorSetLayout.get())); + + vk::DescriptorBufferInfo descriptorBufferInfo(buffer.get(), 0, sizeof(glm::mat4x4)); + device->updateDescriptorSets(vk::WriteDescriptorSet(descriptorSets[0].get(), 0, 0, 1, vk::DescriptorType::eUniformBuffer, nullptr, &descriptorBufferInfo), {}); + + /* VULKAN_HPP_KEY_END */ + } + catch (vk::SystemError err) + { + std::cout << "vk::SystemError: " << err.what() << std::endl; + exit(-1); + } + catch (std::runtime_error err) + { + std::cout << "std::runtime_error: " << err.what() << std::endl; + exit(-1); + } + catch (...) + { + std::cout << "unknown error\n"; + exit(-1); + } + return 0; +} diff --git a/samples/09_InitDescriptorSet/CMakeLists.txt b/samples/09_InitDescriptorSet/CMakeLists.txt new file mode 100644 index 0000000..8aa9778 --- /dev/null +++ b/samples/09_InitDescriptorSet/CMakeLists.txt @@ -0,0 +1,35 @@ +# Copyright(c) 2018, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +cmake_minimum_required(VERSION 3.2) + +project(09_InitDescriptorSet) + +set(HEADERS +) + +set(SOURCES + 09_InitDescriptorSet.cpp +) + +source_group(headers FILES ${HEADERS}) +source_group(sources FILES ${SOURCES}) + +add_executable(09_InitDescriptorSet + ${HEADERS} + ${SOURCES} +) + +set_target_properties(09_InitDescriptorSet PROPERTIES FOLDER "Samples") +target_link_libraries(09_InitDescriptorSet "$ENV{VK_SDK_PATH}/Lib/vulkan-1.lib") diff --git a/samples/10_InitRenderPass/10_InitRenderPass.cpp b/samples/10_InitRenderPass/10_InitRenderPass.cpp new file mode 100644 index 0000000..93799e6 --- /dev/null +++ b/samples/10_InitRenderPass/10_InitRenderPass.cpp @@ -0,0 +1,252 @@ +// Copyright(c) 2018, NVIDIA CORPORATION. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// VulkanHpp Samples : 10_InitRenderPass +// Initialize a render pass + +#include +#include "vulkan/vulkan.hpp" + +#define GLM_FORCE_RADIANS +#include + +static char const* AppName = "10_InitRenderPass"; +static char const* EngineName = "Vulkan.hpp"; + +static std::vector getInstanceExtensions() +{ + std::vector extensions; + + extensions.push_back(VK_KHR_SURFACE_EXTENSION_NAME); +#if defined(VK_USE_PLATFORM_ANDROID_KHR) + extensions.push_back(VK_KHR_ANDROID_SURFACE_EXTENSION_NAME); +#elif defined(VK_USE_PLATFORM_IOS_MVK) + extensions.push_back(VK_MVK_IOS_SURFACE_EXTENSION_NAME); +#elif defined(VK_USE_PLATFORM_MACOS_MVK) + extensions.push_back(VK_MVK_MACOS_SURFACE_EXTENSION_NAME); +#elif defined(VK_USE_PLATFORM_MIR_KHR) + extensions.push_back(VK_KHR_MIR_SURFACE_EXTENSION_NAME); +#elif defined(VK_USE_PLATFORM_VI_NN) + extensions.push_back(VK_NN_VI_SURFACE_EXTENSION_NAME); +#elif defined(VK_USE_PLATFORM_WAYLAND_KHR) + extensions.push_back(VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME); +#elif defined(VK_USE_PLATFORM_WIN32_KHR) + extensions.push_back(VK_KHR_WIN32_SURFACE_EXTENSION_NAME); +#elif defined(VK_USE_PLATFORM_XCB_KHR) + extensions.push_back(VK_KHR_XCB_SURFACE_EXTENSION_NAME); +#elif defined(VK_USE_PLATFORM_XLIB_KHR) + extensions.push_back(VK_KHR_XLIB_SURFACE_EXTENSION_NAME); +#elif defined(VK_USE_PLATFORM_XLIB_XRANDR_EXT) + extensions.push_back(VK_EXT_ACQUIRE_XLIB_DISPLAY_EXTENSION_NAME); +#endif + + return extensions; +} + +#if defined(VK_USE_PLATFORM_WIN32_KHR) +LRESULT CALLBACK WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) +{ + switch (uMsg) + { + case WM_CLOSE: + PostQuitMessage(0); + break; + default: + break; + } + return (DefWindowProc(hWnd, uMsg, wParam, lParam)); +} + +HWND initializeWindow(std::string const& className, std::string const& windowName, LONG width, LONG height) +{ + WNDCLASSEX windowClass; + memset(&windowClass, 0, sizeof(WNDCLASSEX)); + + HINSTANCE instance = GetModuleHandle(nullptr); + windowClass.cbSize = sizeof(WNDCLASSEX); + windowClass.style = CS_HREDRAW | CS_VREDRAW; + windowClass.lpfnWndProc = WindowProc; + windowClass.hInstance = instance; + windowClass.hIcon = LoadIcon(NULL, IDI_APPLICATION); + windowClass.hCursor = LoadCursor(NULL, IDC_ARROW); + windowClass.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH); + windowClass.lpszClassName = className.c_str(); + windowClass.hIconSm = LoadIcon(NULL, IDI_WINLOGO); + + if (!RegisterClassEx(&windowClass)) + { + throw std::runtime_error("Failed to register WNDCLASSEX -> terminating"); + } + + RECT windowRect = { 0, 0, width, height }; + AdjustWindowRect(&windowRect, WS_OVERLAPPEDWINDOW, FALSE); + + HWND window = CreateWindowEx(0, className.c_str(), windowName.c_str(), WS_OVERLAPPEDWINDOW | WS_VISIBLE | WS_SYSMENU, 100, 100, windowRect.right - windowRect.left, + windowRect.bottom - windowRect.top, nullptr, nullptr, instance, nullptr); + if (!window) + { + throw std::runtime_error("Failed to create window -> terminating"); + } + + return window; +} +#else +#pragma error "unhandled platform" +#endif + +int main(int argc, char *argv[]) +{ + try + { + vk::ApplicationInfo appInfo(AppName, 1, EngineName, 1, VK_API_VERSION_1_1); + std::vector instanceExtensions = getInstanceExtensions(); + vk::InstanceCreateInfo instanceCreateInfo({}, &appInfo, 0, nullptr, static_cast(instanceExtensions.size()), instanceExtensions.data()); + vk::UniqueInstance instance = vk::createInstanceUnique(instanceCreateInfo); + + std::vector physicalDevices = instance->enumeratePhysicalDevices(); + assert(!physicalDevices.empty()); + + uint32_t width = 50; + uint32_t height = 50; +#if defined(VK_USE_PLATFORM_WIN32_KHR) + HWND window = initializeWindow(AppName, "Sample", width, height); + vk::UniqueSurfaceKHR surface = instance->createWin32SurfaceKHRUnique(vk::Win32SurfaceCreateInfoKHR({}, GetModuleHandle(nullptr), window)); +#else +#pragma error "unhandled platform" +#endif + + // determine a queueFamilyIndex that supports graphics + std::vector queueFamilyProperties = physicalDevices[0].getQueueFamilyProperties(); + size_t graphicsQueueFamilyIndex = std::distance(queueFamilyProperties.begin(), + std::find_if(queueFamilyProperties.begin(), + queueFamilyProperties.end(), + [](vk::QueueFamilyProperties const& qfp) { return qfp.queueFlags & vk::QueueFlagBits::eGraphics; })); + + // determine a queueFamilyIndex that suports present + // first check if the graphicsQueueFamiliyIndex is good enough + size_t presentQueueFamilyIndex = physicalDevices[0].getSurfaceSupportKHR(static_cast(graphicsQueueFamilyIndex), surface.get()) ? graphicsQueueFamilyIndex : queueFamilyProperties.size(); + if (presentQueueFamilyIndex == queueFamilyProperties.size()) + { + // the graphicsQueueFamilyIndex doesn't support present -> look for an other family index that supports both graphics and present + for (size_t i = 0; i < queueFamilyProperties.size(); i++) + { + if ((queueFamilyProperties[i].queueFlags & vk::QueueFlagBits::eGraphics) && physicalDevices[0].getSurfaceSupportKHR(static_cast(i), surface.get())) + { + graphicsQueueFamilyIndex = i; + presentQueueFamilyIndex = i; + break; + } + } + if (presentQueueFamilyIndex == queueFamilyProperties.size()) + { + // there's nothing like a single family index that supports both graphics and present -> look for an other family index that supports present + for (size_t i = 0; i < queueFamilyProperties.size(); i++) + { + if (physicalDevices[0].getSurfaceSupportKHR(static_cast(i), surface.get())) + { + presentQueueFamilyIndex = i; + break; + } + } + } + } + if ((graphicsQueueFamilyIndex == queueFamilyProperties.size()) || (presentQueueFamilyIndex == queueFamilyProperties.size())) + { + throw std::runtime_error("Could not find a queue for graphics or present -> terminating"); + } + + // create a device + float queuePriority = 0.0f; + vk::DeviceQueueCreateInfo deviceQueueCreateInfo({}, static_cast(graphicsQueueFamilyIndex), 1, &queuePriority); + vk::UniqueDevice device = physicalDevices[0].createDeviceUnique(vk::DeviceCreateInfo({}, 1, &deviceQueueCreateInfo, 0, nullptr)); + + // get the supported VkFormats + vk::SurfaceCapabilitiesKHR surfaceCapabilities = physicalDevices[0].getSurfaceCapabilitiesKHR(surface.get()); + std::vector formats = physicalDevices[0].getSurfaceFormatsKHR(surface.get()); + assert(!formats.empty()); + vk::Format format = (formats[0].format == vk::Format::eUndefined) ? vk::Format::eB8G8R8A8Unorm : formats[0].format; + + VkExtent2D swapchainExtent; + if (surfaceCapabilities.currentExtent.width == std::numeric_limits::max()) + { + // If the surface size is undefined, the size is set to the size of the images requested. + swapchainExtent.width = glm::clamp(width, surfaceCapabilities.minImageExtent.width, surfaceCapabilities.maxImageExtent.width); + swapchainExtent.height = glm::clamp(height, surfaceCapabilities.minImageExtent.height, surfaceCapabilities.maxImageExtent.height); + } + else + { + // If the surface size is defined, the swap chain size must match + swapchainExtent = surfaceCapabilities.currentExtent; + } + + 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; + + vk::SwapchainCreateInfoKHR swapChainCreateInfo({}, surface.get(), surfaceCapabilities.minImageCount, format, vk::ColorSpaceKHR::eSrgbNonlinear, swapchainExtent, 1, + vk::ImageUsageFlagBits::eColorAttachment | vk::ImageUsageFlagBits::eTransferSrc, vk::SharingMode::eExclusive, 0, nullptr, preTransform, compositeAlpha, vk::PresentModeKHR::eFifo, true, + nullptr); + + uint32_t queueFamilyIndices[2] = { static_cast(graphicsQueueFamilyIndex), static_cast(presentQueueFamilyIndex) }; + if (graphicsQueueFamilyIndex != presentQueueFamilyIndex) + { + // If the graphics and present queues are from different queue families, we either have to explicitly transfer ownership of images between + // the queues, or we have to create the swapchain with imageSharingMode as VK_SHARING_MODE_CONCURRENT + swapChainCreateInfo.imageSharingMode = vk::SharingMode::eConcurrent; + swapChainCreateInfo.queueFamilyIndexCount = 2; + swapChainCreateInfo.pQueueFamilyIndices = queueFamilyIndices; + } + vk::UniqueSwapchainKHR swapChain = device->createSwapchainKHRUnique(swapChainCreateInfo); + + const vk::Format depthFormat = vk::Format::eD16Unorm; + + /* VULKAN_HPP_KEY_START */ + + vk::AttachmentDescription attachments[2]; + attachments[0] = vk::AttachmentDescription(vk::AttachmentDescriptionFlags(), format, vk::SampleCountFlagBits::e1, vk::AttachmentLoadOp::eClear, vk::AttachmentStoreOp::eStore, + vk::AttachmentLoadOp::eDontCare, vk::AttachmentStoreOp::eDontCare, vk::ImageLayout::eUndefined, vk::ImageLayout::ePresentSrcKHR); + attachments[1] = vk::AttachmentDescription(vk::AttachmentDescriptionFlags(), depthFormat, vk::SampleCountFlagBits::e1, vk::AttachmentLoadOp::eClear, vk::AttachmentStoreOp::eDontCare, + vk::AttachmentLoadOp::eDontCare, vk::AttachmentStoreOp::eDontCare, vk::ImageLayout::eUndefined, vk::ImageLayout::eDepthStencilAttachmentOptimal); + + vk::AttachmentReference colorReference(0, vk::ImageLayout::eColorAttachmentOptimal); + vk::AttachmentReference depthReference(1, vk::ImageLayout::eDepthStencilAttachmentOptimal); + vk::SubpassDescription subpass(vk::SubpassDescriptionFlags(), vk::PipelineBindPoint::eGraphics, 0, nullptr, 1, &colorReference, nullptr, &depthReference); + + vk::UniqueRenderPass renderPass = device->createRenderPassUnique(vk::RenderPassCreateInfo(vk::RenderPassCreateFlags(), 2, attachments, 1, &subpass)); + + // Note: No need to explicitly destroy the RenderPass or the Semaphore, as the corresponding destroy + // functions are called by the destructor of the UniqueRenderPass and the UniqueSemaphore on leaving this scope. + + /* VULKAN_HPP_KEY_END */ + } + catch (vk::SystemError err) + { + std::cout << "vk::SystemError: " << err.what() << std::endl; + exit(-1); + } + catch (std::runtime_error err) + { + std::cout << "std::runtime_error: " << err.what() << std::endl; + exit(-1); + } + catch (...) + { + std::cout << "unknown error\n"; + exit(-1); + } + return 0; +} diff --git a/samples/10_InitRenderPass/CMakeLists.txt b/samples/10_InitRenderPass/CMakeLists.txt new file mode 100644 index 0000000..79026de --- /dev/null +++ b/samples/10_InitRenderPass/CMakeLists.txt @@ -0,0 +1,35 @@ +# Copyright(c) 2018, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +cmake_minimum_required(VERSION 3.2) + +project(10_InitRenderPass) + +set(HEADERS +) + +set(SOURCES + 10_InitRenderPass.cpp +) + +source_group(headers FILES ${HEADERS}) +source_group(sources FILES ${SOURCES}) + +add_executable(10_InitRenderPass + ${HEADERS} + ${SOURCES} +) + +set_target_properties(10_InitRenderPass PROPERTIES FOLDER "Samples") +target_link_libraries(10_InitRenderPass "$ENV{VK_SDK_PATH}/Lib/vulkan-1.lib")