1
0
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:
Philip Rebohle 2021-10-01 14:18:42 +02:00
parent 7193962381
commit aa4b7c9f92
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
3 changed files with 18 additions and 11 deletions

View File

@ -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;

View File

@ -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

View File

@ -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
*