From 4210fb0d64afc0ea5d2666e121e11689785aa568 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Wed, 15 Apr 2015 11:49:20 -0700 Subject: [PATCH] Renamed reset flag. --- examples/common/entry/entry.cpp | 2 +- include/bgfx.h | 4 +++- include/bgfxdefines.h | 2 +- src/bgfx.cpp | 4 ++-- src/bgfx_p.h | 7 ++++--- 5 files changed, 11 insertions(+), 8 deletions(-) diff --git a/examples/common/entry/entry.cpp b/examples/common/entry/entry.cpp index e9d00e32..998f5cce 100644 --- a/examples/common/entry/entry.cpp +++ b/examples/common/entry/entry.cpp @@ -124,7 +124,7 @@ BX_PRAGMA_DIAGNOSTIC_POP(); || setOrToggle(s_reset, "hmddbg", BGFX_RESET_HMD_DEBUG, 1, _argc, _argv) || setOrToggle(s_reset, "hmdrecenter", BGFX_RESET_HMD_RECENTER, 1, _argc, _argv) || setOrToggle(s_reset, "msaa", BGFX_RESET_MSAA_X16, 1, _argc, _argv) - || setOrToggle(s_reset, "flip", BGFX_RESET_FLIP_AFTER_SUBMIT, 1, _argc, _argv) + || setOrToggle(s_reset, "flip", BGFX_RESET_FLIP_AFTER_RENDER, 1, _argc, _argv) ) { return 0; diff --git a/include/bgfx.h b/include/bgfx.h index 5db0a87f..5a623dd8 100644 --- a/include/bgfx.h +++ b/include/bgfx.h @@ -576,7 +576,9 @@ namespace bgfx /// - `BGFX_RESET_HMD` - HMD stereo rendering. /// - `BGFX_RESET_HMD_DEBUG` - HMD stereo rendering debug mode. /// - `BGFX_RESET_HMD_RECENTER` - HMD calibration. - /// - `BGFX_RESET_FLIP_AFTER_SUBMIT` - Flip back buffer after submit. + /// - `BGFX_RESET_FLIP_AFTER_RENDER` - This flag specifies where flip + /// occurs. Default behavior is that flip occurs before rendering new + /// frame. This flag only has effect when `BGFX_CONFIG_MULTITHREADED=0`. /// /// @attention This call doesn't actually change window size, it just /// resizes back-buffer. Windowing code has to change window size. diff --git a/include/bgfxdefines.h b/include/bgfxdefines.h index d3517621..dc51503f 100644 --- a/include/bgfxdefines.h +++ b/include/bgfxdefines.h @@ -303,7 +303,7 @@ #define BGFX_RESET_HMD UINT32_C(0x00000400) #define BGFX_RESET_HMD_DEBUG UINT32_C(0x00000800) #define BGFX_RESET_HMD_RECENTER UINT32_C(0x00001000) -#define BGFX_RESET_FLIP_AFTER_SUBMIT UINT32_C(0x00002000) +#define BGFX_RESET_FLIP_AFTER_RENDER UINT32_C(0x00002000) /// #define BGFX_CAPS_TEXTURE_COMPARE_LEQUAL UINT64_C(0x0000000000000001) diff --git a/src/bgfx.cpp b/src/bgfx.cpp index 4f80a6a3..d8f40497 100644 --- a/src/bgfx.cpp +++ b/src/bgfx.cpp @@ -1206,7 +1206,7 @@ namespace bgfx bool Context::renderFrame() { if (m_rendererInitialized - && !m_flipAfterSubmit) + && !m_flipAfterRender) { m_renderCtx->flip(); } @@ -1223,7 +1223,7 @@ namespace bgfx renderSemPost(); if (m_rendererInitialized - && m_flipAfterSubmit) + && m_flipAfterRender) { m_renderCtx->flip(); } diff --git a/src/bgfx_p.h b/src/bgfx_p.h index 96b4756d..849dc831 100644 --- a/src/bgfx_p.h +++ b/src/bgfx_p.h @@ -1893,7 +1893,7 @@ namespace bgfx , m_renderCtx(NULL) , m_rendererInitialized(false) , m_exit(false) - , m_flipAfterSubmit(false) + , m_flipAfterRender(false) { } @@ -1928,7 +1928,7 @@ namespace bgfx m_resolution.m_height = bx::uint32_max(1, _height); m_resolution.m_flags = _flags; - m_flipAfterSubmit = !!(_flags & BGFX_RESET_FLIP_AFTER_SUBMIT); + m_flipAfterRender = !!(_flags & BGFX_RESET_FLIP_AFTER_RENDER); memset(m_fb, 0xff, sizeof(m_fb) ); @@ -2884,6 +2884,7 @@ namespace bgfx TextureHandle texHandle = _handles[ii]; BGFX_CHECK_HANDLE("createFrameBuffer texture handle", m_textureHandle, texHandle); BX_CHECK(bbRatio == m_textureRef[texHandle.idx].m_bbRatio, "Mismatch in texture back-buffer ratio."); + BX_UNUSED(bbRatio); cmdbuf.write(texHandle); @@ -3530,7 +3531,7 @@ namespace bgfx bool m_rendererInitialized; bool m_exit; - bool m_flipAfterSubmit; + bool m_flipAfterRender; typedef UpdateBatchT<256> TextureUpdateBatch; BX_ALIGN_DECL_CACHE_LINE(TextureUpdateBatch m_textureUpdateBatch);