mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 05:09:34 -06:00
Renderer: Move cull mode to a rasterization state object
Also moves logic for primitive handling to VideoCommon.
This commit is contained in:
@ -138,33 +138,9 @@ void VertexManager::vFlush()
|
||||
// Figure out the number of indices to draw
|
||||
u32 index_count = IndexGenerator::GetIndexLen();
|
||||
|
||||
// Update assembly state
|
||||
// Update tracked state
|
||||
StateTracker::GetInstance()->SetVertexFormat(vertex_format);
|
||||
switch (m_current_primitive_type)
|
||||
{
|
||||
case PRIMITIVE_POINTS:
|
||||
StateTracker::GetInstance()->SetPrimitiveTopology(VK_PRIMITIVE_TOPOLOGY_POINT_LIST);
|
||||
StateTracker::GetInstance()->DisableBackFaceCulling();
|
||||
break;
|
||||
|
||||
case PRIMITIVE_LINES:
|
||||
StateTracker::GetInstance()->SetPrimitiveTopology(VK_PRIMITIVE_TOPOLOGY_LINE_LIST);
|
||||
StateTracker::GetInstance()->DisableBackFaceCulling();
|
||||
break;
|
||||
|
||||
case PRIMITIVE_TRIANGLES:
|
||||
StateTracker::GetInstance()->SetPrimitiveTopology(
|
||||
g_ActiveConfig.backend_info.bSupportsPrimitiveRestart ?
|
||||
VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP :
|
||||
VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST);
|
||||
g_renderer->SetGenerationMode();
|
||||
break;
|
||||
}
|
||||
|
||||
// Check for any shader stage changes
|
||||
StateTracker::GetInstance()->CheckForShaderChanges(m_current_primitive_type);
|
||||
|
||||
// Update any changed constants
|
||||
StateTracker::GetInstance()->CheckForShaderChanges();
|
||||
StateTracker::GetInstance()->UpdateVertexShaderConstants();
|
||||
StateTracker::GetInstance()->UpdateGeometryShaderConstants();
|
||||
StateTracker::GetInstance()->UpdatePixelShaderConstants();
|
||||
|
Reference in New Issue
Block a user