OGL-StreamBuffer: make the SLOT calculation much easier

The size of the buffer is now power of 2, so we can use a shift instead of a division.
This was at about 2% of the global CPU usage.
This commit is contained in:
degasus
2014-06-05 11:06:41 +02:00
parent d81d2e8915
commit 02a4e3d70f
2 changed files with 14 additions and 11 deletions

View File

@ -46,7 +46,10 @@ protected:
size_t m_free_iterator;
private:
static const u32 SYNC_POINTS = 16;
static const int SYNC_POINTS = 16;
inline int SLOT(size_t x) const { return x >> m_bit_per_slot; }
const int m_bit_per_slot;
GLsync fences[SYNC_POINTS];
};