mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-02-20 19:54:19 +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 {
|
||||
|
||||
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
|
||||
/// a heap than the device supports.
|
||||
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");
|
||||
|
||||
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_state_cache.h"
|
||||
|
||||
@ -29,6 +30,7 @@ namespace dxvk {
|
||||
|
||||
|
||||
DxvkStateCache::DxvkStateCache(
|
||||
const DxvkDevice* device,
|
||||
DxvkPipelineManager* pipeManager,
|
||||
DxvkRenderPassPool* passManager)
|
||||
: m_pipeManager(pipeManager),
|
||||
@ -65,6 +67,9 @@ namespace dxvk {
|
||||
|
||||
if (numWorkers < 1) numWorkers = 1;
|
||||
if (numWorkers > 16) numWorkers = 16;
|
||||
|
||||
if (device->config().numCompilerThreads > 0)
|
||||
numWorkers = device->config().numCompilerThreads;
|
||||
|
||||
Logger::info(str::format("DXVK: Using ", numWorkers, " compiler threads"));
|
||||
|
||||
|
@ -13,6 +13,8 @@
|
||||
|
||||
namespace dxvk {
|
||||
|
||||
class DxvkDevice;
|
||||
|
||||
/**
|
||||
* \brief State cache entry key
|
||||
*
|
||||
@ -81,6 +83,7 @@ namespace dxvk {
|
||||
public:
|
||||
|
||||
DxvkStateCache(
|
||||
const DxvkDevice* device,
|
||||
DxvkPipelineManager* pipeManager,
|
||||
DxvkRenderPassPool* passManager);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user