mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-29 12:19:12 +00:00
Renderer: Move cull mode to a rasterization state object
Also moves logic for primitive handling to VideoCommon.
This commit is contained in:
parent
2869c570f1
commit
836b9b9acb
38 changed files with 389 additions and 450 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue