mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-23 18:59:19 +00:00
VideoCommon: update the IndexGenerator logic to take a flag that avoids primitive restarts when the editor is in progress, GLTF files don't support primitive restarts and running without is easier than trying to calculate a new set of indices
This commit is contained in:
parent
8e539121dc
commit
3f38247c4e
2 changed files with 7 additions and 4 deletions
|
@ -262,11 +262,14 @@ u16* AddPoints_VSExpand(u16* index_ptr, u32 num_verts, u32 index)
|
|||
}
|
||||
} // Anonymous namespace
|
||||
|
||||
void IndexGenerator::Init()
|
||||
void IndexGenerator::Init(bool editor_enabled)
|
||||
{
|
||||
using OpcodeDecoder::Primitive;
|
||||
|
||||
if (g_backend_info.bSupportsPrimitiveRestart)
|
||||
// When editor is enabled, we can't take shortcuts
|
||||
// as we might want to save meshes to a file
|
||||
// Some formats don't allow primitive restart
|
||||
if (g_backend_info.bSupportsPrimitiveRestart && !editor_enabled)
|
||||
{
|
||||
m_primitive_table[Primitive::GX_DRAW_QUADS] = AddQuads<true>;
|
||||
m_primitive_table[Primitive::GX_DRAW_QUADS_2] = AddQuads_nonstandard<true>;
|
||||
|
@ -282,7 +285,7 @@ void IndexGenerator::Init()
|
|||
m_primitive_table[Primitive::GX_DRAW_TRIANGLE_STRIP] = AddStrip<false>;
|
||||
m_primitive_table[Primitive::GX_DRAW_TRIANGLE_FAN] = AddFan<false>;
|
||||
}
|
||||
if (g_Config.UseVSForLinePointExpand())
|
||||
if (g_Config.UseVSForLinePointExpand() && !editor_enabled)
|
||||
{
|
||||
if (g_backend_info.bSupportsPrimitiveRestart)
|
||||
{
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
class IndexGenerator
|
||||
{
|
||||
public:
|
||||
void Init();
|
||||
void Init(bool editor_enabled);
|
||||
void Start(u16* index_ptr);
|
||||
|
||||
void AddIndices(OpcodeDecoder::Primitive primitive, u32 num_vertices);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue