Skip to content

Commit

Permalink
[d3d9] Fix invalid strings returned by GetInstanceExtensions
Browse files Browse the repository at this point in the history
  • Loading branch information
AlpyneDreams committed Jan 13, 2025
1 parent bf71ae8 commit d636fa3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/dxvk/dxvk_instance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,18 +115,18 @@ namespace dxvk {

void DxvkInstance::createInstanceLoader(const DxvkInstanceImportInfo& args, DxvkInstanceFlags flags) {
DxvkNameList layerList;
DxvkNameSet extensionSet;
m_extensionSet = DxvkNameSet();

bool enablePerfEvents = false;
bool enableValidation = false;

if (args.instance) {
m_extensionNames = DxvkNameList(args.extensionCount, args.extensionNames);
extensionSet = getExtensionSet(m_extensionNames);
m_extensionSet = getExtensionSet(m_extensionNames);

auto extensionInfos = getExtensionList(m_extensions, true);

if (!extensionSet.enableExtensions(extensionInfos.size(), extensionInfos.data(), nullptr))
if (!m_extensionSet.enableExtensions(extensionInfos.size(), extensionInfos.data(), nullptr))
throw DxvkError("DxvkInstance: Required instance extensions not enabled");
} else {
// Hide VK_EXT_debug_utils behind an environment variable.
Expand Down Expand Up @@ -160,14 +160,14 @@ namespace dxvk {
auto extensionInfos = getExtensionList(m_extensions, enableDebug);
DxvkNameSet extensionsAvailable = DxvkNameSet::enumInstanceExtensions(m_vkl);

if (!extensionsAvailable.enableExtensions(extensionInfos.size(), extensionInfos.data(), &extensionSet))
if (!extensionsAvailable.enableExtensions(extensionInfos.size(), extensionInfos.data(), &m_extensionSet))
throw DxvkError("DxvkInstance: Required instance extensions not supported");

for (const auto& provider : m_extProviders)
extensionSet.merge(provider->getInstanceExtensions());
m_extensionSet.merge(provider->getInstanceExtensions());

// Generate list of extensions to enable
m_extensionNames = extensionSet.toNameList();
m_extensionNames = m_extensionSet.toNameList();
}

Logger::info("Enabled instance extensions:");
Expand Down
1 change: 1 addition & 0 deletions src/dxvk/dxvk_instance.h
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ namespace dxvk {
Rc<vk::LibraryFn> m_vkl;
Rc<vk::InstanceFn> m_vki;
DxvkInstanceExtensions m_extensions;
DxvkNameSet m_extensionSet;
DxvkNameList m_extensionNames;

VkDebugUtilsMessengerEXT m_messenger = VK_NULL_HANDLE;
Expand Down

0 comments on commit d636fa3

Please sign in to comment.