From cef953d6e9e65ae8480aa65a1d54d7cc6ae3e26d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Sun, 20 Nov 2016 12:45:47 -0800 Subject: [PATCH] Fixed issue #980. --- src/bgfx.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/bgfx.cpp b/src/bgfx.cpp index fe91122dc..c58f5bfa3 100644 --- a/src/bgfx.cpp +++ b/src/bgfx.cpp @@ -952,15 +952,21 @@ namespace bgfx void Frame::sort() { + uint8_t viewRemap[BGFX_CONFIG_MAX_VIEWS]; + for (uint32_t ii = 0; ii < BGFX_CONFIG_MAX_VIEWS; ++ii) + { + viewRemap[m_viewRemap[ii] ] = ii; + } + for (uint32_t ii = 0, num = m_num; ii < num; ++ii) { - m_sortKeys[ii] = SortKey::remapView(m_sortKeys[ii], m_viewRemap); + m_sortKeys[ii] = SortKey::remapView(m_sortKeys[ii], viewRemap); } bx::radixSort(m_sortKeys, s_ctx->m_tempKeys, m_sortValues, s_ctx->m_tempValues, m_num); for (uint32_t ii = 0, num = m_num; ii < num; ++ii) { - m_blitKeys[ii] = BlitKey::remapView(m_blitKeys[ii], m_viewRemap); + m_blitKeys[ii] = BlitKey::remapView(m_blitKeys[ii], viewRemap); } bx::radixSort(m_blitKeys, (uint32_t*)&s_ctx->m_tempKeys, m_numBlitItems); }