From 636d4bfe553a04bf418ce1bc1fc120a30de0d503 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Sat, 10 Feb 2018 15:43:26 -0800 Subject: [PATCH] Cleanup. --- src/bgfx.cpp | 10 +++++----- src/bgfx_p.h | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/bgfx.cpp b/src/bgfx.cpp index c2bcc64e9..3630b9dee 100644 --- a/src/bgfx.cpp +++ b/src/bgfx.cpp @@ -195,7 +195,7 @@ namespace bgfx { bx::MutexScope scope(m_mutex); ++m_numBlocks; - m_maxBlocks = bx::uint32_max(m_maxBlocks, m_numBlocks); + m_maxBlocks = bx::max(m_maxBlocks, m_numBlocks); } #endif // BGFX_CONFIG_MEMORY_TRACKING @@ -212,7 +212,7 @@ namespace bgfx { bx::MutexScope scope(m_mutex); ++m_numBlocks; - m_maxBlocks = bx::uint32_max(m_maxBlocks, m_numBlocks); + m_maxBlocks = bx::max(m_maxBlocks, m_numBlocks); } #endif // BGFX_CONFIG_MEMORY_TRACKING @@ -987,9 +987,9 @@ namespace bgfx m_compute.m_startMatrix = m_draw.m_startMatrix; m_compute.m_numMatrices = m_draw.m_numMatrices; - m_compute.m_numX = bx::uint32_max(_numX, 1); - m_compute.m_numY = bx::uint32_max(_numY, 1); - m_compute.m_numZ = bx::uint32_max(_numZ, 1); + m_compute.m_numX = bx::max(_numX, 1u); + m_compute.m_numY = bx::max(_numY, 1u); + m_compute.m_numZ = bx::max(_numZ, 1u); m_compute.m_submitFlags = _flags; m_key.m_program = _handle.idx; diff --git a/src/bgfx_p.h b/src/bgfx_p.h index fa9f72a2f..42dc40850 100644 --- a/src/bgfx_p.h +++ b/src/bgfx_p.h @@ -449,7 +449,7 @@ namespace bgfx { if (_hasMips) { - const uint32_t max = bx::uint32_max(bx::uint32_max(_width, _height), _depth); + const uint32_t max = bx::max(_width, _height, _depth); const uint32_t num = 1 + uint32_t(bx::log2(float(max) ) ); return uint8_t(num); @@ -2864,7 +2864,7 @@ namespace bgfx return ptr; } - uint32_t allocSize = bx::uint32_max(BGFX_CONFIG_DYNAMIC_INDEX_BUFFER_SIZE, _size); + const uint32_t allocSize = bx::max(BGFX_CONFIG_DYNAMIC_INDEX_BUFFER_SIZE, _size); CommandBuffer& cmdbuf = getCommandBuffer(CommandBuffer::CreateDynamicIndexBuffer); cmdbuf.write(indexBufferHandle); @@ -3033,7 +3033,7 @@ namespace bgfx return NonLocalAllocator::kInvalidBlock; } - uint32_t allocSize = bx::uint32_max(BGFX_CONFIG_DYNAMIC_VERTEX_BUFFER_SIZE, _size); + const uint32_t allocSize = bx::max(BGFX_CONFIG_DYNAMIC_VERTEX_BUFFER_SIZE, _size); CommandBuffer& cmdbuf = getCommandBuffer(CommandBuffer::CreateDynamicVertexBuffer); cmdbuf.write(vertexBufferHandle);