diff options
| author | Tony Wasserka <neobrainx@gmail.com> | 2014-05-18 11:12:06 +0200 |
|---|---|---|
| committer | Tony Wasserka <neobrainx@gmail.com> | 2014-05-18 11:12:06 +0200 |
| commit | 6950f533aee33cbdce7ecfd5f59e3aba3836e730 (patch) | |
| tree | 4ecead69475c6534985e102cdcb0967cdc2e15c5 /Source/Core/VideoCommon/IndexGenerator.cpp | |
| parent | db96f862d2d7b0520b1cbae3b72ea6af1af5383e (diff) | |
| parent | 9b82d720705c8e6fd34c336a92dde5a8b10471b9 (diff) | |
Merge pull request #355 from magumagu/gx-missing-opcode
Opcode decoding: handle missing opcodes 0x88 etc.
Diffstat (limited to 'Source/Core/VideoCommon/IndexGenerator.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/IndexGenerator.cpp | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/Source/Core/VideoCommon/IndexGenerator.cpp b/Source/Core/VideoCommon/IndexGenerator.cpp index 949ee342b1..1e713185a5 100644 --- a/Source/Core/VideoCommon/IndexGenerator.cpp +++ b/Source/Core/VideoCommon/IndexGenerator.cpp @@ -6,6 +6,7 @@ #include "Common/Common.h" #include "VideoCommon/IndexGenerator.h" +#include "VideoCommon/OpcodeDecoding.h" #include "VideoCommon/VideoConfig.h" //Init @@ -21,22 +22,23 @@ void IndexGenerator::Init() { if (g_Config.backend_info.bSupportsPrimitiveRestart) { - primitive_table[0] = IndexGenerator::AddQuads<true>; - primitive_table[2] = IndexGenerator::AddList<true>; - primitive_table[3] = IndexGenerator::AddStrip<true>; - primitive_table[4] = IndexGenerator::AddFan<true>; + primitive_table[GX_DRAW_QUADS] = 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>; } else { - primitive_table[0] = IndexGenerator::AddQuads<false>; - primitive_table[2] = IndexGenerator::AddList<false>; - primitive_table[3] = IndexGenerator::AddStrip<false>; - primitive_table[4] = IndexGenerator::AddFan<false>; + primitive_table[GX_DRAW_QUADS] = 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>; } - primitive_table[1] = nullptr; - primitive_table[5] = &IndexGenerator::AddLineList; - primitive_table[6] = &IndexGenerator::AddLineStrip; - primitive_table[7] = &IndexGenerator::AddPoints; + primitive_table[GX_DRAW_LINES] = &IndexGenerator::AddLineList; + primitive_table[GX_DRAW_LINE_STRIP] = &IndexGenerator::AddLineStrip; + primitive_table[GX_DRAW_POINTS] = &IndexGenerator::AddPoints; } void IndexGenerator::Start(u16* Indexptr) @@ -196,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) { |
