1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-01-31 14:52:11 +01:00

[dxgi] Avoid reporting large VRAM amounts as a power of two

This commit is contained in:
Philip Rebohle 2024-08-23 01:12:12 +02:00
parent d89e324bc4
commit 6da1ba7cff

View File

@ -358,6 +358,16 @@ namespace dxvk {
deviceMemory = 512ull << 20;
}
// Make sure to never return exact powers of two outside the 32-bit range
// because some games don't understand the concept of actually having VRAM
constexpr VkDeviceSize adjustment = 32ull << 20;
if (deviceMemory && !(deviceMemory & 0xffffffffull))
deviceMemory -= adjustment;
if (sharedMemory && !(sharedMemory & 0xffffffffull))
sharedMemory -= adjustment;
// Some games are silly and need their memory limited
if (options->maxDeviceMemory > 0
&& options->maxDeviceMemory < deviceMemory)