From e8055f81df7677d8f3635cdc597658fe768c7c53 Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Mon, 23 Sep 2019 15:19:46 +0200 Subject: [PATCH] [dxvk] Validate primitive topology in pipeline state --- src/dxvk/dxvk_graphics.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/dxvk/dxvk_graphics.cpp b/src/dxvk/dxvk_graphics.cpp index d91d3b79..5e05b425 100644 --- a/src/dxvk/dxvk_graphics.cpp +++ b/src/dxvk/dxvk_graphics.cpp @@ -490,7 +490,12 @@ namespace dxvk { // If there are no tessellation shaders, we // obviously cannot use tessellation patches. - if ((state.iaPatchVertexCount != 0) && (m_shaders.tcs == nullptr || m_shaders.tes == nullptr)) + if ((state.iaPrimitiveTopology == VK_PRIMITIVE_TOPOLOGY_PATCH_LIST) + && (m_shaders.tcs == nullptr || m_shaders.tes == nullptr)) + return false; + + // Filter out undefined primitive topologies + if (state.iaPrimitiveTopology == VK_PRIMITIVE_TOPOLOGY_MAX_ENUM) return false; // Prevent unintended out-of-bounds access to the IL arrays