diff --git a/examples/09-hdr/hdr.cpp b/examples/09-hdr/hdr.cpp index 090173f54..c75f68a64 100644 --- a/examples/09-hdr/hdr.cpp +++ b/examples/09-hdr/hdr.cpp @@ -202,13 +202,23 @@ public: m_lum[3] = bgfx::createFrameBuffer( 4, 4, bgfx::TextureFormat::BGRA8); m_lum[4] = bgfx::createFrameBuffer( 1, 1, bgfx::TextureFormat::BGRA8); + bgfx::setName(m_lum[0], "Luminance 0"); + bgfx::setName(m_lum[1], "Luminance 1"); + bgfx::setName(m_lum[2], "Luminance 2"); + bgfx::setName(m_lum[3], "Luminance 3"); + bgfx::setName(m_lum[4], "Luminance 4"); + m_bright = bgfx::createFrameBuffer(bgfx::BackbufferRatio::Half, bgfx::TextureFormat::BGRA8); m_blur = bgfx::createFrameBuffer(bgfx::BackbufferRatio::Eighth, bgfx::TextureFormat::BGRA8); + bgfx::setName(m_bright, "Bright"); + bgfx::setName(m_blur, "Blur"); + m_lumBgra8 = 0; if ( (BGFX_CAPS_TEXTURE_BLIT|BGFX_CAPS_TEXTURE_READ_BACK) == (bgfx::getCaps()->supported & (BGFX_CAPS_TEXTURE_BLIT|BGFX_CAPS_TEXTURE_READ_BACK) ) ) { m_rb = bgfx::createTexture2D(1, 1, false, 1, bgfx::TextureFormat::BGRA8, BGFX_TEXTURE_BLIT_DST|BGFX_TEXTURE_READ_BACK); + bgfx::setName(m_rb, "Read Back Texture"); } else { @@ -372,7 +382,9 @@ public: float exponent = arr.bgra[3] / 255.0f * 255.0f - 128.0f; float lumAvg = arr.bgra[2] / 255.0f * bx::exp2(exponent); + ImGui::BeginDisabled(true); ImGui::SliderFloat("Lum Avg", &lumAvg, 0.0f, 1.0f); + ImGui::EndDisabled(); } const bgfx::Caps* caps = bgfx::getCaps(); diff --git a/tools/geometryc/geometryc.cpp b/tools/geometryc/geometryc.cpp index d79a80e96..78890cabe 100644 --- a/tools/geometryc/geometryc.cpp +++ b/tools/geometryc/geometryc.cpp @@ -1076,7 +1076,7 @@ int main(int _argc, const char* _argv[]) delete [] data; - int64_t now = bx::getHPCounter(); + const int64_t now = bx::getHPCounter(); parseElapsed += now; int64_t convertElapsed = -now; @@ -1443,8 +1443,7 @@ int main(int _argc, const char* _argv[]) delete [] indexData; delete [] vertexData; - now = bx::getHPCounter(); - convertElapsed += now; + convertElapsed += bx::getHPCounter(); bx::printf("parse %f [s]\ntri reorder %f [s]\nconvert %f [s]\ng %d, p %d, v %d, i %d\n" , double(parseElapsed)/bx::getHPFrequency() diff --git a/tools/geometryv/geometryv.cpp b/tools/geometryv/geometryv.cpp index 2286823ae..250f483e5 100644 --- a/tools/geometryv/geometryv.cpp +++ b/tools/geometryv/geometryv.cpp @@ -621,7 +621,7 @@ struct InterpolatorT if (isActive() ) { const double freq = double(bx::getHPFrequency() ); - int64_t now = bx::getHPCounter(); + const int64_t now = bx::getHPCounter(); float time = (float)(double(now - offset) / freq); float lerp = bx::clamp(time, 0.0f, duration) / duration; return lerpT(from, to, easeT(lerp) ); @@ -633,7 +633,7 @@ struct InterpolatorT bool isActive() const { const double freq = double(bx::getHPFrequency() ); - int64_t now = bx::getHPCounter(); + const int64_t now = bx::getHPCounter(); float time = (float)(double(now - offset) / freq); float lerp = bx::clamp(time, 0.0f, duration) / duration; return lerp < 1.0f; @@ -1249,7 +1249,7 @@ int _main_(int _argc, char** _argv) entry::setWindowTitle(entry::kDefaultWindowHandle, title.c_str() ); } - int64_t now = bx::getHPCounter(); + const int64_t now = bx::getHPCounter(); static int64_t last = now; const int64_t frameTime = now - last; last = now; diff --git a/tools/texturev/texturev.cpp b/tools/texturev/texturev.cpp index f96c1841b..26380ff86 100644 --- a/tools/texturev/texturev.cpp +++ b/tools/texturev/texturev.cpp @@ -484,7 +484,7 @@ struct View { if (_argc >= 3) { - int8_t axis = bx::clamp(bx::toLower(_argv[2][0]) - 'x', 0, 2); + int8_t axis = bx::clamp(bx::toLower(_argv[2][0]) - 'x', 0, 2); float angle; bx::fromString(&angle, _argv[3]); @@ -1122,7 +1122,7 @@ struct InterpolatorT if (isActive() ) { const double freq = double(bx::getHPFrequency() ); - int64_t now = bx::getHPCounter(); + const int64_t now = bx::getHPCounter(); float time = (float)(double(now - offset) / freq); float lerp = duration != 0.0f ? bx::clamp(time, 0.0f, duration) / duration : 0.0f; return lerpT(from, to, easeT(lerp) ); @@ -1136,7 +1136,7 @@ struct InterpolatorT if (0.0f < duration) { const double freq = double(bx::getHPFrequency() ); - int64_t now = bx::getHPCounter(); + const int64_t now = bx::getHPCounter(); float time = (float)(double(now - offset) / freq); float lerp = bx::clamp(time, 0.0f, duration) / duration; return lerp < 1.0f; @@ -2120,7 +2120,7 @@ int _main_(int _argc, char** _argv) entry::setWindowTitle(entry::kDefaultWindowHandle, title.c_str() ); } - int64_t now = bx::getHPCounter(); + const int64_t now = bx::getHPCounter(); static int64_t last = now; const int64_t frameTime = now - last; last = now;