Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/common/entry/input.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ struct InputKeyboard

const uint8_t* popChar()
{
if (0 < m_ring.available() )
if (0 < m_ring.getNumUsed() )
{
uint8_t* utf8 = &m_char[m_ring.m_read];
m_ring.consume(4);
Expand Down
8 changes: 4 additions & 4 deletions src/renderer_d3d11.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5406,7 +5406,7 @@ namespace bgfx { namespace d3d11

bool TimerQueryD3D11::update()
{
if (0 != m_control.available() )
if (0 != m_control.getNumUsed() )
{
Query& query = m_query[m_control.m_read];

Expand Down Expand Up @@ -5498,7 +5498,7 @@ namespace bgfx { namespace d3d11
{
ID3D11DeviceContext* deviceCtx = s_renderD3D11->m_deviceCtx;

while (0 != m_control.available() )
while (0 != m_control.getNumUsed() )
{
Query& query = m_query[m_control.m_read];

Expand All @@ -5522,7 +5522,7 @@ namespace bgfx { namespace d3d11
{
const uint32_t size = m_control.m_size;

for (uint32_t ii = 0, num = m_control.available(); ii < num; ++ii)
for (uint32_t ii = 0, num = m_control.getNumUsed(); ii < num; ++ii)
{
Query& query = m_query[(m_control.m_read + ii) % size];
if (query.m_handle.idx == _handle.idx)
Expand Down Expand Up @@ -6667,7 +6667,7 @@ namespace bgfx { namespace d3d11
tvm.printf(10, pos++, 0x8b, " DIB size: %7d ", _render->m_iboffset);

pos++;
tvm.printf(10, pos++, 0x8b, " Occlusion queries: %3d ", m_occlusionQuery.m_control.available() );
tvm.printf(10, pos++, 0x8b, " Occlusion queries: %3d ", m_occlusionQuery.m_control.getNumUsed() );

pos++;
tvm.printf(10, pos++, 0x8b, " State cache: ");
Expand Down
14 changes: 7 additions & 7 deletions src/renderer_d3d12.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4201,7 +4201,7 @@ namespace bgfx { namespace d3d12

void CommandQueueD3D12::finish(uint64_t _waitFence, bool _finishAll)
{
while (0 < m_control.available() )
while (0 < m_control.getNumUsed() )
{
consume();

Expand All @@ -4212,12 +4212,12 @@ namespace bgfx { namespace d3d12
}
}

BX_ASSERT(0 == m_control.available(), "");
BX_ASSERT(0 == m_control.getNumUsed(), "");
}

bool CommandQueueD3D12::tryFinish(uint64_t _waitFence)
{
if (0 < m_control.available() )
if (0 < m_control.getNumUsed() )
{
if (consume(0)
&& _waitFence <= m_completedFence)
Expand Down Expand Up @@ -6245,7 +6245,7 @@ namespace bgfx { namespace d3d12

bool TimerQueryD3D12::update()
{
if (0 != m_control.available() )
if (0 != m_control.getNumUsed() )
{
uint32_t idx = m_control.m_read;
Query& query = m_query[idx];
Expand Down Expand Up @@ -6346,7 +6346,7 @@ namespace bgfx { namespace d3d12
{
const uint32_t size = m_control.m_size;

for (uint32_t ii = 0, num = m_control.available(); ii < num; ++ii)
for (uint32_t ii = 0, num = m_control.getNumUsed(); ii < num; ++ii)
{
OcclusionQueryHandle& handle = m_handle[(m_control.m_read + ii) % size];
if (handle.idx == _handle.idx)
Expand Down Expand Up @@ -7369,7 +7369,7 @@ namespace bgfx { namespace d3d12
maxGpuLatency = bx::uint32_imax(maxGpuLatency, result.m_pending-1);
}

maxGpuLatency = bx::uint32_imax(maxGpuLatency, m_gpuTimer.m_control.available()-1);
maxGpuLatency = bx::uint32_imax(maxGpuLatency, m_gpuTimer.m_control.getNumUsed()-1);

const int64_t timerFreq = bx::getHPFrequency();

Expand Down Expand Up @@ -7558,7 +7558,7 @@ namespace bgfx { namespace d3d12
, m_pipelineStateCache.getCount()
, m_samplerStateCache.getCount()
, bindLru.getCount()
, m_cmd.m_control.available()
, m_cmd.m_control.getNumUsed()
);
pos++;

Expand Down
6 changes: 3 additions & 3 deletions src/renderer_gl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3761,7 +3761,7 @@ namespace bgfx { namespace gl
? m_maxAnisotropyDefault
: 0.0f
;

if (m_maxAnisotropy != maxAnisotropy)
{
m_maxAnisotropy = maxAnisotropy;
Expand Down Expand Up @@ -7366,7 +7366,7 @@ namespace bgfx { namespace gl

void OcclusionQueryGL::resolve(Frame* _render, bool _wait)
{
while (0 != m_control.available() )
while (0 != m_control.getNumUsed() )
{
Query& query = m_query[m_control.m_read];

Expand Down Expand Up @@ -7396,7 +7396,7 @@ namespace bgfx { namespace gl
{
const uint32_t size = m_control.m_size;

for (uint32_t ii = 0, num = m_control.available(); ii < num; ++ii)
for (uint32_t ii = 0, num = m_control.getNumUsed(); ii < num; ++ii)
{
Query& query = m_query[(m_control.m_read + ii) % size];
if (query.m_handle.idx == _handle.idx)
Expand Down
2 changes: 1 addition & 1 deletion src/renderer_gl.h
Original file line number Diff line number Diff line change
Expand Up @@ -1645,7 +1645,7 @@ namespace bgfx { namespace gl

bool update()
{
if (0 != m_control.available() )
if (0 != m_control.getNumUsed() )
{
Query& query = m_query[m_control.m_read];

Expand Down
8 changes: 4 additions & 4 deletions src/renderer_mtl.mm
Original file line number Diff line number Diff line change
Expand Up @@ -3994,7 +3994,7 @@ static void setTimestamp(void* _data)

bool TimerQueryMtl::get()
{
if (0 != m_control.available() )
if (0 != m_control.getNumUsed() )
{
uint32_t offset = m_control.m_read;
m_begin = m_result[offset].m_begin;
Expand Down Expand Up @@ -4044,7 +4044,7 @@ static void setTimestamp(void* _data)
{
BX_UNUSED(_wait);

while (0 != m_control.available() )
while (0 != m_control.getNumUsed() )
{
Query& query = m_query[m_control.m_read];

Expand All @@ -4062,7 +4062,7 @@ static void setTimestamp(void* _data)
{
const uint32_t size = m_control.m_size;

for (uint32_t ii = 0, num = m_control.available(); ii < num; ++ii)
for (uint32_t ii = 0, num = m_control.getNumUsed(); ii < num; ++ii)
{
Query& query = m_query[(m_control.m_read + ii) % size];
if (query.m_handle.idx == _handle.idx)
Expand Down Expand Up @@ -5280,7 +5280,7 @@ static void setTimestamp(void* _data)
}
while (m_gpuTimer.get() );

maxGpuLatency = bx::uint32_imax(maxGpuLatency, m_gpuTimer.m_control.available()-1);
maxGpuLatency = bx::uint32_imax(maxGpuLatency, m_gpuTimer.m_control.getNumUsed()-1);

const int64_t timerFreq = bx::getHPFrequency();

Expand Down