diff --git a/src/dxvk/dxvk_instance.cpp b/src/dxvk/dxvk_instance.cpp index ca6c0a401..8a6c7cb96 100644 --- a/src/dxvk/dxvk_instance.cpp +++ b/src/dxvk/dxvk_instance.cpp @@ -40,10 +40,8 @@ namespace dxvk { VkInstance DxvkInstance::createInstance() { - auto enabledLayers = this->getLayers(); - // Query available extensions and enable the ones that are needed - vk::NameSet availableExtensions = vk::NameSet::enumerateInstanceExtensions(*m_vkl, enabledLayers); + vk::NameSet availableExtensions = vk::NameSet::enumerateInstanceExtensions(*m_vkl); DxvkInstanceExtensions extensionsToEnable; extensionsToEnable.enableExtensions(availableExtensions); @@ -55,8 +53,6 @@ namespace dxvk { vk::NameSet enabledExtensionSet = extensionsToEnable.getEnabledExtensionNames(); vk::NameList enabledExtensionList = enabledExtensionSet.getNameList(); - Logger::info("Enabled instance layers:"); - this->logNameList(enabledLayers); Logger::info("Enabled instance extensions:"); this->logNameList(enabledExtensionList); @@ -74,8 +70,8 @@ namespace dxvk { info.pNext = nullptr; info.flags = 0; info.pApplicationInfo = &appInfo; - info.enabledLayerCount = enabledLayers.count(); - info.ppEnabledLayerNames = enabledLayers.names(); + info.enabledLayerCount = 0; + info.ppEnabledLayerNames = nullptr; info.enabledExtensionCount = enabledExtensionList.count(); info.ppEnabledExtensionNames = enabledExtensionList.names(); @@ -86,27 +82,6 @@ namespace dxvk { } - vk::NameList DxvkInstance::getLayers() { - std::vector layers = { }; - - if (env::getEnvVar(L"DXVK_DEBUG_LAYERS") == "1") - layers.push_back("VK_LAYER_LUNARG_standard_validation"); - - const vk::NameSet layersAvailable - = vk::NameSet::enumerateInstanceLayers(*m_vkl); - - vk::NameList layersEnabled; - for (auto l : layers) { - if (layersAvailable.contains(l)) - layersEnabled.add(l); - else - throw DxvkError(str::format("Requested layer not installed: ", l)); - } - - return layersEnabled; - } - - void DxvkInstance::logNameList(const vk::NameList& names) { for (uint32_t i = 0; i < names.count(); i++) Logger::info(str::format(" ", names.name(i))); diff --git a/src/dxvk/dxvk_instance.h b/src/dxvk/dxvk_instance.h index 0a0842d52..844507a0e 100644 --- a/src/dxvk/dxvk_instance.h +++ b/src/dxvk/dxvk_instance.h @@ -48,8 +48,6 @@ namespace dxvk { VkInstance createInstance(); - vk::NameList getLayers(); - void logNameList(const vk::NameList& names); }; diff --git a/src/dxvk/vulkan/dxvk_vulkan_extensions.cpp b/src/dxvk/vulkan/dxvk_vulkan_extensions.cpp index b4de9eea4..380be82e1 100644 --- a/src/dxvk/vulkan/dxvk_vulkan_extensions.cpp +++ b/src/dxvk/vulkan/dxvk_vulkan_extensions.cpp @@ -18,30 +18,19 @@ namespace dxvk::vk { } - NameSet NameSet::enumerateInstanceLayers(const LibraryFn& vkl) { - uint32_t layerCount = 0; - if (vkl.vkEnumerateInstanceLayerProperties(&layerCount, nullptr) != VK_SUCCESS) - throw DxvkError(str::format("LayerSet::enumerateInstanceLayers: Failed to query instance layers")); - - std::vector layers(layerCount); - if (vkl.vkEnumerateInstanceLayerProperties(&layerCount, layers.data()) != VK_SUCCESS) - throw DxvkError(str::format("LayerSet::enumerateInstanceLayers: Failed to query instance layers")); - - NameSet result; - for (const auto& layer : layers) - result.m_names.insert(layer.layerName); - return result; - } - - NameSet NameSet::enumerateInstanceExtensions( - const LibraryFn& vkl, - const NameList& layers) { - NameSet result; - result.addInstanceLayerExtensions(vkl, nullptr); + const LibraryFn& vkl) { + uint32_t extCount = 0; + if (vkl.vkEnumerateInstanceExtensionProperties(nullptr, &extCount, nullptr) != VK_SUCCESS) + throw DxvkError("ExtensionSet::addInstanceExtensions: Failed to query instance extensions"); - for (size_t i = 0; i < layers.count(); i++) - result.addInstanceLayerExtensions(vkl, layers.name(i)); + std::vector extensions(extCount); + if (vkl.vkEnumerateInstanceExtensionProperties(nullptr, &extCount, extensions.data()) != VK_SUCCESS) + throw DxvkError("ExtensionSet::addInstanceExtensions: Failed to query instance extensions"); + + NameSet result; + for (const auto& ext : extensions) + result.add(ext.extensionName); return result; } @@ -64,22 +53,6 @@ namespace dxvk::vk { } - void NameSet::addInstanceLayerExtensions( - const LibraryFn& vkl, - const char* layer) { - uint32_t extCount = 0; - if (vkl.vkEnumerateInstanceExtensionProperties(layer, &extCount, nullptr) != VK_SUCCESS) - throw DxvkError("ExtensionSet::addInstanceExtensions: Failed to query instance extensions"); - - std::vector extensions(extCount); - if (vkl.vkEnumerateInstanceExtensionProperties(layer, &extCount, extensions.data()) != VK_SUCCESS) - throw DxvkError("ExtensionSet::addInstanceExtensions: Failed to query instance extensions"); - - for (const auto& ext : extensions) - this->add(ext.extensionName); - } - - NameList NameSet::getNameList() const { NameList result; for (const std::string& name : m_names) diff --git a/src/dxvk/vulkan/dxvk_vulkan_extensions.h b/src/dxvk/vulkan/dxvk_vulkan_extensions.h index f4feba325..f8dae1908 100644 --- a/src/dxvk/vulkan/dxvk_vulkan_extensions.h +++ b/src/dxvk/vulkan/dxvk_vulkan_extensions.h @@ -71,25 +71,14 @@ namespace dxvk::vk { */ bool contains(const std::string& name) const; - /** - * \brief Enumerates instance layers - * - * \param [in] vkl Vulkan library functions - * \returns Available instance layers - */ - static NameSet enumerateInstanceLayers( - const LibraryFn& vkl); - /** * \brief Enumerates instance extensions * * \param [in] vkl Vulkan library functions - * \param [in] layers Enabled instance layers * \returns Available instance extensions */ static NameSet enumerateInstanceExtensions( - const LibraryFn& vkl, - const NameList& layers); + const LibraryFn& vkl); /** * \brief Enumerates device extensions @@ -116,10 +105,6 @@ namespace dxvk::vk { std::unordered_set m_names; - void addInstanceLayerExtensions( - const LibraryFn& vkl, - const char* layer); - }; }