mirror of
https://github.com/EduApps-CDG/OpenDX
synced 2024-12-30 09:45:37 +01:00
[dxvk] Add option to set number of pipeline compiler threads
This commit is contained in:
parent
4db5c21ec5
commit
6adf534589
@ -3,7 +3,8 @@
|
|||||||
namespace dxvk {
|
namespace dxvk {
|
||||||
|
|
||||||
DxvkOptions::DxvkOptions(const Config& config) {
|
DxvkOptions::DxvkOptions(const Config& config) {
|
||||||
allowMemoryOvercommit = config.getOption<bool>("dxvk.allowMemoryOvercommit", false);
|
allowMemoryOvercommit = config.getOption<bool> ("dxvk.allowMemoryOvercommit", false);
|
||||||
|
numCompilerThreads = config.getOption<int32_t> ("dxvk.numCompilerThreads", 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -10,6 +10,10 @@ namespace dxvk {
|
|||||||
/// Allow allocating more memory from
|
/// Allow allocating more memory from
|
||||||
/// a heap than the device supports.
|
/// a heap than the device supports.
|
||||||
bool allowMemoryOvercommit;
|
bool allowMemoryOvercommit;
|
||||||
|
|
||||||
|
/// Number of compiler threads
|
||||||
|
/// when using the state cache
|
||||||
|
int32_t numCompilerThreads;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
@ -47,7 +47,7 @@ namespace dxvk {
|
|||||||
std::string useStateCache = env::getEnvVar(L"DXVK_STATE_CACHE");
|
std::string useStateCache = env::getEnvVar(L"DXVK_STATE_CACHE");
|
||||||
|
|
||||||
if (useStateCache != "0")
|
if (useStateCache != "0")
|
||||||
m_stateCache = new DxvkStateCache(this, passManager);
|
m_stateCache = new DxvkStateCache(device, this, passManager);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
#include "dxvk_device.h"
|
||||||
#include "dxvk_pipemanager.h"
|
#include "dxvk_pipemanager.h"
|
||||||
#include "dxvk_state_cache.h"
|
#include "dxvk_state_cache.h"
|
||||||
|
|
||||||
@ -29,6 +30,7 @@ namespace dxvk {
|
|||||||
|
|
||||||
|
|
||||||
DxvkStateCache::DxvkStateCache(
|
DxvkStateCache::DxvkStateCache(
|
||||||
|
const DxvkDevice* device,
|
||||||
DxvkPipelineManager* pipeManager,
|
DxvkPipelineManager* pipeManager,
|
||||||
DxvkRenderPassPool* passManager)
|
DxvkRenderPassPool* passManager)
|
||||||
: m_pipeManager(pipeManager),
|
: m_pipeManager(pipeManager),
|
||||||
@ -65,6 +67,9 @@ namespace dxvk {
|
|||||||
|
|
||||||
if (numWorkers < 1) numWorkers = 1;
|
if (numWorkers < 1) numWorkers = 1;
|
||||||
if (numWorkers > 16) numWorkers = 16;
|
if (numWorkers > 16) numWorkers = 16;
|
||||||
|
|
||||||
|
if (device->config().numCompilerThreads > 0)
|
||||||
|
numWorkers = device->config().numCompilerThreads;
|
||||||
|
|
||||||
Logger::info(str::format("DXVK: Using ", numWorkers, " compiler threads"));
|
Logger::info(str::format("DXVK: Using ", numWorkers, " compiler threads"));
|
||||||
|
|
||||||
|
@ -13,6 +13,8 @@
|
|||||||
|
|
||||||
namespace dxvk {
|
namespace dxvk {
|
||||||
|
|
||||||
|
class DxvkDevice;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief State cache entry key
|
* \brief State cache entry key
|
||||||
*
|
*
|
||||||
@ -81,6 +83,7 @@ namespace dxvk {
|
|||||||
public:
|
public:
|
||||||
|
|
||||||
DxvkStateCache(
|
DxvkStateCache(
|
||||||
|
const DxvkDevice* device,
|
||||||
DxvkPipelineManager* pipeManager,
|
DxvkPipelineManager* pipeManager,
|
||||||
DxvkRenderPassPool* passManager);
|
DxvkRenderPassPool* passManager);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user