[dxvk] Make use of the asynchronous pipeline compiler optional

Users can enable this by setting DXVK_USE_PIPECOMPILER=1.
This commit is contained in:
Philip Rebohle 2018-05-13 16:02:23 +02:00
parent 2ee80ce1bd
commit f42f7cc743
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
4 changed files with 13 additions and 7 deletions

View File

@ -82,6 +82,7 @@ The following environment variables can be used for **debugging** purposes.
- `DXVK_CUSTOM_DEVICE_ID=<ID>` Specifies a custom PCI device ID
- `DXVK_LOG_LEVEL=none|error|warn|info|debug` Controls message logging
- `DXVK_FAKE_DX10_SUPPORT=1` Advertizes support for D3D10 interfaces
- `DXVK_USE_PIPECOMPILER=1` Enable asynchronous pipeline compilation. This currently only has an effect on RADV in mesa-git.
## Troubleshooting
DXVK requires threading support from your mingw-w64 build environment. If you

View File

@ -120,7 +120,8 @@ namespace dxvk {
// vector, create a new one and add it to the list.
VkPipeline newPipelineBase = m_basePipelineBase.load();
VkPipeline newPipelineHandle = this->compilePipeline(state, renderPassHandle,
VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT, newPipelineBase);
m_compiler != nullptr ? VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT : 0,
newPipelineBase);
Rc<DxvkGraphicsPipelineInstance> newPipeline =
new DxvkGraphicsPipelineInstance(m_device->vkd(), state,
@ -147,7 +148,9 @@ namespace dxvk {
m_basePipelineBase.compare_exchange_strong(newPipelineBase, newPipelineHandle);
// Compile optimized pipeline asynchronously
m_compiler->queueCompilation(this, newPipeline);
if (m_compiler != nullptr)
m_compiler->queueCompilation(this, newPipeline);
return newPipelineHandle;
}

View File

@ -41,8 +41,10 @@ namespace dxvk {
DxvkPipelineManager::DxvkPipelineManager(const DxvkDevice* device)
: m_device (device),
m_cache (new DxvkPipelineCache(device->vkd())),
m_compiler(new DxvkPipelineCompiler()) {
m_compiler(nullptr) {
// Async shader compilation is opt-in for now
if (env::getEnvVar(L"DXVK_USE_PIPECOMPILER") == "1")
m_compiler = new DxvkPipelineCompiler();
}

View File

@ -97,9 +97,9 @@ namespace dxvk {
private:
const DxvkDevice* m_device;
const Rc<DxvkPipelineCache> m_cache;
const Rc<DxvkPipelineCompiler> m_compiler;
const DxvkDevice* m_device;
Rc<DxvkPipelineCache> m_cache;
Rc<DxvkPipelineCompiler> m_compiler;
std::mutex m_mutex;