mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-22 22:00:39 -06:00
IndexGenerator: inline all variables
As we do lots of writes to *Iptr, the compiler isn't allowed to cache any shared variable (neither index nor Iptr itself). This commit inlines Iptr + index into the index generator functions, so the compiler know that they are const.
This commit is contained in:
@ -19,31 +19,31 @@ public:
|
||||
static void AddIndices(int primitive, u32 numVertices);
|
||||
|
||||
// returns numprimitives
|
||||
static u32 GetNumVerts() {return index;}
|
||||
static u32 GetNumVerts() {return base_index;}
|
||||
|
||||
static u32 GetIndexLen() {return (u32)(Iptr - BASEIptr);}
|
||||
static u32 GetIndexLen() {return (u32)(index_buffer_current - BASEIptr);}
|
||||
|
||||
static u32 GetRemainingIndices();
|
||||
|
||||
private:
|
||||
// Triangles
|
||||
template <bool pr> static void AddList(u32 numVerts);
|
||||
template <bool pr> static void AddStrip(u32 numVerts);
|
||||
template <bool pr> static void AddFan(u32 numVerts);
|
||||
template <bool pr> static void AddQuads(u32 numVerts);
|
||||
template <bool pr> static u16* AddList(u16 *Iptr, u32 numVerts, u32 index);
|
||||
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);
|
||||
|
||||
// Lines
|
||||
static void AddLineList(u32 numVerts);
|
||||
static void AddLineStrip(u32 numVerts);
|
||||
static u16* AddLineList(u16 *Iptr, u32 numVerts, u32 index);
|
||||
static u16* AddLineStrip(u16 *Iptr, u32 numVerts, u32 index);
|
||||
|
||||
// Points
|
||||
static void AddPoints(u32 numVerts);
|
||||
static u16* AddPoints(u16 *Iptr, u32 numVerts, u32 index);
|
||||
|
||||
template <bool pr> static void WriteTriangle(u32 index1, u32 index2, u32 index3);
|
||||
template <bool pr> static u16* WriteTriangle(u16 *Iptr, u32 index1, u32 index2, u32 index3);
|
||||
|
||||
static u16 *Iptr;
|
||||
static u16 *index_buffer_current;
|
||||
static u16 *BASEIptr;
|
||||
static u32 index;
|
||||
static u32 base_index;
|
||||
};
|
||||
|
||||
#endif // _INDEXGENERATOR_H
|
||||
|
Reference in New Issue
Block a user