From 96a1d0859baa1cb89ca1cb06fc08fd3be9a4989c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Wed, 11 Oct 2017 09:16:59 -0700 Subject: [PATCH 1/3] Cleanup. --- src/bgfx_p.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/bgfx_p.h b/src/bgfx_p.h index c6da01901..9d6b4748e 100644 --- a/src/bgfx_p.h +++ b/src/bgfx_p.h @@ -139,11 +139,6 @@ namespace bgfx #if BGFX_CONFIG_USE_TINYSTL namespace bgfx { - inline bool isValid(const VertexDecl& _decl) - { - return 0 != _decl.m_stride; - } - struct TinyStlAllocator { static void* static_allocate(size_t _bytes); @@ -275,6 +270,11 @@ namespace bgfx return handle; } + inline bool isValid(const VertexDecl& _decl) + { + return 0 != _decl.m_stride; + } + struct Clear { uint8_t m_index[8]; From 3c94fa9a657f99fe2d80a9985adad36180afd0f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Wed, 11 Oct 2017 15:25:58 -0700 Subject: [PATCH 2/3] Set default shader debug name for embedded shaders. --- src/bgfx.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/bgfx.cpp b/src/bgfx.cpp index 16fd5f52f..33056d358 100644 --- a/src/bgfx.cpp +++ b/src/bgfx.cpp @@ -472,7 +472,13 @@ namespace bgfx if (_type == esd->type && 1 < esd->size) { - return createShader(makeRef(esd->data, esd->size) ); + ShaderHandle handle = createShader(makeRef(esd->data, esd->size) ); + if (isValid(handle) ) + { + setName(handle, _name); + } + + return handle; } } } From 1c7f8a351246f1eb9f5d3586db1d978ff7e01a4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Wed, 11 Oct 2017 16:24:03 -0700 Subject: [PATCH 3/3] Cleanup. --- include/bgfx/bgfx.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/include/bgfx/bgfx.h b/include/bgfx/bgfx.h index 00781ff34..5dbf41cde 100644 --- a/include/bgfx/bgfx.h +++ b/include/bgfx/bgfx.h @@ -788,14 +788,14 @@ namespace bgfx /// struct Stats { - int64_t cpuTimeFrame; //!< CPU time between two `bgfx::frame` calls. - int64_t cpuTimeBegin; //!< Render thread CPU submit begin time. - int64_t cpuTimeEnd; //!< Render thread CPU submit end time. - int64_t cpuTimerFreq; //!< CPU timer frequency. + int64_t cpuTimeFrame; //!< CPU time between two `bgfx::frame` calls. + int64_t cpuTimeBegin; //!< Render thread CPU submit begin time. + int64_t cpuTimeEnd; //!< Render thread CPU submit end time. + int64_t cpuTimerFreq; //!< CPU timer frequency. - int64_t gpuTimeBegin; //!< GPU frame begin time. - int64_t gpuTimeEnd; //!< GPU frame end time. - int64_t gpuTimerFreq; //!< GPU timer frequency. + int64_t gpuTimeBegin; //!< GPU frame begin time. + int64_t gpuTimeEnd; //!< GPU frame end time. + int64_t gpuTimerFreq; //!< GPU timer frequency. int64_t waitRender; //!< Time spent waiting for render backend thread to finish issuing //! draw commands to underlying graphics API. @@ -805,8 +805,8 @@ namespace bgfx uint32_t numCompute; //!< Number of compute calls submitted. uint32_t maxGpuLatency; //!< GPU driver latency. - int64_t gpuMemoryMax; //!< Maximum available GPU memory. - int64_t gpuMemoryUsed; //!< Available GPU memory. + int64_t gpuMemoryMax; //!< Maximum available GPU memory for application. + int64_t gpuMemoryUsed; //!< Amount of GPU memory used. uint16_t width; //!< Backbuffer width in pixels. uint16_t height; //!< Backbuffer height in pixels.