CommonFuncs: Convert ROUND_UP_POW2 macro to a function

Also move it to MathUtils where it belongs with the rest of the
power-of-two functions. This gets rid of pollution of the current scope
of any translation unit with b<value> macros that aren't intended to be
used directly.
This commit is contained in:
Lioncash
2018-05-10 19:06:19 -04:00
parent 3cca051850
commit ba01f6dba3
7 changed files with 29 additions and 23 deletions

View File

@ -5,8 +5,8 @@
#include "VideoBackends/OGL/StreamBuffer.h"
#include "Common/Align.h"
#include "Common/CommonFuncs.h"
#include "Common/GL/GLUtil.h"
#include "Common/MathUtil.h"
#include "Common/MemoryUtil.h"
#include "VideoBackends/OGL/Render.h"
@ -25,8 +25,8 @@ static u32 GenBuffer()
}
StreamBuffer::StreamBuffer(u32 type, u32 size)
: m_buffer(GenBuffer()), m_buffertype(type), m_size(ROUND_UP_POW2(size)),
m_bit_per_slot(IntLog2(ROUND_UP_POW2(size) / SYNC_POINTS))
: m_buffer(GenBuffer()), m_buffertype(type), m_size(MathUtil::NextPowerOf2(size)),
m_bit_per_slot(IntLog2(MathUtil::NextPowerOf2(size) / SYNC_POINTS))
{
m_iterator = 0;
m_used_iterator = 0;