From dbb83d25254e5b7319ba92d118e519751e6e1d25 Mon Sep 17 00:00:00 2001 From: Cedric Guillemet Date: Mon, 16 Mar 2020 11:03:17 +0100 Subject: [PATCH] PR feedback --- bindings/d/types.d | 2 +- examples/common/bgfx_utils.cpp | 4 ++-- include/bgfx/defines.h | 2 +- scripts/bgfx.idl | 2 +- src/bgfx.cpp | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/bindings/d/types.d b/bindings/d/types.d index 193d15268..52551f481 100644 --- a/bindings/d/types.d +++ b/bindings/d/types.d @@ -10,7 +10,7 @@ public import core.stdc.stdarg : va_list; extern(C) @nogc nothrow: -enum uint BGFX_API_VERSION = 103; +enum uint BGFX_API_VERSION = 104; alias bgfx_view_id_t = ushort; diff --git a/examples/common/bgfx_utils.cpp b/examples/common/bgfx_utils.cpp index 203ffef1c..d605da73c 100644 --- a/examples/common/bgfx_utils.cpp +++ b/examples/common/bgfx_utils.cpp @@ -592,7 +592,7 @@ void Mesh::submit(bgfx::ViewId _id, bgfx::ProgramHandle _program, const float* _ bgfx::setIndexBuffer(group.m_ibh); bgfx::setVertexBuffer(0, group.m_vbh); - bgfx::submit(_id, _program, 0, (it == itEnd-1)?BGFX_DISCARD_ALL:BGFX_DISCARD_NONE); + bgfx::submit(_id, _program, 0, (it == itEnd-1) ? (BGFX_DISCARD_INDEX_BUFFER | BGFX_DISCARD_VERTEX_STREAMS | BGFX_DISCARD_STATE) : BGFX_DISCARD_NONE); } } @@ -623,7 +623,7 @@ void Mesh::submit(const MeshState*const* _state, uint8_t _numPasses, const float bgfx::setIndexBuffer(group.m_ibh); bgfx::setVertexBuffer(0, group.m_vbh); - bgfx::submit(state.m_viewId, state.m_program, 0, (it == itEnd - 1) ? BGFX_DISCARD_ALL : BGFX_DISCARD_NONE); + bgfx::submit(state.m_viewId, state.m_program, 0, (it == itEnd - 1) ? (BGFX_DISCARD_INDEX_BUFFER | BGFX_DISCARD_VERTEX_STREAMS | BGFX_DISCARD_STATE) : BGFX_DISCARD_NONE); } } } diff --git a/include/bgfx/defines.h b/include/bgfx/defines.h index f5c7d038d..303bdff7c 100644 --- a/include/bgfx/defines.h +++ b/include/bgfx/defines.h @@ -15,7 +15,7 @@ #ifndef BGFX_DEFINES_H_HEADER_GUARD #define BGFX_DEFINES_H_HEADER_GUARD -#define BGFX_API_VERSION UINT32_C(103) +#define BGFX_API_VERSION UINT32_C(104) /** * Color RGB/alpha/depth write. When it's not specified write will be disabled. diff --git a/scripts/bgfx.idl b/scripts/bgfx.idl index ffd6af686..f8e56652c 100644 --- a/scripts/bgfx.idl +++ b/scripts/bgfx.idl @@ -1,7 +1,7 @@ -- vim: syntax=lua -- bgfx interface -version(103) +version(104) typedef "bool" typedef "char" diff --git a/src/bgfx.cpp b/src/bgfx.cpp index f3fd1e62e..900171f4d 100644 --- a/src/bgfx.cpp +++ b/src/bgfx.cpp @@ -1194,7 +1194,7 @@ namespace bgfx void EncoderImpl::submit(ViewId _id, ProgramHandle _program, OcclusionQueryHandle _occlusionQuery, uint32_t _depth, uint8_t _flags) { if (BX_ENABLED(BGFX_CONFIG_DEBUG_UNIFORM) - && (_flags == BGFX_DISCARD_ALL)) + && (_flags & BGFX_DISCARD_STATE)) { m_uniformSet.clear(); } @@ -1293,7 +1293,7 @@ namespace bgfx m_draw.clear(_flags); m_bind.clear(_flags); - if (_flags == BGFX_DISCARD_ALL) + if (_flags & BGFX_DISCARD_STATE) { m_uniformBegin = m_uniformEnd; }