mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-03-02 22:29:16 +01:00
[dxgi] Avoid reporting large VRAM amounts as a power of two
This commit is contained in:
parent
d89e324bc4
commit
6da1ba7cff
@ -358,6 +358,16 @@ namespace dxvk {
|
|||||||
deviceMemory = 512ull << 20;
|
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
|
// Some games are silly and need their memory limited
|
||||||
if (options->maxDeviceMemory > 0
|
if (options->maxDeviceMemory > 0
|
||||||
&& options->maxDeviceMemory < deviceMemory)
|
&& options->maxDeviceMemory < deviceMemory)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user