This commit is contained in:
Branimir Karadžić 2015-11-04 16:19:25 -08:00
parent 574d831c80
commit 06cd83ce20
2 changed files with 27 additions and 19 deletions

View file

@ -2259,6 +2259,7 @@ static void AddDrawListToRenderList(ImVector<ImDrawList*>& out_render_list, ImDr
// If this assert triggers because you are drawing lots of stuff manually, A) workaround by calling BeginChild()/EndChild() to put your draw commands in multiple draw lists, B) #define ImDrawIdx to a 'unsigned int' in imconfig.h and render accordingly. // If this assert triggers because you are drawing lots of stuff manually, A) workaround by calling BeginChild()/EndChild() to put your draw commands in multiple draw lists, B) #define ImDrawIdx to a 'unsigned int' in imconfig.h and render accordingly.
const unsigned long long int max_vtx_idx = (unsigned long long int)1L << (sizeof(ImDrawIdx)*8); const unsigned long long int max_vtx_idx = (unsigned long long int)1L << (sizeof(ImDrawIdx)*8);
IM_ASSERT((unsigned long long int)draw_list->_VtxCurrentIdx <= max_vtx_idx); IM_ASSERT((unsigned long long int)draw_list->_VtxCurrentIdx <= max_vtx_idx);
(void)max_vtx_idx;
GImGui->IO.MetricsRenderVertices += draw_list->VtxBuffer.Size; GImGui->IO.MetricsRenderVertices += draw_list->VtxBuffer.Size;
GImGui->IO.MetricsRenderIndices += draw_list->IdxBuffer.Size; GImGui->IO.MetricsRenderIndices += draw_list->IdxBuffer.Size;

View file

@ -868,27 +868,34 @@ namespace bgfx
void Frame::blit(uint8_t _id, TextureHandle _dst, uint8_t _dstMip, uint16_t _dstX, uint16_t _dstY, uint16_t _dstZ, TextureHandle _src, uint8_t _srcMip, uint16_t _srcX, uint16_t _srcY, uint16_t _srcZ, uint16_t _width, uint16_t _height, uint16_t _depth) void Frame::blit(uint8_t _id, TextureHandle _dst, uint8_t _dstMip, uint16_t _dstX, uint16_t _dstY, uint16_t _dstZ, TextureHandle _src, uint8_t _srcMip, uint16_t _srcX, uint16_t _srcY, uint16_t _srcZ, uint16_t _width, uint16_t _height, uint16_t _depth)
{ {
uint16_t item = m_numBlitItems++; BX_WARN(m_numBlitItems < BGFX_CONFIG_MAX_BLIT_ITEMS
, "Exceed number of available blit items per frame. BGFX_CONFIG_MAX_BLIT_ITEMS is %d. Skipping blit."
, BGFX_CONFIG_MAX_BLIT_ITEMS
);
if (m_numBlitItems < BGFX_CONFIG_MAX_BLIT_ITEMS)
{
uint16_t item = m_numBlitItems++;
BlitItem& bi = m_blitItem[item]; BlitItem& bi = m_blitItem[item];
bi.m_srcX = _srcX; bi.m_srcX = _srcX;
bi.m_srcY = _srcY; bi.m_srcY = _srcY;
bi.m_srcZ = _srcZ; bi.m_srcZ = _srcZ;
bi.m_dstX = _dstX; bi.m_dstX = _dstX;
bi.m_dstY = _dstY; bi.m_dstY = _dstY;
bi.m_dstZ = _dstZ; bi.m_dstZ = _dstZ;
bi.m_width = _width; bi.m_width = _width;
bi.m_height = _height; bi.m_height = _height;
bi.m_depth = _depth; bi.m_depth = _depth;
bi.m_srcMip = _srcMip; bi.m_srcMip = _srcMip;
bi.m_dstMip = _dstMip; bi.m_dstMip = _dstMip;
bi.m_src = _src; bi.m_src = _src;
bi.m_dst = _dst; bi.m_dst = _dst;
BlitKey key; BlitKey key;
key.m_view = _id; key.m_view = _id;
key.m_item = item; key.m_item = item;
m_blitKeys[item] = key.encode(); m_blitKeys[item] = key.encode();
}
} }
void Frame::sort() void Frame::sort()