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