mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-03-02 04:29:14 +01:00
[dxvk] Rework 32-bit check
This commit is contained in:
parent
7193962381
commit
aa4b7c9f92
@ -302,13 +302,13 @@ namespace dxvk {
|
||||
&& options->maxSharedMemory < sharedMemory)
|
||||
sharedMemory = options->maxSharedMemory;
|
||||
|
||||
#ifndef _WIN64
|
||||
// The value returned by DXGI is a 32-bit value
|
||||
// on 32-bit platforms, so we need to clamp it
|
||||
VkDeviceSize maxMemory = 0xC0000000;
|
||||
deviceMemory = std::min(deviceMemory, maxMemory);
|
||||
sharedMemory = std::min(sharedMemory, maxMemory);
|
||||
#endif
|
||||
if (env::is32BitHostPlatform()) {
|
||||
// The value returned by DXGI is a 32-bit value
|
||||
// on 32-bit platforms, so we need to clamp it
|
||||
VkDeviceSize maxMemory = 0xC0000000;
|
||||
deviceMemory = std::min(deviceMemory, maxMemory);
|
||||
sharedMemory = std::min(sharedMemory, maxMemory);
|
||||
}
|
||||
|
||||
pDesc->VendorId = deviceProp.vendorID;
|
||||
pDesc->DeviceId = deviceProp.deviceID;
|
||||
|
@ -432,10 +432,10 @@ namespace dxvk {
|
||||
|
||||
// Try to waste a bit less system memory in 32-bit
|
||||
// applications due to address space constraints
|
||||
#ifndef _WIN64
|
||||
if (type.propertyFlags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT)
|
||||
chunkSize = 32 << 20;
|
||||
#endif
|
||||
if (env::is32BitHostPlatform()) {
|
||||
if (type.propertyFlags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT)
|
||||
chunkSize = 32 << 20;
|
||||
}
|
||||
|
||||
// Reduce the chunk size on small heaps so
|
||||
// we can at least fit in 15 allocations
|
||||
|
@ -4,6 +4,13 @@
|
||||
|
||||
namespace dxvk::env {
|
||||
|
||||
/**
|
||||
* \brief Checks whether the host platform is 32-bit
|
||||
*/
|
||||
constexpr bool is32BitHostPlatform() {
|
||||
return sizeof(void*) == 4;
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Gets environment variable
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user