|
|
|
@ -7,7 +7,8 @@ |
|
|
|
|
#include <cstring> |
|
|
|
|
|
|
|
|
|
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 |
|
|
|
@ -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 |
|
|
|
|