[GPU] Async shader compilation for D3D12 and Vulkan
Adds async_shader_compilation cvar (default true) that forces new pipelines to be created async from the main thread, skips draws entirely on D3D12 and on vulkan replaces pixel shader with placeholder until the real one is ready. Causes some visual artifacts on first load but greatly reduces load times and stutter.
This commit is contained in:
@@ -2583,6 +2583,15 @@ bool D3D12CommandProcessor::IssueDraw(xenos::PrimitiveType primitive_type,
|
||||
return false;
|
||||
}
|
||||
|
||||
if (cvars::async_shader_compilation) {
|
||||
if (pipeline_cache_->GetD3D12PipelineByHandle(pipeline_handle) == nullptr) {
|
||||
XELOGI("Skipping draw - pipeline not ready");
|
||||
return true;
|
||||
}
|
||||
// Re-fetch root signature now that pipeline is ready.
|
||||
root_signature = pipeline_cache_->GetRootSignatureByHandle(pipeline_handle);
|
||||
}
|
||||
|
||||
// Update the textures - this may bind pipelines.
|
||||
uint32_t used_texture_mask =
|
||||
vertex_shader->GetUsedTextureMaskAfterTranslation() |
|
||||
|
||||
Reference in New Issue
Block a user