mirror of
https://github.com/EduApps-CDG/OpenDX
synced 2024-12-30 09:45:37 +01:00
[dxvk] Make use of the asynchronous pipeline compiler optional
Users can enable this by setting DXVK_USE_PIPECOMPILER=1.
This commit is contained in:
parent
2ee80ce1bd
commit
f42f7cc743
@ -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_CUSTOM_DEVICE_ID=<ID>` Specifies a custom PCI device ID
|
||||||
- `DXVK_LOG_LEVEL=none|error|warn|info|debug` Controls message logging
|
- `DXVK_LOG_LEVEL=none|error|warn|info|debug` Controls message logging
|
||||||
- `DXVK_FAKE_DX10_SUPPORT=1` Advertizes support for D3D10 interfaces
|
- `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
|
## Troubleshooting
|
||||||
DXVK requires threading support from your mingw-w64 build environment. If you
|
DXVK requires threading support from your mingw-w64 build environment. If you
|
||||||
|
@ -120,7 +120,8 @@ namespace dxvk {
|
|||||||
// vector, create a new one and add it to the list.
|
// vector, create a new one and add it to the list.
|
||||||
VkPipeline newPipelineBase = m_basePipelineBase.load();
|
VkPipeline newPipelineBase = m_basePipelineBase.load();
|
||||||
VkPipeline newPipelineHandle = this->compilePipeline(state, renderPassHandle,
|
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 =
|
Rc<DxvkGraphicsPipelineInstance> newPipeline =
|
||||||
new DxvkGraphicsPipelineInstance(m_device->vkd(), state,
|
new DxvkGraphicsPipelineInstance(m_device->vkd(), state,
|
||||||
@ -147,7 +148,9 @@ namespace dxvk {
|
|||||||
m_basePipelineBase.compare_exchange_strong(newPipelineBase, newPipelineHandle);
|
m_basePipelineBase.compare_exchange_strong(newPipelineBase, newPipelineHandle);
|
||||||
|
|
||||||
// Compile optimized pipeline asynchronously
|
// Compile optimized pipeline asynchronously
|
||||||
m_compiler->queueCompilation(this, newPipeline);
|
if (m_compiler != nullptr)
|
||||||
|
m_compiler->queueCompilation(this, newPipeline);
|
||||||
|
|
||||||
return newPipelineHandle;
|
return newPipelineHandle;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -41,8 +41,10 @@ namespace dxvk {
|
|||||||
DxvkPipelineManager::DxvkPipelineManager(const DxvkDevice* device)
|
DxvkPipelineManager::DxvkPipelineManager(const DxvkDevice* device)
|
||||||
: m_device (device),
|
: m_device (device),
|
||||||
m_cache (new DxvkPipelineCache(device->vkd())),
|
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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -97,9 +97,9 @@ namespace dxvk {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
const DxvkDevice* m_device;
|
const DxvkDevice* m_device;
|
||||||
const Rc<DxvkPipelineCache> m_cache;
|
Rc<DxvkPipelineCache> m_cache;
|
||||||
const Rc<DxvkPipelineCompiler> m_compiler;
|
Rc<DxvkPipelineCompiler> m_compiler;
|
||||||
|
|
||||||
std::mutex m_mutex;
|
std::mutex m_mutex;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user