raise vulkan to 1.1

feature/softbody-runtime-control
Benjamin Kraft 3 months ago
parent a47c167edf
commit e0ae112b76
  1. 10
      src/vulkan/instance.cpp

@ -7,7 +7,8 @@
#include <cstring> #include <cstring>
const std::vector<const char*> deviceExtensions = { const std::vector<const char*> deviceExtensions = {
VK_KHR_SWAPCHAIN_EXTENSION_NAME VK_KHR_SWAPCHAIN_EXTENSION_NAME,
VK_EXT_SHADER_ATOMIC_FLOAT_EXTENSION_NAME
}; };
#ifndef NDEBUG #ifndef NDEBUG
@ -86,7 +87,7 @@ void Instance::createInstance() {
applicationInfo.applicationVersion = VK_MAKE_VERSION(1, 0, 0); applicationInfo.applicationVersion = VK_MAKE_VERSION(1, 0, 0);
applicationInfo.pEngineName = "No Engine"; applicationInfo.pEngineName = "No Engine";
applicationInfo.engineVersion = VK_MAKE_VERSION(1, 0, 0); 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; uint32_t glfwExtensionCount = 0;
const char** glfwExtensions = glfwGetRequiredInstanceExtensions(&glfwExtensionCount); const char** glfwExtensions = glfwGetRequiredInstanceExtensions(&glfwExtensionCount);
@ -152,11 +153,16 @@ void Instance::createLogicalDevice() {
VkPhysicalDeviceFeatures deviceFeatures {}; VkPhysicalDeviceFeatures deviceFeatures {};
deviceFeatures.fillModeNonSolid = true; deviceFeatures.fillModeNonSolid = true;
VkPhysicalDeviceShaderAtomicFloatFeaturesEXT atomicFeatures {};
atomicFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_FEATURES_EXT;
atomicFeatures.shaderBufferFloat32Atomics = VK_TRUE;
VkDeviceCreateInfo createInfo {}; VkDeviceCreateInfo createInfo {};
createInfo.sType = VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO; createInfo.sType = VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO;
createInfo.pQueueCreateInfos = queueCreateInfos.data(); createInfo.pQueueCreateInfos = queueCreateInfos.data();
createInfo.queueCreateInfoCount = queueCreateInfos.size(); createInfo.queueCreateInfoCount = queueCreateInfos.size();
createInfo.pEnabledFeatures = &deviceFeatures; createInfo.pEnabledFeatures = &deviceFeatures;
createInfo.pNext = &atomicFeatures;
createInfo.enabledExtensionCount = deviceExtensions.size(); createInfo.enabledExtensionCount = deviceExtensions.size();
createInfo.ppEnabledExtensionNames = deviceExtensions.data(); createInfo.ppEnabledExtensionNames = deviceExtensions.data();
#ifdef ENABLE_VALIDATION_LAYERS #ifdef ENABLE_VALIDATION_LAYERS

Loading…
Cancel
Save