summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar bunnei2021-10-04 15:37:32 -0700
committerGravatar GitHub2021-10-04 15:37:32 -0700
commit158a69311195c1cb5c39bae3fddeaeaed3634078 (patch)
tree6d5ccd5b79d4016342e1b191cbc773b00f85c915
parentMerge pull request #7107 from astrelsky/iob_fix (diff)
parentvk_graphics_pipeline: Force patch list topology when tessellation is used (diff)
downloadyuzu-158a69311195c1cb5c39bae3fddeaeaed3634078.tar.gz
yuzu-158a69311195c1cb5c39bae3fddeaeaed3634078.tar.xz
yuzu-158a69311195c1cb5c39bae3fddeaeaed3634078.zip
Merge pull request #7101 from ameerj/vk-tess-topology
vk_graphics_pipeline: Force patch list topology when tessellation is used
Diffstat (limited to '')
-rw-r--r--src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp11
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,