diff options
| author | 2021-09-28 16:39:42 -0400 | |
|---|---|---|
| committer | 2021-09-28 16:39:42 -0400 | |
| commit | 6f35fb8d26311d976184ebfae4480d85bba4b131 (patch) | |
| tree | 6485eb9cb531b7d7cec22e4b47e28d00fc69c64d /src | |
| parent | Merge pull request #7076 from ameerj/amd-botw (diff) | |
| download | yuzu-6f35fb8d26311d976184ebfae4480d85bba4b131.tar.gz yuzu-6f35fb8d26311d976184ebfae4480d85bba4b131.tar.xz yuzu-6f35fb8d26311d976184ebfae4480d85bba4b131.zip | |
vk_graphics_pipeline: Force patch list topology when tessellation is used
Fixes a crash on some drivers when tessellation is used but the IA topology is not patch list.
Diffstat (limited to '')
| -rw-r--r-- | src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp index 11cd41ad7..8634c3316 100644 --- a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp +++ b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp | |||
| @@ -568,12 +568,21 @@ void GraphicsPipeline::MakePipeline(VkRenderPass render_pass) { | |||
| 568 | if (!vertex_binding_divisors.empty()) { | 568 | if (!vertex_binding_divisors.empty()) { |
| 569 | vertex_input_ci.pNext = &input_divisor_ci; | 569 | vertex_input_ci.pNext = &input_divisor_ci; |
| 570 | } | 570 | } |
| 571 | const bool has_tess_stages = spv_modules[1] || spv_modules[2]; | ||
| 571 | auto input_assembly_topology = MaxwellToVK::PrimitiveTopology(device, key.state.topology); | 572 | auto input_assembly_topology = MaxwellToVK::PrimitiveTopology(device, key.state.topology); |
| 572 | if (input_assembly_topology == VK_PRIMITIVE_TOPOLOGY_PATCH_LIST) { | 573 | if (input_assembly_topology == VK_PRIMITIVE_TOPOLOGY_PATCH_LIST) { |
| 573 | if (!spv_modules[1] && !spv_modules[2]) { | 574 | if (!has_tess_stages) { |
| 574 | LOG_WARNING(Render_Vulkan, "Patch topology used without tessellation, using points"); | 575 | LOG_WARNING(Render_Vulkan, "Patch topology used without tessellation, using points"); |
| 575 | input_assembly_topology = VK_PRIMITIVE_TOPOLOGY_POINT_LIST; | 576 | input_assembly_topology = VK_PRIMITIVE_TOPOLOGY_POINT_LIST; |
| 576 | } | 577 | } |
| 578 | } else { | ||
| 579 | if (has_tess_stages) { | ||
| 580 | // The Vulkan spec requires patch list IA topology be used with tessellation | ||
| 581 | // shader stages. Forcing it fixes a crash on some drivers | ||
| 582 | LOG_WARNING(Render_Vulkan, | ||
| 583 | "Patch topology not used with tessellation, using patch list"); | ||
| 584 | input_assembly_topology = VK_PRIMITIVE_TOPOLOGY_PATCH_LIST; | ||
| 585 | } | ||
| 577 | } | 586 | } |
| 578 | const VkPipelineInputAssemblyStateCreateInfo input_assembly_ci{ | 587 | const VkPipelineInputAssemblyStateCreateInfo input_assembly_ci{ |
| 579 | .sType = VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO, | 588 | .sType = VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO, |