summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_vulkan/vk_pipeline_cache.h
diff options
context:
space:
mode:
authorReinUsesLisp <reinuseslisp@airmail.cc>2021-04-01 06:36:22 +0200
committerameerj <52414509+ameerj@users.noreply.github.com>2021-07-23 03:51:25 +0200
commit2fc698b040e7e25223ba6ebe31abb04b1fc65f06 (patch)
treedad5321dd5fd829a6493dd3f26b7c18bc6ec08ca /src/video_core/renderer_vulkan/vk_pipeline_cache.h
parentshader: Fix dependency on identity removal pass (diff)
downloadyuzu-2fc698b040e7e25223ba6ebe31abb04b1fc65f06.tar
yuzu-2fc698b040e7e25223ba6ebe31abb04b1fc65f06.tar.gz
yuzu-2fc698b040e7e25223ba6ebe31abb04b1fc65f06.tar.bz2
yuzu-2fc698b040e7e25223ba6ebe31abb04b1fc65f06.tar.lz
yuzu-2fc698b040e7e25223ba6ebe31abb04b1fc65f06.tar.xz
yuzu-2fc698b040e7e25223ba6ebe31abb04b1fc65f06.tar.zst
yuzu-2fc698b040e7e25223ba6ebe31abb04b1fc65f06.zip
Diffstat (limited to 'src/video_core/renderer_vulkan/vk_pipeline_cache.h')
-rw-r--r--src/video_core/renderer_vulkan/vk_pipeline_cache.h24
1 files changed, 15 insertions, 9 deletions
diff --git a/src/video_core/renderer_vulkan/vk_pipeline_cache.h b/src/video_core/renderer_vulkan/vk_pipeline_cache.h
index b55e14189..609f00898 100644
--- a/src/video_core/renderer_vulkan/vk_pipeline_cache.h
+++ b/src/video_core/renderer_vulkan/vk_pipeline_cache.h
@@ -14,6 +14,7 @@
#include <vector>
#include "common/common_types.h"
+#include "common/thread_worker.h"
#include "shader_recompiler/frontend/ir/basic_block.h"
#include "shader_recompiler/frontend/ir/microinstruction.h"
#include "shader_recompiler/frontend/maxwell/control_flow.h"
@@ -145,16 +146,19 @@ private:
const ShaderInfo* MakeShaderInfo(GenericEnvironment& env, VAddr cpu_addr);
- GraphicsPipeline CreateGraphicsPipeline();
+ std::unique_ptr<GraphicsPipeline> CreateGraphicsPipeline();
- GraphicsPipeline CreateGraphicsPipeline(ShaderPools& pools, const GraphicsPipelineCacheKey& key,
- std::span<Shader::Environment* const> envs);
+ std::unique_ptr<GraphicsPipeline> CreateGraphicsPipeline(
+ ShaderPools& pools, const GraphicsPipelineCacheKey& key,
+ std::span<Shader::Environment* const> envs, bool build_in_parallel);
- ComputePipeline CreateComputePipeline(const ComputePipelineCacheKey& key,
- const ShaderInfo* shader);
+ std::unique_ptr<ComputePipeline> CreateComputePipeline(const ComputePipelineCacheKey& key,
+ const ShaderInfo* shader);
- ComputePipeline CreateComputePipeline(ShaderPools& pools, const ComputePipelineCacheKey& key,
- Shader::Environment& env) const;
+ std::unique_ptr<ComputePipeline> CreateComputePipeline(ShaderPools& pools,
+ const ComputePipelineCacheKey& key,
+ Shader::Environment& env,
+ bool build_in_parallel);
Shader::Profile MakeProfile(const GraphicsPipelineCacheKey& key, Shader::Stage stage);
@@ -174,13 +178,15 @@ private:
GraphicsPipelineCacheKey graphics_key{};
std::array<const ShaderInfo*, 6> shader_infos{};
- std::unordered_map<ComputePipelineCacheKey, ComputePipeline> compute_cache;
- std::unordered_map<GraphicsPipelineCacheKey, GraphicsPipeline> graphics_cache;
+ std::unordered_map<ComputePipelineCacheKey, std::unique_ptr<ComputePipeline>> compute_cache;
+ std::unordered_map<GraphicsPipelineCacheKey, std::unique_ptr<GraphicsPipeline>> graphics_cache;
ShaderPools main_pools;
Shader::Profile base_profile;
std::string pipeline_cache_filename;
+
+ Common::ThreadWorker workers;
};
} // namespace Vulkan