diff --git a/examples/common/entry/input.cpp b/examples/common/entry/input.cpp index 76c673d97..9d39d0aaa 100644 --- a/examples/common/entry/input.cpp +++ b/examples/common/entry/input.cpp @@ -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); diff --git a/src/renderer_d3d11.cpp b/src/renderer_d3d11.cpp index a3b34a5ac..d322f3277 100644 --- a/src/renderer_d3d11.cpp +++ b/src/renderer_d3d11.cpp @@ -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]; @@ -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]; @@ -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) @@ -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: "); diff --git a/src/renderer_d3d12.cpp b/src/renderer_d3d12.cpp index 5bb209bf8..5f29b18bb 100644 --- a/src/renderer_d3d12.cpp +++ b/src/renderer_d3d12.cpp @@ -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(); @@ -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) @@ -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]; @@ -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) @@ -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(); @@ -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++; diff --git a/src/renderer_gl.cpp b/src/renderer_gl.cpp index f2554e6dc..1f149950d 100644 --- a/src/renderer_gl.cpp +++ b/src/renderer_gl.cpp @@ -3761,7 +3761,7 @@ namespace bgfx { namespace gl ? m_maxAnisotropyDefault : 0.0f ; - + if (m_maxAnisotropy != maxAnisotropy) { m_maxAnisotropy = maxAnisotropy; @@ -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]; @@ -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) diff --git a/src/renderer_gl.h b/src/renderer_gl.h index 6847db844..676ff3afc 100644 --- a/src/renderer_gl.h +++ b/src/renderer_gl.h @@ -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]; diff --git a/src/renderer_mtl.mm b/src/renderer_mtl.mm index 4f9c44281..cf00e82cc 100644 --- a/src/renderer_mtl.mm +++ b/src/renderer_mtl.mm @@ -3994,7 +3994,7 @@ BX_PRAGMA_DIAGNOSTIC_POP(); 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; @@ -4044,7 +4044,7 @@ BX_PRAGMA_DIAGNOSTIC_POP(); { BX_UNUSED(_wait); - while (0 != m_control.available() ) + while (0 != m_control.getNumUsed() ) { Query& query = m_query[m_control.m_read]; @@ -4062,7 +4062,7 @@ BX_PRAGMA_DIAGNOSTIC_POP(); { 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) @@ -5280,7 +5280,7 @@ BX_PRAGMA_DIAGNOSTIC_POP(); } 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();