From 5c2144b55d996b913268158a8cf9c527d03b5234 Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Wed, 21 Mar 2018 15:22:18 +0100 Subject: [PATCH] [dxvk] Move tess state validation to validatePipelineState --- src/dxvk/dxvk_graphics.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/dxvk/dxvk_graphics.cpp b/src/dxvk/dxvk_graphics.cpp index 92c714d7..782d0017 100644 --- a/src/dxvk/dxvk_graphics.cpp +++ b/src/dxvk/dxvk_graphics.cpp @@ -248,11 +248,6 @@ namespace dxvk { if (tsInfo.patchControlPoints == 0) info.pTessellationState = nullptr; - if ((tsInfo.patchControlPoints != 0) && (m_tcs == nullptr || m_tes == nullptr)) { - Logger::err("DxvkGraphicsPipeline: Cannot use tessellation patches without tessellation shaders"); - return VK_NULL_HANDLE; - } - VkPipeline pipeline = VK_NULL_HANDLE; if (m_vkd->vkCreateGraphicsPipelines(m_vkd->device(), m_cache->handle(), 1, &info, nullptr, &pipeline) != VK_SUCCESS) { @@ -289,6 +284,13 @@ namespace dxvk { return false; } + // If there are no tessellation shaders, we + // obviously cannot use tessellation patches. + if ((state.iaPatchVertexCount != 0) && (m_tcs == nullptr || m_tes == nullptr)) { + Logger::err("DxvkGraphicsPipeline: Cannot use tessellation patches without tessellation shaders"); + return false; + } + // No errors return true; }