From 738417190081e5e82917cd0a3af804180dbc9acf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Mon, 27 Nov 2017 15:57:31 -0800 Subject: [PATCH] Fixed view id remapping. --- examples/common/imgui/imgui.cpp | 6 +++--- examples/common/imgui/imgui.h | 2 +- src/bgfx_p.h | 4 ++-- tools/shaderc/shaderc.cpp | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/examples/common/imgui/imgui.cpp b/examples/common/imgui/imgui.cpp index c4aea85e2..514bd49bb 100644 --- a/examples/common/imgui/imgui.cpp +++ b/examples/common/imgui/imgui.cpp @@ -396,7 +396,7 @@ struct OcornutImguiContext , int _width , int _height , char _inputChar - , uint8_t _viewId + , bgfx::ViewId _viewId ) { m_viewId = _viewId; @@ -455,7 +455,7 @@ struct OcornutImguiContext ImFont* m_font[ImGui::Font::Count]; int64_t m_last; int32_t m_lastScroll; - uint8_t m_viewId; + bgfx::ViewId m_viewId; }; static OcornutImguiContext s_ctx; @@ -485,7 +485,7 @@ void imguiDestroy() s_ctx.destroy(); } -void imguiBeginFrame(int32_t _mx, int32_t _my, uint8_t _button, int32_t _scroll, uint16_t _width, uint16_t _height, char _inputChar, uint8_t _viewId) +void imguiBeginFrame(int32_t _mx, int32_t _my, uint8_t _button, int32_t _scroll, uint16_t _width, uint16_t _height, char _inputChar, bgfx::ViewId _viewId) { s_ctx.beginFrame(_mx, _my, _button, _scroll, _width, _height, _inputChar, _viewId); } diff --git a/examples/common/imgui/imgui.h b/examples/common/imgui/imgui.h index cca353683..20ef5b016 100644 --- a/examples/common/imgui/imgui.h +++ b/examples/common/imgui/imgui.h @@ -30,7 +30,7 @@ namespace bx { struct AllocatorI; } void imguiCreate(float _fontSize = 18.0f, bx::AllocatorI* _allocator = NULL); void imguiDestroy(); -void imguiBeginFrame(int32_t _mx, int32_t _my, uint8_t _button, int32_t _scroll, uint16_t _width, uint16_t _height, char _inputChar = 0, uint8_t _view = 255); +void imguiBeginFrame(int32_t _mx, int32_t _my, uint8_t _button, int32_t _scroll, uint16_t _width, uint16_t _height, char _inputChar = 0, bgfx::ViewId _view = 255); void imguiEndFrame(); namespace entry { class AppI; } diff --git a/src/bgfx_p.h b/src/bgfx_p.h index ab1340c93..c388f4646 100644 --- a/src/bgfx_p.h +++ b/src/bgfx_p.h @@ -996,7 +996,7 @@ namespace bgfx } /// Returns true if item is compute command. - bool decode(uint64_t _key, uint8_t _viewRemap[BGFX_CONFIG_MAX_VIEWS]) + bool decode(uint64_t _key, ViewId _viewRemap[BGFX_CONFIG_MAX_VIEWS]) { m_view = _viewRemap[(_key & SORT_KEY_VIEW_MASK) >> SORT_KEY_VIEW_SHIFT]; if (_key & SORT_KEY_DRAW_BIT) @@ -1865,7 +1865,7 @@ namespace bgfx m_freeUniform.reset(); } - uint8_t m_viewRemap[BGFX_CONFIG_MAX_VIEWS]; + ViewId m_viewRemap[BGFX_CONFIG_MAX_VIEWS]; float m_colorPalette[BGFX_CONFIG_MAX_COLOR_PALETTE][4]; View m_view[BGFX_CONFIG_MAX_VIEWS]; diff --git a/tools/shaderc/shaderc.cpp b/tools/shaderc/shaderc.cpp index c99a5e4e5..f8d22df4f 100644 --- a/tools/shaderc/shaderc.cpp +++ b/tools/shaderc/shaderc.cpp @@ -18,7 +18,7 @@ extern "C" #define BGFX_CHUNK_MAGIC_VSH BX_MAKEFOURCC('V', 'S', 'H', 0x5) #define BGFX_SHADERC_VERSION_MAJOR 1 -#define BGFX_SHADERC_VERSION_MINOR 5 +#define BGFX_SHADERC_VERSION_MINOR 6 namespace bgfx { @@ -151,7 +151,7 @@ namespace bgfx BX_STATIC_ASSERT(BX_COUNTOF(s_uniformTypeName) == UniformType::Count*2); - Options::Options() + Options::Options() : shaderType(' ') , disasm(false) , raw(false)