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.
This commit is contained in:
baldurk
2021-08-02 10:22:40 +01:00
parent 7e080857aa
commit a3d5404393
+5
View File
@@ -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();