diff options
| author | 2021-11-21 07:29:58 -0500 | |
|---|---|---|
| committer | 2021-12-05 15:35:35 -0500 | |
| commit | 75c4aec8ab5d926ac557170d3be025079ead1037 (patch) | |
| tree | 9a5d10ba3be0f1909b7c2525e08687c18736d596 /src | |
| parent | Merge pull request #7518 from german77/is_npad_valid (diff) | |
| download | yuzu-75c4aec8ab5d926ac557170d3be025079ead1037.tar.gz yuzu-75c4aec8ab5d926ac557170d3be025079ead1037.tar.xz yuzu-75c4aec8ab5d926ac557170d3be025079ead1037.zip | |
Revert "Merge pull request #7395 from Morph1984/resolve-comments"
This reverts commit d20f91da11fe7c5d5f1bd4f63cc3b4d221be67a4, reversing
changes made to 5082712b4e44ebfe48bd587ea2fa38767b7339cb.
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 | ||||
| -rw-r--r-- | src/video_core/renderer_vulkan/vk_texture_cache.cpp | 6 |
3 files changed, 31 insertions, 16 deletions
diff --git a/src/video_core/renderer_vulkan/blit_image.cpp b/src/video_core/renderer_vulkan/blit_image.cpp index 9a38b6b34..2e69e270f 100644 --- a/src/video_core/renderer_vulkan/blit_image.cpp +++ b/src/video_core/renderer_vulkan/blit_image.cpp | |||
| @@ -751,9 +751,8 @@ void BlitImageHelper::ConvertColorToDepthPipeline(vk::Pipeline& pipeline, VkRend | |||
| 751 | }); | 751 | }); |
| 752 | } | 752 | } |
| 753 | 753 | ||
| 754 | void BlitImageHelper::ConvertPipelineEx(vk::Pipeline& pipeline, VkRenderPass renderpass, | 754 | void BlitImageHelper::ConvertPipelineColorTargetEx(vk::Pipeline& pipeline, VkRenderPass renderpass, |
| 755 | vk::ShaderModule& module, bool is_target_depth, | 755 | vk::ShaderModule& module, bool single_texture) { |
| 756 | bool single_texture) { | ||
| 757 | if (pipeline) { | 756 | if (pipeline) { |
| 758 | return; | 757 | return; |
| 759 | } | 758 | } |
| @@ -770,7 +769,7 @@ void BlitImageHelper::ConvertPipelineEx(vk::Pipeline& pipeline, VkRenderPass ren | |||
| 770 | .pViewportState = &PIPELINE_VIEWPORT_STATE_CREATE_INFO, | 769 | .pViewportState = &PIPELINE_VIEWPORT_STATE_CREATE_INFO, |
| 771 | .pRasterizationState = &PIPELINE_RASTERIZATION_STATE_CREATE_INFO, | 770 | .pRasterizationState = &PIPELINE_RASTERIZATION_STATE_CREATE_INFO, |
| 772 | .pMultisampleState = &PIPELINE_MULTISAMPLE_STATE_CREATE_INFO, | 771 | .pMultisampleState = &PIPELINE_MULTISAMPLE_STATE_CREATE_INFO, |
| 773 | .pDepthStencilState = is_target_depth ? &PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO : nullptr, | 772 | .pDepthStencilState = nullptr, |
| 774 | .pColorBlendState = &PIPELINE_COLOR_BLEND_STATE_GENERIC_CREATE_INFO, | 773 | .pColorBlendState = &PIPELINE_COLOR_BLEND_STATE_GENERIC_CREATE_INFO, |
| 775 | .pDynamicState = &PIPELINE_DYNAMIC_STATE_CREATE_INFO, | 774 | .pDynamicState = &PIPELINE_DYNAMIC_STATE_CREATE_INFO, |
| 776 | .layout = single_texture ? *one_texture_pipeline_layout : *two_textures_pipeline_layout, | 775 | .layout = single_texture ? *one_texture_pipeline_layout : *two_textures_pipeline_layout, |
| @@ -781,14 +780,33 @@ void BlitImageHelper::ConvertPipelineEx(vk::Pipeline& pipeline, VkRenderPass ren | |||
| 781 | }); | 780 | }); |
| 782 | } | 781 | } |
| 783 | 782 | ||
| 784 | void BlitImageHelper::ConvertPipelineColorTargetEx(vk::Pipeline& pipeline, VkRenderPass renderpass, | ||
| 785 | vk::ShaderModule& module, bool single_texture) { | ||
| 786 | ConvertPipelineEx(pipeline, renderpass, module, false, single_texture); | ||
| 787 | } | ||
| 788 | |||
| 789 | void BlitImageHelper::ConvertPipelineDepthTargetEx(vk::Pipeline& pipeline, VkRenderPass renderpass, | 783 | void BlitImageHelper::ConvertPipelineDepthTargetEx(vk::Pipeline& pipeline, VkRenderPass renderpass, |
| 790 | vk::ShaderModule& module, bool single_texture) { | 784 | vk::ShaderModule& module, bool single_texture) { |
| 791 | ConvertPipelineEx(pipeline, renderpass, module, true, single_texture); | 785 | if (pipeline) { |
| 786 | return; | ||
| 787 | } | ||
| 788 | const std::array stages = MakeStages(*full_screen_vert, *module); | ||
| 789 | pipeline = device.GetLogical().CreateGraphicsPipeline({ | ||
| 790 | .sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO, | ||
| 791 | .pNext = nullptr, | ||
| 792 | .flags = 0, | ||
| 793 | .stageCount = static_cast<u32>(stages.size()), | ||
| 794 | .pStages = stages.data(), | ||
| 795 | .pVertexInputState = &PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO, | ||
| 796 | .pInputAssemblyState = &PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO, | ||
| 797 | .pTessellationState = nullptr, | ||
| 798 | .pViewportState = &PIPELINE_VIEWPORT_STATE_CREATE_INFO, | ||
| 799 | .pRasterizationState = &PIPELINE_RASTERIZATION_STATE_CREATE_INFO, | ||
| 800 | .pMultisampleState = &PIPELINE_MULTISAMPLE_STATE_CREATE_INFO, | ||
| 801 | .pDepthStencilState = &PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO, | ||
| 802 | .pColorBlendState = &PIPELINE_COLOR_BLEND_STATE_EMPTY_CREATE_INFO, | ||
| 803 | .pDynamicState = &PIPELINE_DYNAMIC_STATE_CREATE_INFO, | ||
| 804 | .layout = single_texture ? *one_texture_pipeline_layout : *two_textures_pipeline_layout, | ||
| 805 | .renderPass = renderpass, | ||
| 806 | .subpass = 0, | ||
| 807 | .basePipelineHandle = VK_NULL_HANDLE, | ||
| 808 | .basePipelineIndex = 0, | ||
| 809 | }); | ||
| 792 | } | 810 | } |
| 793 | 811 | ||
| 794 | } // namespace Vulkan | 812 | } // namespace Vulkan |
diff --git a/src/video_core/renderer_vulkan/blit_image.h b/src/video_core/renderer_vulkan/blit_image.h index b1a717090..0b73cf444 100644 --- a/src/video_core/renderer_vulkan/blit_image.h +++ b/src/video_core/renderer_vulkan/blit_image.h | |||
| @@ -80,9 +80,6 @@ private: | |||
| 80 | 80 | ||
| 81 | void ConvertColorToDepthPipeline(vk::Pipeline& pipeline, VkRenderPass renderpass); | 81 | void ConvertColorToDepthPipeline(vk::Pipeline& pipeline, VkRenderPass renderpass); |
| 82 | 82 | ||
| 83 | void ConvertPipelineEx(vk::Pipeline& pipeline, VkRenderPass renderpass, | ||
| 84 | vk::ShaderModule& module, bool is_target_depth, bool single_texture); | ||
| 85 | |||
| 86 | void ConvertPipelineColorTargetEx(vk::Pipeline& pipeline, VkRenderPass renderpass, | 83 | void ConvertPipelineColorTargetEx(vk::Pipeline& pipeline, VkRenderPass renderpass, |
| 87 | vk::ShaderModule& module, bool single_texture); | 84 | vk::ShaderModule& module, bool single_texture); |
| 88 | 85 | ||
diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.cpp b/src/video_core/renderer_vulkan/vk_texture_cache.cpp index 197cba8e3..51246d46f 100644 --- a/src/video_core/renderer_vulkan/vk_texture_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_texture_cache.cpp | |||
| @@ -797,9 +797,9 @@ VkBuffer TextureCacheRuntime::GetTemporaryBuffer(size_t needed_size) { | |||
| 797 | return *buffers[level]; | 797 | return *buffers[level]; |
| 798 | } | 798 | } |
| 799 | const auto new_size = Common::NextPow2(needed_size); | 799 | const auto new_size = Common::NextPow2(needed_size); |
| 800 | static constexpr VkBufferUsageFlags flags = | 800 | VkBufferUsageFlags flags = VK_BUFFER_USAGE_TRANSFER_SRC_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT | |
| 801 | VK_BUFFER_USAGE_TRANSFER_SRC_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT | | 801 | VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT | |
| 802 | VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT | VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT; | 802 | VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT; |
| 803 | buffers[level] = device.GetLogical().CreateBuffer({ | 803 | buffers[level] = device.GetLogical().CreateBuffer({ |
| 804 | .sType = VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO, | 804 | .sType = VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO, |
| 805 | .pNext = nullptr, | 805 | .pNext = nullptr, |