1
0
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:
Philip Rebohle 2018-11-15 09:24:11 +01:00
parent 4db5c21ec5
commit 6adf534589
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
5 changed files with 15 additions and 2 deletions

View File

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

View File

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

View File

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

View File

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

View File

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