From 48074e3eeb24bde38c873b01b2accfc924be6d1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Wed, 14 Nov 2018 20:01:51 -0800 Subject: [PATCH] Cleanup. --- examples/24-nbody/nbody.cpp | 4 ++-- makefile | 13 ------------- src/bgfx.cpp | 2 +- src/renderer_d3d12.cpp | 6 +++--- src/topology.cpp | 6 +++--- 5 files changed, 9 insertions(+), 22 deletions(-) diff --git a/examples/24-nbody/nbody.cpp b/examples/24-nbody/nbody.cpp index 34bb0691d..ae675c355 100644 --- a/examples/24-nbody/nbody.cpp +++ b/examples/24-nbody/nbody.cpp @@ -365,8 +365,8 @@ public: bgfx::dispatch(0, m_updateInstancesProgram, uint16_t(m_paramsData.dispatchSize), 1, 1); } - bx::xchg(m_currPositionBuffer0, m_currPositionBuffer1); - bx::xchg(m_prevPositionBuffer0, m_prevPositionBuffer1); + bx::swap(m_currPositionBuffer0, m_currPositionBuffer1); + bx::swap(m_prevPositionBuffer0, m_prevPositionBuffer1); // Update camera. cameraUpdate(deltaTime, m_mouseState); diff --git a/makefile b/makefile index 062f0c75b..2bb0cef3e 100644 --- a/makefile +++ b/makefile @@ -39,7 +39,6 @@ clean: ## Clean all intermediate files. @mkdir .build projgen: ## Generate project files for all configurations. - $(GENIE) --with-tools --with-combined-examples --with-shared-lib vs2015 $(GENIE) --with-tools --with-combined-examples --with-shared-lib vs2017 $(GENIE) --with-tools --with-combined-examples --vs=winstore100 vs2017 $(GENIE) --with-tools --with-combined-examples --with-shared-lib --gcc=mingw-gcc gmake @@ -125,18 +124,6 @@ mingw-clang-release64: .build/projects/gmake-mingw-clang ## Build - MinGW Clang $(MAKE) -R -C .build/projects/gmake-mingw-clang config=release64 mingw-clang: mingw-clang-debug32 mingw-clang-release32 mingw-clang-debug64 mingw-clang-release64 ## Build - MinGW Clang x86/x64 Debug and Release -.build/projects/vs2015: - $(GENIE) --with-tools --with-combined-examples --with-shared-lib vs2015 -vs2015-debug32: .build/projects/vs2015 ## Build - VS2015 x86 Debug - devenv .build/projects/vs2015/bgfx.sln /Build "Debug|Win32" -vs2015-release32: .build/projects/vs2015 ## Build - VS2015 x86 Release - devenv .build/projects/vs2015/bgfx.sln /Build "Release|Win32" -vs2015-debug64: .build/projects/vs2015 ## Build - VS2015 x64 Debug - devenv .build/projects/vs2015/bgfx.sln /Build "Debug|x64" -vs2015-release64: .build/projects/vs2015 ## Build - VS2015 x64 Release - devenv .build/projects/vs2015/bgfx.sln /Build "Release|x64" -vs2015: vs2015-debug32 vs2015-release32 vs2015-debug64 vs2015-release64 ## Build - VS2015 x86/x64 Debug and Release - .build/projects/vs2017: $(GENIE) --with-tools --with-combined-examples --with-shared-lib vs2017 vs2017-debug32: .build/projects/vs2017 ## Build - vs2017 x86 Debug diff --git a/src/bgfx.cpp b/src/bgfx.cpp index 9373a8097..a632b8c4d 100644 --- a/src/bgfx.cpp +++ b/src/bgfx.cpp @@ -2097,7 +2097,7 @@ namespace bgfx m_submit->finish(); - bx::xchg(m_render, m_submit); + bx::swap(m_render, m_submit); bx::memCopy(m_render->m_occlusion, m_submit->m_occlusion, sizeof(m_submit->m_occlusion) ); diff --git a/src/renderer_d3d12.cpp b/src/renderer_d3d12.cpp index cfec9a21c..d6dc1cd67 100644 --- a/src/renderer_d3d12.cpp +++ b/src/renderer_d3d12.cpp @@ -4354,7 +4354,7 @@ namespace bgfx { namespace d3d12 , _state ); - bx::xchg(m_state, _state); + bx::swap(m_state, _state); } return _state; @@ -4955,7 +4955,7 @@ namespace bgfx { namespace d3d12 , _state ); - bx::xchg(m_state, _state); + bx::swap(m_state, _state); } return _state; @@ -5287,7 +5287,7 @@ namespace bgfx { namespace d3d12 DX_RELEASE(colorBuffer, 0); - bx::xchg(m_state, _state); + bx::swap(m_state, _state); } return _state; diff --git a/src/topology.cpp b/src/topology.cpp index 52dd572ec..1a3e8b6f6 100644 --- a/src/topology.cpp +++ b/src/topology.cpp @@ -78,9 +78,9 @@ namespace bgfx const IndexT* tri = &_indices[ii]; IndexT i0 = tri[0], i1 = tri[1], i2 = tri[2]; - if (i0 > i1) { bx::xchg(i0, i1); } - if (i1 > i2) { bx::xchg(i1, i2); } - if (i0 > i1) { bx::xchg(i0, i1); } + if (i0 > i1) { bx::swap(i0, i1); } + if (i1 > i2) { bx::swap(i1, i2); } + if (i0 > i1) { bx::swap(i0, i1); } BX_CHECK(i0 < i1 && i1 < i2, ""); dst[1] = i0; dst[0] = i1;