This commit is contained in:
bkaradzic 2012-06-26 22:37:08 -07:00
parent 8dd523fa67
commit 1b0f2b6cbc
5 changed files with 13 additions and 11 deletions

View file

@ -345,7 +345,7 @@ namespace bgfx
/// ///
void destroyDynamicIndexBuffer(DynamicIndexBufferHandle _handle); void destroyDynamicIndexBuffer(DynamicIndexBufferHandle _handle);
// ///
DynamicVertexBufferHandle createDynamicVertexBuffer(uint16_t _num, const VertexDecl& _decl); DynamicVertexBufferHandle createDynamicVertexBuffer(uint16_t _num, const VertexDecl& _decl);
/// ///

View file

@ -341,8 +341,6 @@ namespace bgfx
} }
} }
TextVideoMemBlitter g_textVideoMemBlitter;
static const char* s_predefinedName[PredefinedUniform::Count] = static const char* s_predefinedName[PredefinedUniform::Count] =
{ {
"u_viewRect", "u_viewRect",
@ -662,7 +660,7 @@ namespace bgfx
getCommandBuffer(CommandBuffer::RendererInit); getCommandBuffer(CommandBuffer::RendererInit);
g_textVideoMemBlitter.init(); m_textVideoMemBlitter.init();
m_submit->m_transientVb = createTransientVertexBuffer(BGFX_CONFIG_TRANSIENT_VERTEX_BUFFER_SIZE); m_submit->m_transientVb = createTransientVertexBuffer(BGFX_CONFIG_TRANSIENT_VERTEX_BUFFER_SIZE);
m_submit->m_transientIb = createTransientIndexBuffer(BGFX_CONFIG_TRANSIENT_INDEX_BUFFER_SIZE); m_submit->m_transientIb = createTransientIndexBuffer(BGFX_CONFIG_TRANSIENT_INDEX_BUFFER_SIZE);

View file

@ -290,8 +290,6 @@ namespace bgfx
bgfx::MaterialHandle m_material; bgfx::MaterialHandle m_material;
}; };
extern TextVideoMemBlitter g_textVideoMemBlitter;
struct PredefinedUniform struct PredefinedUniform
{ {
enum Enum enum Enum
@ -2714,6 +2712,8 @@ namespace bgfx
uint32_t m_frames; uint32_t m_frames;
uint32_t m_debug; uint32_t m_debug;
TextVideoMemBlitter m_textVideoMemBlitter;
#if BX_PLATFORM_WINDOWS #if BX_PLATFORM_WINDOWS
struct Window struct Window
{ {

View file

@ -2255,11 +2255,15 @@ namespace bgfx
next = now + bx::getHPFrequency(); next = now + bx::getHPFrequency();
double freq = double(bx::getHPFrequency() ); double freq = double(bx::getHPFrequency() );
double toMs = 1000.0/freq; double toMs = 1000.0/freq;
double elapsedCpuMs = double(elapsed)*toMs;
tvm.clear(); tvm.clear();
uint16_t pos = 10; uint16_t pos = 10;
tvm.printf(10, pos++, 0x8e, " Frame: %3.4f [ms] / %3.2f", frameTime*toMs, freq/frameTime); tvm.printf(10, pos++, 0x8e, " Frame: %3.4f [ms] / %3.2f", frameTime*toMs, freq/frameTime);
tvm.printf(10, pos++, 0x8e, " Draw calls: %4d / %3.4f [ms]", m_render->m_num, elapsed*toMs); tvm.printf(10, pos++, 0x8e, " Draw calls: %4d / CPU %3.4f [ms]"
, m_render->m_num
, elapsedCpuMs
);
tvm.printf(10, pos++, 0x8e, " Prims: %7d", statsNumPrims); tvm.printf(10, pos++, 0x8e, " Prims: %7d", statsNumPrims);
tvm.printf(10, pos++, 0x8e, " Indices: %7d", statsNumIndices); tvm.printf(10, pos++, 0x8e, " Indices: %7d", statsNumIndices);
tvm.printf(10, pos++, 0x8e, " DVB size: %7d", m_render->m_vboffset); tvm.printf(10, pos++, 0x8e, " DVB size: %7d", m_render->m_vboffset);
@ -2272,7 +2276,7 @@ namespace bgfx
tvm.printf(10, pos++, attr[(attrIndex+1)&1], "Render wait: %3.4f [ms]", m_render->m_waitRender*toMs); tvm.printf(10, pos++, attr[(attrIndex+1)&1], "Render wait: %3.4f [ms]", m_render->m_waitRender*toMs);
} }
g_textVideoMemBlitter.blit(tvm); m_textVideoMemBlitter.blit(tvm);
PIX_ENDEVENT(); PIX_ENDEVENT();
} }
@ -2280,7 +2284,7 @@ namespace bgfx
{ {
PIX_BEGINEVENT(D3DCOLOR_RGBA(0x40, 0x40, 0x40, 0xff), "debugtext"); PIX_BEGINEVENT(D3DCOLOR_RGBA(0x40, 0x40, 0x40, 0xff), "debugtext");
g_textVideoMemBlitter.blit(m_render->m_textVideoMem); m_textVideoMemBlitter.blit(m_render->m_textVideoMem);
PIX_ENDEVENT(); PIX_ENDEVENT();
} }

View file

@ -2428,11 +2428,11 @@ namespace bgfx
tvm.printf(10, pos++, attr[(attrIndex+1)&1], "Render wait: %3.4f [ms]", double(m_render->m_waitRender)*toMs); tvm.printf(10, pos++, attr[(attrIndex+1)&1], "Render wait: %3.4f [ms]", double(m_render->m_waitRender)*toMs);
} }
g_textVideoMemBlitter.blit(tvm); m_textVideoMemBlitter.blit(tvm);
} }
else if (m_render->m_debug & BGFX_DEBUG_TEXT) else if (m_render->m_debug & BGFX_DEBUG_TEXT)
{ {
g_textVideoMemBlitter.blit(m_render->m_textVideoMem); m_textVideoMemBlitter.blit(m_render->m_textVideoMem);
} }
GREMEDY_FRAMETERMINATOR(); GREMEDY_FRAMETERMINATOR();