From 61ae6893f8fd73d3a12e1111b7bafc77890b66e6 Mon Sep 17 00:00:00 2001 From: baldurk Date: Thu, 2 Jun 2016 16:59:25 +0200 Subject: [PATCH] Fix mesh output when tessellation is active * We don't want to have any other shader stages than vertex shader active really. It's enough to run the vertex shader, fetch output, and stop. Other stages active imposes more requirements (like tessellation has to happen with patch list types not point lists, etc). --- renderdoc/driver/vulkan/vk_debug.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/renderdoc/driver/vulkan/vk_debug.cpp b/renderdoc/driver/vulkan/vk_debug.cpp index 407e76f67..db45296d1 100644 --- a/renderdoc/driver/vulkan/vk_debug.cpp +++ b/renderdoc/driver/vulkan/vk_debug.cpp @@ -5269,6 +5269,26 @@ void VulkanDebugManager::InitPostVSBuffers(uint32_t eventID) ia->topology = VK_PRIMITIVE_TOPOLOGY_POINT_LIST; + // remove all stages but the vertex shader, we just want to run it and write the data, + // we don't want to tessellate/geometry shade, nor rasterize (which we disable below) + uint32_t vertIdx = pipeCreateInfo.stageCount; + + for(uint32_t i = 0; i < pipeCreateInfo.stageCount; i++) + { + if(pipeCreateInfo.pStages[i].stage & VK_SHADER_STAGE_VERTEX_BIT) + { + vertIdx = i; + break; + } + } + + RDCASSERT(vertIdx < pipeCreateInfo.stageCount); + + if(vertIdx != 0) + (VkPipelineShaderStageCreateInfo &)pipeCreateInfo.pStages[0] = pipeCreateInfo.pStages[vertIdx]; + + pipeCreateInfo.stageCount = 1; + // enable rasterizer discard VkPipelineRasterizationStateCreateInfo *rs = (VkPipelineRasterizationStateCreateInfo *)pipeCreateInfo.pRasterizationState;