diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/renderer_vulkan/blit_image.cpp | 38 | ||||
| -rw-r--r-- | src/video_core/renderer_vulkan/blit_image.h | 3 |
2 files changed, 13 insertions, 28 deletions
diff --git a/src/video_core/renderer_vulkan/blit_image.cpp b/src/video_core/renderer_vulkan/blit_image.cpp index 28b631f73..a63d4d222 100644 --- a/src/video_core/renderer_vulkan/blit_image.cpp +++ b/src/video_core/renderer_vulkan/blit_image.cpp | |||
| @@ -749,8 +749,9 @@ void BlitImageHelper::ConvertColorToDepthPipeline(vk::Pipeline& pipeline, VkRend | |||
| 749 | }); | 749 | }); |
| 750 | } | 750 | } |
| 751 | 751 | ||
| 752 | void BlitImageHelper::ConvertPipelineColorTargetEx(vk::Pipeline& pipeline, VkRenderPass renderpass, | 752 | void BlitImageHelper::ConvertPipelineEx(vk::Pipeline& pipeline, VkRenderPass renderpass, |
| 753 | vk::ShaderModule& module, bool single_texture) { | 753 | vk::ShaderModule& module, bool is_target_depth, |
| 754 | bool single_texture) { | ||
| 754 | if (pipeline) { | 755 | if (pipeline) { |
| 755 | return; | 756 | return; |
| 756 | } | 757 | } |
| @@ -767,7 +768,7 @@ void BlitImageHelper::ConvertPipelineColorTargetEx(vk::Pipeline& pipeline, VkRen | |||
| 767 | .pViewportState = &PIPELINE_VIEWPORT_STATE_CREATE_INFO, | 768 | .pViewportState = &PIPELINE_VIEWPORT_STATE_CREATE_INFO, |
| 768 | .pRasterizationState = &PIPELINE_RASTERIZATION_STATE_CREATE_INFO, | 769 | .pRasterizationState = &PIPELINE_RASTERIZATION_STATE_CREATE_INFO, |
| 769 | .pMultisampleState = &PIPELINE_MULTISAMPLE_STATE_CREATE_INFO, | 770 | .pMultisampleState = &PIPELINE_MULTISAMPLE_STATE_CREATE_INFO, |
| 770 | .pDepthStencilState = nullptr, | 771 | .pDepthStencilState = is_target_depth ? &PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO : nullptr, |
| 771 | .pColorBlendState = &PIPELINE_COLOR_BLEND_STATE_GENERIC_CREATE_INFO, | 772 | .pColorBlendState = &PIPELINE_COLOR_BLEND_STATE_GENERIC_CREATE_INFO, |
| 772 | .pDynamicState = &PIPELINE_DYNAMIC_STATE_CREATE_INFO, | 773 | .pDynamicState = &PIPELINE_DYNAMIC_STATE_CREATE_INFO, |
| 773 | .layout = single_texture ? *one_texture_pipeline_layout : *two_textures_pipeline_layout, | 774 | .layout = single_texture ? *one_texture_pipeline_layout : *two_textures_pipeline_layout, |
| @@ -778,33 +779,14 @@ void BlitImageHelper::ConvertPipelineColorTargetEx(vk::Pipeline& pipeline, VkRen | |||
| 778 | }); | 779 | }); |
| 779 | } | 780 | } |
| 780 | 781 | ||
| 782 | void BlitImageHelper::ConvertPipelineColorTargetEx(vk::Pipeline& pipeline, VkRenderPass renderpass, | ||
| 783 | vk::ShaderModule& module, bool single_texture) { | ||
| 784 | ConvertPipelineEx(pipeline, renderpass, module, false, single_texture); | ||
| 785 | } | ||
| 786 | |||
| 781 | void BlitImageHelper::ConvertPipelineDepthTargetEx(vk::Pipeline& pipeline, VkRenderPass renderpass, | 787 | void BlitImageHelper::ConvertPipelineDepthTargetEx(vk::Pipeline& pipeline, VkRenderPass renderpass, |
| 782 | vk::ShaderModule& module, bool single_texture) { | 788 | vk::ShaderModule& module, bool single_texture) { |
| 783 | if (pipeline) { | 789 | ConvertPipelineEx(pipeline, renderpass, module, true, single_texture); |
| 784 | return; | ||
| 785 | } | ||
| 786 | const std::array stages = MakeStages(*full_screen_vert, *module); | ||
| 787 | pipeline = device.GetLogical().CreateGraphicsPipeline({ | ||
| 788 | .sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO, | ||
| 789 | .pNext = nullptr, | ||
| 790 | .flags = 0, | ||
| 791 | .stageCount = static_cast<u32>(stages.size()), | ||
| 792 | .pStages = stages.data(), | ||
| 793 | .pVertexInputState = &PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO, | ||
| 794 | .pInputAssemblyState = &PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO, | ||
| 795 | .pTessellationState = nullptr, | ||
| 796 | .pViewportState = &PIPELINE_VIEWPORT_STATE_CREATE_INFO, | ||
| 797 | .pRasterizationState = &PIPELINE_RASTERIZATION_STATE_CREATE_INFO, | ||
| 798 | .pMultisampleState = &PIPELINE_MULTISAMPLE_STATE_CREATE_INFO, | ||
| 799 | .pDepthStencilState = &PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO, | ||
| 800 | .pColorBlendState = &PIPELINE_COLOR_BLEND_STATE_EMPTY_CREATE_INFO, | ||
| 801 | .pDynamicState = &PIPELINE_DYNAMIC_STATE_CREATE_INFO, | ||
| 802 | .layout = single_texture ? *one_texture_pipeline_layout : *two_textures_pipeline_layout, | ||
| 803 | .renderPass = renderpass, | ||
| 804 | .subpass = 0, | ||
| 805 | .basePipelineHandle = VK_NULL_HANDLE, | ||
| 806 | .basePipelineIndex = 0, | ||
| 807 | }); | ||
| 808 | } | 790 | } |
| 809 | 791 | ||
| 810 | } // namespace Vulkan | 792 | } // namespace Vulkan |
diff --git a/src/video_core/renderer_vulkan/blit_image.h b/src/video_core/renderer_vulkan/blit_image.h index cec095341..3455c75f4 100644 --- a/src/video_core/renderer_vulkan/blit_image.h +++ b/src/video_core/renderer_vulkan/blit_image.h | |||
| @@ -89,6 +89,9 @@ private: | |||
| 89 | 89 | ||
| 90 | void ConvertColorToDepthPipeline(vk::Pipeline& pipeline, VkRenderPass renderpass); | 90 | void ConvertColorToDepthPipeline(vk::Pipeline& pipeline, VkRenderPass renderpass); |
| 91 | 91 | ||
| 92 | void ConvertPipelineEx(vk::Pipeline& pipeline, VkRenderPass renderpass, | ||
| 93 | vk::ShaderModule& module, bool is_target_depth, bool single_texture); | ||
| 94 | |||
| 92 | void ConvertPipelineColorTargetEx(vk::Pipeline& pipeline, VkRenderPass renderpass, | 95 | void ConvertPipelineColorTargetEx(vk::Pipeline& pipeline, VkRenderPass renderpass, |
| 93 | vk::ShaderModule& module, bool single_texture); | 96 | vk::ShaderModule& module, bool single_texture); |
| 94 | 97 | ||