mirror of
https://github.com/yuzu-mirror/yuzu.git
synced 2024-11-08 22:59:59 +00:00
Merge pull request #7101 from ameerj/vk-tess-topology
vk_graphics_pipeline: Force patch list topology when tessellation is used
This commit is contained in:
commit
158a693111
1 changed files with 10 additions and 1 deletions
|
@ -568,12 +568,21 @@ void GraphicsPipeline::MakePipeline(VkRenderPass render_pass) {
|
||||||
if (!vertex_binding_divisors.empty()) {
|
if (!vertex_binding_divisors.empty()) {
|
||||||
vertex_input_ci.pNext = &input_divisor_ci;
|
vertex_input_ci.pNext = &input_divisor_ci;
|
||||||
}
|
}
|
||||||
|
const bool has_tess_stages = spv_modules[1] || spv_modules[2];
|
||||||
auto input_assembly_topology = MaxwellToVK::PrimitiveTopology(device, key.state.topology);
|
auto input_assembly_topology = MaxwellToVK::PrimitiveTopology(device, key.state.topology);
|
||||||
if (input_assembly_topology == VK_PRIMITIVE_TOPOLOGY_PATCH_LIST) {
|
if (input_assembly_topology == VK_PRIMITIVE_TOPOLOGY_PATCH_LIST) {
|
||||||
if (!spv_modules[1] && !spv_modules[2]) {
|
if (!has_tess_stages) {
|
||||||
LOG_WARNING(Render_Vulkan, "Patch topology used without tessellation, using points");
|
LOG_WARNING(Render_Vulkan, "Patch topology used without tessellation, using points");
|
||||||
input_assembly_topology = VK_PRIMITIVE_TOPOLOGY_POINT_LIST;
|
input_assembly_topology = VK_PRIMITIVE_TOPOLOGY_POINT_LIST;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
if (has_tess_stages) {
|
||||||
|
// The Vulkan spec requires patch list IA topology be used with tessellation
|
||||||
|
// shader stages. Forcing it fixes a crash on some drivers
|
||||||
|
LOG_WARNING(Render_Vulkan,
|
||||||
|
"Patch topology not used with tessellation, using patch list");
|
||||||
|
input_assembly_topology = VK_PRIMITIVE_TOPOLOGY_PATCH_LIST;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
const VkPipelineInputAssemblyStateCreateInfo input_assembly_ci{
|
const VkPipelineInputAssemblyStateCreateInfo input_assembly_ci{
|
||||||
.sType = VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO,
|
.sType = VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO,
|
||||||
|
|
Loading…
Reference in a new issue