From a3d5404393a9912f01d77a17f099865a43333794 Mon Sep 17 00:00:00 2001 From: baldurk Date: Mon, 2 Aug 2021 10:22:40 +0100 Subject: [PATCH] Don't use the W from VS input (and VS out with geom/tess) positions * This allows W to be filled with 1.0 which our mesh viewing shader expects to have to be able to multiply by the MVP matrix. --- qrenderdoc/Windows/BufferViewer.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/qrenderdoc/Windows/BufferViewer.cpp b/qrenderdoc/Windows/BufferViewer.cpp index 3e9f0764b..9caf54bb1 100644 --- a/qrenderdoc/Windows/BufferViewer.cpp +++ b/qrenderdoc/Windows/BufferViewer.cpp @@ -3154,6 +3154,7 @@ void BufferViewer::UI_CalculateMeshFormats() } m_VSInPosition.format = prop.format; + m_VSInPosition.format.compCount = qMin((uint8_t)3, m_VSInPosition.format.compCount); } elIdx = m_ModelVSIn->secondaryColumn(); @@ -3208,7 +3209,11 @@ void BufferViewer::UI_CalculateMeshFormats() // if geometry/tessellation is enabled, don't unproject VS output data if(m_Ctx.CurPipelineState().GetShader(ShaderStage::Tess_Eval) != ResourceId() || m_Ctx.CurPipelineState().GetShader(ShaderStage::Geometry) != ResourceId()) + { m_PostVSPosition.unproject = false; + // ignore any W component that might be there, let it be filled in with 1.0 + m_PostVSPosition.format.compCount = qMin((uint8_t)3, m_VSInPosition.format.compCount); + } elIdx = m_ModelVSOut->secondaryColumn();