Video backends: warn on usage of GL_DRAW_QUADS_2.

It's not normally used, so if it shows up, it could indicate a CPU emulation
bug.
This commit is contained in:
magumagu 2014-05-17 11:55:32 -07:00
parent 39d439fc48
commit 9b82d72070
3 changed files with 12 additions and 2 deletions

View File

@ -25,7 +25,10 @@ void SetupUnit::SetupVertex()
switch (m_PrimType)
{
case GX_DRAW_QUADS:
SetupQuad();
break;
case GX_DRAW_QUADS_2:
WARN_LOG(VIDEO, "Non-standard primitive drawing command GL_DRAW_QUADS_2");
SetupQuad();
break;
case GX_DRAW_TRIANGLES:

View File

@ -23,7 +23,7 @@ void IndexGenerator::Init()
if (g_Config.backend_info.bSupportsPrimitiveRestart)
{
primitive_table[GX_DRAW_QUADS] = IndexGenerator::AddQuads<true>;
primitive_table[GX_DRAW_QUADS_2] = IndexGenerator::AddQuads<true>;
primitive_table[GX_DRAW_QUADS_2] = IndexGenerator::AddQuads_nonstandard<true>;
primitive_table[GX_DRAW_TRIANGLES] = IndexGenerator::AddList<true>;
primitive_table[GX_DRAW_TRIANGLE_STRIP] = IndexGenerator::AddStrip<true>;
primitive_table[GX_DRAW_TRIANGLE_FAN] = IndexGenerator::AddFan<true>;
@ -31,7 +31,7 @@ void IndexGenerator::Init()
else
{
primitive_table[GX_DRAW_QUADS] = IndexGenerator::AddQuads<false>;
primitive_table[GX_DRAW_QUADS_2] = IndexGenerator::AddQuads<false>;
primitive_table[GX_DRAW_QUADS_2] = IndexGenerator::AddQuads_nonstandard<false>;
primitive_table[GX_DRAW_TRIANGLES] = IndexGenerator::AddList<false>;
primitive_table[GX_DRAW_TRIANGLE_STRIP] = IndexGenerator::AddStrip<false>;
primitive_table[GX_DRAW_TRIANGLE_FAN] = IndexGenerator::AddFan<false>;
@ -198,6 +198,12 @@ template <bool pr> u16* IndexGenerator::AddQuads(u16 *Iptr, u32 numVerts, u32 in
return Iptr;
}
template <bool pr> u16* IndexGenerator::AddQuads_nonstandard(u16 *Iptr, u32 numVerts, u32 index)
{
WARN_LOG(VIDEO, "Non-standard primitive drawing command GL_DRAW_QUADS_2");
return AddQuads<pr>(Iptr, numVerts, index);
}
// Lines
u16* IndexGenerator::AddLineList(u16 *Iptr, u32 numVerts, u32 index)
{

View File

@ -31,6 +31,7 @@ private:
template <bool pr> static u16* AddStrip(u16 *Iptr, u32 numVerts, u32 index);
template <bool pr> static u16* AddFan(u16 *Iptr, u32 numVerts, u32 index);
template <bool pr> static u16* AddQuads(u16 *Iptr, u32 numVerts, u32 index);
template <bool pr> static u16* AddQuads_nonstandard(u16 *Iptr, u32 numVerts, u32 index);
// Lines
static u16* AddLineList(u16 *Iptr, u32 numVerts, u32 index);