diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2021-04-24 23:28:02 +0200 |
---|---|---|
committer | ameerj <52414509+ameerj@users.noreply.github.com> | 2021-07-23 03:51:29 +0200 |
commit | 5ed871398b0e89cb3f2e3eb740d431f5faaa12e4 (patch) | |
tree | c5c4272be277e04586d11b62775dd95e61101c63 /src/video_core/renderer_vulkan/vk_graphics_pipeline.h | |
parent | shader: Accelerate pipeline transitions and use dirty flags for shaders (diff) | |
download | yuzu-5ed871398b0e89cb3f2e3eb740d431f5faaa12e4.tar yuzu-5ed871398b0e89cb3f2e3eb740d431f5faaa12e4.tar.gz yuzu-5ed871398b0e89cb3f2e3eb740d431f5faaa12e4.tar.bz2 yuzu-5ed871398b0e89cb3f2e3eb740d431f5faaa12e4.tar.lz yuzu-5ed871398b0e89cb3f2e3eb740d431f5faaa12e4.tar.xz yuzu-5ed871398b0e89cb3f2e3eb740d431f5faaa12e4.tar.zst yuzu-5ed871398b0e89cb3f2e3eb740d431f5faaa12e4.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/renderer_vulkan/vk_graphics_pipeline.h | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/src/video_core/renderer_vulkan/vk_graphics_pipeline.h b/src/video_core/renderer_vulkan/vk_graphics_pipeline.h index fd787840b..edab5703f 100644 --- a/src/video_core/renderer_vulkan/vk_graphics_pipeline.h +++ b/src/video_core/renderer_vulkan/vk_graphics_pipeline.h @@ -75,8 +75,6 @@ public: std::array<vk::ShaderModule, NUM_STAGES> stages, const std::array<const Shader::Info*, NUM_STAGES>& infos); - void Configure(bool is_indexed); - GraphicsPipeline& operator=(GraphicsPipeline&&) noexcept = delete; GraphicsPipeline(GraphicsPipeline&&) noexcept = delete; @@ -85,6 +83,10 @@ public: void AddTransition(GraphicsPipeline* transition); + void Configure(bool is_indexed) { + configure_func(this, is_indexed); + } + GraphicsPipeline* Next(const GraphicsPipelineCacheKey& current_key) noexcept { if (key == current_key) { return this; @@ -94,9 +96,23 @@ public: : nullptr; } + template <typename Spec> + static auto MakeConfigureSpecFunc() { + return [](GraphicsPipeline* pipeline, bool is_indexed) { + pipeline->ConfigureImpl<Spec>(is_indexed); + }; + } + private: + template <typename Spec> + void ConfigureImpl(bool is_indexed); + + void ConfigureDraw(); + void MakePipeline(const Device& device, VkRenderPass render_pass); + void Validate(); + const GraphicsPipelineCacheKey key; Tegra::Engines::Maxwell3D& maxwell3d; Tegra::MemoryManager& gpu_memory; @@ -105,6 +121,8 @@ private: VKScheduler& scheduler; VKUpdateDescriptorQueue& update_descriptor_queue; + void (*configure_func)(GraphicsPipeline*, bool); + std::vector<GraphicsPipelineCacheKey> transition_keys; std::vector<GraphicsPipeline*> transitions; |