This commit is contained in:
Branimir Karadžić 2017-10-07 21:19:47 -07:00
parent e1a9422445
commit 7a32c14157
2 changed files with 9 additions and 6 deletions

View File

@ -880,12 +880,11 @@ namespace bgfx
SortKey::Enum type = SortKey::SortProgram; SortKey::Enum type = SortKey::SortProgram;
switch (s_ctx->m_viewMode[_id]) switch (s_ctx->m_viewMode[_id])
{ {
case ViewMode::Sequential: m_key.m_seq = s_ctx->m_seq[_id]; type = SortKey::SortSequence; break; case ViewMode::Sequential: m_key.m_seq = s_ctx->getSeqIncr(_id); type = SortKey::SortSequence; break;
case ViewMode::DepthAscending: m_key.m_depth = (uint32_t)_depth; type = SortKey::SortDepth; break; case ViewMode::DepthAscending: m_key.m_depth = (uint32_t)_depth; type = SortKey::SortDepth; break;
case ViewMode::DepthDescending: m_key.m_depth = (uint32_t)-_depth; type = SortKey::SortDepth; break; case ViewMode::DepthDescending: m_key.m_depth = (uint32_t)-_depth; type = SortKey::SortDepth; break;
default: break; default: break;
} }
s_ctx->m_seq[_id]++;
uint64_t key = m_key.encodeDraw(type); uint64_t key = m_key.encodeDraw(type);
m_sortKeys[m_numRenderItems] = key; m_sortKeys[m_numRenderItems] = key;
@ -956,8 +955,7 @@ namespace bgfx
m_key.m_program = _handle.idx; m_key.m_program = _handle.idx;
m_key.m_depth = 0; m_key.m_depth = 0;
m_key.m_view = _id; m_key.m_view = _id;
m_key.m_seq = s_ctx->m_seq[_id]; m_key.m_seq = s_ctx->getSeqIncr(_id);
s_ctx->m_seq[_id]++;
uint64_t key = m_key.encodeCompute(); uint64_t key = m_key.encodeCompute();
m_sortKeys[m_numRenderItems] = key; m_sortKeys[m_numRenderItems] = key;

View File

@ -4315,6 +4315,11 @@ namespace bgfx
BGFX_API_FUNC(uint32_t frame(bool _capture = false) ); BGFX_API_FUNC(uint32_t frame(bool _capture = false) );
uint32_t getSeqIncr(uint8_t _id)
{
return m_seq[_id]++;
}
void dumpViewStats(); void dumpViewStats();
void freeDynamicBuffers(); void freeDynamicBuffers();
void freeAllHandles(Frame* _frame); void freeAllHandles(Frame* _frame);