From e0ae112b760e1424d2a855f91f4e17132ae6861d Mon Sep 17 00:00:00 2001 From: Benjamin Kraft Date: Fri, 11 Oct 2024 16:54:41 +0200 Subject: [PATCH] raise vulkan to 1.1 --- src/vulkan/instance.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/vulkan/instance.cpp b/src/vulkan/instance.cpp index e0c93f6..2a40807 100644 --- a/src/vulkan/instance.cpp +++ b/src/vulkan/instance.cpp @@ -7,7 +7,8 @@ #include const std::vector deviceExtensions = { - VK_KHR_SWAPCHAIN_EXTENSION_NAME + VK_KHR_SWAPCHAIN_EXTENSION_NAME, + VK_EXT_SHADER_ATOMIC_FLOAT_EXTENSION_NAME }; #ifndef NDEBUG @@ -86,7 +87,7 @@ void Instance::createInstance() { applicationInfo.applicationVersion = VK_MAKE_VERSION(1, 0, 0); applicationInfo.pEngineName = "No Engine"; applicationInfo.engineVersion = VK_MAKE_VERSION(1, 0, 0); - applicationInfo.apiVersion = VK_API_VERSION_1_0; + applicationInfo.apiVersion = VK_API_VERSION_1_1; uint32_t glfwExtensionCount = 0; const char** glfwExtensions = glfwGetRequiredInstanceExtensions(&glfwExtensionCount); @@ -152,11 +153,16 @@ void Instance::createLogicalDevice() { VkPhysicalDeviceFeatures deviceFeatures {}; deviceFeatures.fillModeNonSolid = true; + VkPhysicalDeviceShaderAtomicFloatFeaturesEXT atomicFeatures {}; + atomicFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_FEATURES_EXT; + atomicFeatures.shaderBufferFloat32Atomics = VK_TRUE; + VkDeviceCreateInfo createInfo {}; createInfo.sType = VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO; createInfo.pQueueCreateInfos = queueCreateInfos.data(); createInfo.queueCreateInfoCount = queueCreateInfos.size(); createInfo.pEnabledFeatures = &deviceFeatures; + createInfo.pNext = &atomicFeatures; createInfo.enabledExtensionCount = deviceExtensions.size(); createInfo.ppEnabledExtensionNames = deviceExtensions.data(); #ifdef ENABLE_VALIDATION_LAYERS