diff options
| author | 2021-03-26 18:55:07 -0300 | |
|---|---|---|
| committer | 2021-07-22 21:51:24 -0400 | |
| commit | ec005be99d4f231f6d4d812841c84ab4af4204a6 (patch) | |
| tree | 2e5737fd0155138615ab9e6596d7bcf59b822b36 | |
| parent | shader: Implement TXQ and fix FragDepth (diff) | |
| download | yuzu-ec005be99d4f231f6d4d812841c84ab4af4204a6.tar.gz yuzu-ec005be99d4f231f6d4d812841c84ab4af4204a6.tar.xz yuzu-ec005be99d4f231f6d4d812841c84ab4af4204a6.zip | |
shader: Fix rasterizer integration order issues
| -rw-r--r-- | src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp | 7 | ||||
| -rw-r--r-- | src/video_core/renderer_vulkan/vk_rasterizer.cpp | 1 | ||||
| -rw-r--r-- | src/video_core/renderer_vulkan/vk_render_pass_cache.cpp | 5 |
3 files changed, 6 insertions, 7 deletions
diff --git a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp index a87ed1976..82536b9d6 100644 --- a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp +++ b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp | |||
| @@ -139,7 +139,6 @@ void GraphicsPipeline::Configure(bool is_indexed) { | |||
| 139 | static_vector<VkSampler, max_images_elements> samplers; | 139 | static_vector<VkSampler, max_images_elements> samplers; |
| 140 | 140 | ||
| 141 | texture_cache->SynchronizeGraphicsDescriptors(); | 141 | texture_cache->SynchronizeGraphicsDescriptors(); |
| 142 | texture_cache->UpdateRenderTargets(false); | ||
| 143 | 142 | ||
| 144 | const auto& regs{maxwell3d->regs}; | 143 | const auto& regs{maxwell3d->regs}; |
| 145 | const bool via_header_index{regs.sampler_index == Maxwell::SamplerIndex::ViaHeaderIndex}; | 144 | const bool via_header_index{regs.sampler_index == Maxwell::SamplerIndex::ViaHeaderIndex}; |
| @@ -181,13 +180,17 @@ void GraphicsPipeline::Configure(bool is_indexed) { | |||
| 181 | PushImageDescriptors(stage_infos[stage], samplers.data(), image_view_ids.data(), | 180 | PushImageDescriptors(stage_infos[stage], samplers.data(), image_view_ids.data(), |
| 182 | *texture_cache, *update_descriptor_queue, index); | 181 | *texture_cache, *update_descriptor_queue, index); |
| 183 | } | 182 | } |
| 183 | texture_cache->UpdateRenderTargets(false); | ||
| 184 | scheduler->RequestRenderpass(texture_cache->GetFramebuffer()); | ||
| 185 | |||
| 186 | scheduler->BindGraphicsPipeline(*pipeline); | ||
| 187 | |||
| 184 | if (!descriptor_set_layout) { | 188 | if (!descriptor_set_layout) { |
| 185 | return; | 189 | return; |
| 186 | } | 190 | } |
| 187 | const VkDescriptorSet descriptor_set{descriptor_allocator.Commit()}; | 191 | const VkDescriptorSet descriptor_set{descriptor_allocator.Commit()}; |
| 188 | update_descriptor_queue->Send(*descriptor_update_template, descriptor_set); | 192 | update_descriptor_queue->Send(*descriptor_update_template, descriptor_set); |
| 189 | 193 | ||
| 190 | scheduler->BindGraphicsPipeline(*pipeline); | ||
| 191 | scheduler->Record([descriptor_set, layout = *pipeline_layout](vk::CommandBuffer cmdbuf) { | 194 | scheduler->Record([descriptor_set, layout = *pipeline_layout](vk::CommandBuffer cmdbuf) { |
| 192 | cmdbuf.BindDescriptorSets(VK_PIPELINE_BIND_POINT_GRAPHICS, layout, 0, descriptor_set, | 195 | cmdbuf.BindDescriptorSets(VK_PIPELINE_BIND_POINT_GRAPHICS, layout, 0, descriptor_set, |
| 193 | nullptr); | 196 | nullptr); |
diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.cpp b/src/video_core/renderer_vulkan/vk_rasterizer.cpp index 8f63a7591..d7d9927dd 100644 --- a/src/video_core/renderer_vulkan/vk_rasterizer.cpp +++ b/src/video_core/renderer_vulkan/vk_rasterizer.cpp | |||
| @@ -178,7 +178,6 @@ void RasterizerVulkan::Draw(bool is_indexed, bool is_instanced) { | |||
| 178 | 178 | ||
| 179 | BeginTransformFeedback(); | 179 | BeginTransformFeedback(); |
| 180 | 180 | ||
| 181 | scheduler.RequestRenderpass(texture_cache.GetFramebuffer()); | ||
| 182 | UpdateDynamicStates(); | 181 | UpdateDynamicStates(); |
| 183 | 182 | ||
| 184 | const auto& regs{maxwell3d.regs}; | 183 | const auto& regs{maxwell3d.regs}; |
diff --git a/src/video_core/renderer_vulkan/vk_render_pass_cache.cpp b/src/video_core/renderer_vulkan/vk_render_pass_cache.cpp index 1c6ba7289..b2dcd74ab 100644 --- a/src/video_core/renderer_vulkan/vk_render_pass_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_render_pass_cache.cpp | |||
| @@ -56,15 +56,12 @@ VkRenderPass RenderPassCache::Get(const RenderPassKey& key) { | |||
| 56 | return *pair->second; | 56 | return *pair->second; |
| 57 | } | 57 | } |
| 58 | boost::container::static_vector<VkAttachmentDescription, 9> descriptions; | 58 | boost::container::static_vector<VkAttachmentDescription, 9> descriptions; |
| 59 | u32 num_images{0}; | ||
| 60 | |||
| 61 | for (size_t index = 0; index < key.color_formats.size(); ++index) { | 59 | for (size_t index = 0; index < key.color_formats.size(); ++index) { |
| 62 | const PixelFormat format{key.color_formats[index]}; | 60 | const PixelFormat format{key.color_formats[index]}; |
| 63 | if (format == PixelFormat::Invalid) { | 61 | if (format == PixelFormat::Invalid) { |
| 64 | continue; | 62 | continue; |
| 65 | } | 63 | } |
| 66 | descriptions.push_back(AttachmentDescription(*device, format, key.samples)); | 64 | descriptions.push_back(AttachmentDescription(*device, format, key.samples)); |
| 67 | ++num_images; | ||
| 68 | } | 65 | } |
| 69 | const size_t num_colors{descriptions.size()}; | 66 | const size_t num_colors{descriptions.size()}; |
| 70 | const VkAttachmentReference* depth_attachment{}; | 67 | const VkAttachmentReference* depth_attachment{}; |
| @@ -89,7 +86,7 @@ VkRenderPass RenderPassCache::Get(const RenderPassKey& key) { | |||
| 89 | .pNext = nullptr, | 86 | .pNext = nullptr, |
| 90 | .flags = 0, | 87 | .flags = 0, |
| 91 | .attachmentCount = static_cast<u32>(descriptions.size()), | 88 | .attachmentCount = static_cast<u32>(descriptions.size()), |
| 92 | .pAttachments = descriptions.data(), | 89 | .pAttachments = descriptions.empty() ? nullptr : descriptions.data(), |
| 93 | .subpassCount = 1, | 90 | .subpassCount = 1, |
| 94 | .pSubpasses = &subpass, | 91 | .pSubpasses = &subpass, |
| 95 | .dependencyCount = 0, | 92 | .dependencyCount = 0, |