summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/video_core/renderer_vulkan/blit_image.cpp38
-rw-r--r--src/video_core/renderer_vulkan/blit_image.h3
-rw-r--r--src/video_core/renderer_vulkan/vk_texture_cache.cpp6
3 files changed, 16 insertions, 31 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
752void BlitImageHelper::ConvertPipelineColorTargetEx(vk::Pipeline& pipeline, VkRenderPass renderpass, 752void 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
782void BlitImageHelper::ConvertPipelineColorTargetEx(vk::Pipeline& pipeline, VkRenderPass renderpass,
783 vk::ShaderModule& module, bool single_texture) {
784 ConvertPipelineEx(pipeline, renderpass, module, false, single_texture);
785}
786
781void BlitImageHelper::ConvertPipelineDepthTargetEx(vk::Pipeline& pipeline, VkRenderPass renderpass, 787void 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
diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.cpp b/src/video_core/renderer_vulkan/vk_texture_cache.cpp
index 3964424af..c72f0c897 100644
--- a/src/video_core/renderer_vulkan/vk_texture_cache.cpp
+++ b/src/video_core/renderer_vulkan/vk_texture_cache.cpp
@@ -787,9 +787,9 @@ VkBuffer TextureCacheRuntime::GetTemporaryBuffer(size_t needed_size) {
787 return *buffers[level]; 787 return *buffers[level];
788 } 788 }
789 const auto new_size = Common::NextPow2(needed_size); 789 const auto new_size = Common::NextPow2(needed_size);
790 VkBufferUsageFlags flags = VK_BUFFER_USAGE_TRANSFER_SRC_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT | 790 static constexpr VkBufferUsageFlags flags =
791 VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT | 791 VK_BUFFER_USAGE_TRANSFER_SRC_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT |
792 VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT; 792 VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT | VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT;
793 buffers[level] = device.GetLogical().CreateBuffer({ 793 buffers[level] = device.GetLogical().CreateBuffer({
794 .sType = VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO, 794 .sType = VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO,
795 .pNext = nullptr, 795 .pNext = nullptr,