mirror of
https://github.com/bkaradzic/bgfx.git
synced 2026-10-29 20:25:28 +00:00
This commit is contained in:
+12
-16
@@ -4431,18 +4431,16 @@ namespace bgfx
|
||||
|
||||
uint32_t getAvailTransientIndexBuffer(uint32_t _num, uint16_t _indexSize)
|
||||
{
|
||||
const uint32_t offset = bx::strideAlign(m_iboffset, _indexSize);
|
||||
uint32_t iboffset = offset + _num*_indexSize;
|
||||
iboffset = bx::min<uint32_t>(iboffset, g_caps.limits.maxTransientIbSize);
|
||||
const uint32_t num = (iboffset-offset)/_indexSize;
|
||||
return num;
|
||||
const uint64_t offset = bx::strideAlign(m_iboffset, _indexSize);
|
||||
const uint64_t iboffset = bx::min<uint64_t>(offset + uint64_t(_num)*_indexSize, g_caps.limits.maxTransientIbSize);
|
||||
return uint32_t(bx::max(iboffset, offset) - offset)/_indexSize;
|
||||
}
|
||||
|
||||
uint32_t allocTransientIndexBuffer(uint32_t& _num, uint16_t _indexSize)
|
||||
{
|
||||
uint32_t offset = bx::strideAlign(m_iboffset, _indexSize);
|
||||
uint32_t num = getAvailTransientIndexBuffer(_num, _indexSize);
|
||||
m_iboffset = offset + num*_indexSize;
|
||||
const uint32_t offset = bx::strideAlign(m_iboffset, _indexSize);
|
||||
const uint32_t num = getAvailTransientIndexBuffer(_num, _indexSize);
|
||||
m_iboffset = 0 == num ? m_iboffset : offset + num*_indexSize;
|
||||
_num = num;
|
||||
|
||||
return offset;
|
||||
@@ -4450,18 +4448,16 @@ namespace bgfx
|
||||
|
||||
uint32_t getAvailTransientVertexBuffer(uint32_t _num, uint16_t _stride)
|
||||
{
|
||||
uint32_t offset = bx::strideAlign(m_vboffset, _stride);
|
||||
uint32_t vboffset = offset + _num * _stride;
|
||||
vboffset = bx::min<uint32_t>(vboffset, g_caps.limits.maxTransientVbSize);
|
||||
uint32_t num = (vboffset-offset)/_stride;
|
||||
return num;
|
||||
const uint64_t offset = bx::strideAlign(m_vboffset, _stride);
|
||||
const uint64_t vboffset = bx::min<uint64_t>(offset + uint64_t(_num)*_stride, g_caps.limits.maxTransientVbSize);
|
||||
return uint32_t(bx::max(vboffset, offset) - offset)/_stride;
|
||||
}
|
||||
|
||||
uint32_t allocTransientVertexBuffer(uint32_t& _num, uint16_t _stride)
|
||||
{
|
||||
uint32_t offset = bx::strideAlign(m_vboffset, _stride);
|
||||
uint32_t num = getAvailTransientVertexBuffer(_num, _stride);
|
||||
m_vboffset = offset + num * _stride;
|
||||
const uint32_t offset = bx::strideAlign(m_vboffset, _stride);
|
||||
const uint32_t num = getAvailTransientVertexBuffer(_num, _stride);
|
||||
m_vboffset = 0 == num ? m_vboffset : offset + num*_stride;
|
||||
_num = num;
|
||||
|
||||
return offset;
|
||||
|
||||
@@ -5937,6 +5937,11 @@ namespace bgfx { namespace d3d12
|
||||
if (!_finishAll
|
||||
&& _waitFence <= m_completedFence)
|
||||
{
|
||||
while (0 < m_control.getNumUsed()
|
||||
&& consume(0) )
|
||||
{
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user