Skip to content

Commit

Permalink
[dxvk] Fix AMD overallocInfo going out of scope in getDeviceCreateInfo
Browse files Browse the repository at this point in the history
  • Loading branch information
AlpyneDreams committed Jan 26, 2025
1 parent 596439e commit 41684c4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/dxvk/dxvk_adapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -447,8 +447,8 @@ namespace dxvk {
initFeatureChain(enabledFeatures, devExtensions, instance->extensions());

// Report the desired overallocation behaviour to the driver
VkDeviceMemoryOverallocationCreateInfoAMD overallocInfo = { VK_STRUCTURE_TYPE_DEVICE_MEMORY_OVERALLOCATION_CREATE_INFO_AMD };
overallocInfo.overallocationBehavior = VK_MEMORY_OVERALLOCATION_BEHAVIOR_ALLOWED_AMD;
enabledFeatures.amdOverallocation = { VK_STRUCTURE_TYPE_DEVICE_MEMORY_OVERALLOCATION_CREATE_INFO_AMD };
enabledFeatures.amdOverallocation.overallocationBehavior = VK_MEMORY_OVERALLOCATION_BEHAVIOR_ALLOWED_AMD;

// Create the requested queues
static const float queuePriority = 1.0f;
Expand Down Expand Up @@ -479,7 +479,7 @@ namespace dxvk {
info.pEnabledFeatures = &enabledFeatures.core.features;

if (devExtensions.amdMemoryOverallocationBehaviour)
overallocInfo.pNext = std::exchange(info.pNext, &overallocInfo);
enabledFeatures.amdOverallocation.pNext = std::exchange(info.pNext, &enabledFeatures.amdOverallocation);

return true;
}
Expand Down
1 change: 1 addition & 0 deletions src/dxvk/dxvk_device_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ namespace dxvk {
VkBool32 nvxBinaryImport;
VkBool32 nvxImageViewHandle;
VkBool32 khrWin32KeyedMutex;
VkDeviceMemoryOverallocationCreateInfoAMD amdOverallocation;
};

}

0 comments on commit 41684c4

Please sign in to comment.