summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/bx
diff options
context:
space:
mode:
author Branimir Karadžić <branimirkaradzic@gmail.com>2016-03-20 16:48:03 +0100
committer Miodrag Milanovic <mmicko@gmail.com>2016-03-20 16:50:14 +0100
commitfae7a2c486127fe74ee027429312cc29e350b8ef (patch)
treea78646513eea09779b2c2911231bfa68652e485f /3rdparty/bx
parent3a60b4bb7a19f1987745d3302f1b330d12d48d25 (diff)
Update to latest BGFX and BX(nw)
Diffstat (limited to '3rdparty/bx')
-rw-r--r--3rdparty/bx/include/bx/float4_ni.h20
-rw-r--r--3rdparty/bx/include/bx/maputil.h29
-rw-r--r--3rdparty/bx/include/bx/os.h6
-rw-r--r--3rdparty/bx/include/bx/readerwriter.h21
-rw-r--r--3rdparty/bx/include/tinystl/hash_base.h3
-rw-r--r--3rdparty/bx/scripts/toolchain.lua12
-rw-r--r--3rdparty/bx/tests/float4_t.cpp27
-rw-r--r--3rdparty/bx/tools/bin/darwin/geniebin422176 -> 422176 bytes
-rw-r--r--3rdparty/bx/tools/bin/linux/geniebin396856 -> 396856 bytes
-rw-r--r--3rdparty/bx/tools/bin/windows/genie.exebin403456 -> 403456 bytes
10 files changed, 104 insertions, 14 deletions
diff --git a/3rdparty/bx/include/bx/float4_ni.h b/3rdparty/bx/include/bx/float4_ni.h
index e85c1cd9117..644fa6eb386 100644
--- a/3rdparty/bx/include/bx/float4_ni.h
+++ b/3rdparty/bx/include/bx/float4_ni.h
@@ -177,16 +177,30 @@ namespace bx
{
const float4_t half = float4_splat(0.5f);
const float4_t one = float4_splat(1.0f);
- const float4_t zero = float4_zero();
const float4_t tmp0 = float4_rsqrt_est(_a);
- const float4_t tmp1 = float4_madd(tmp0, _a, zero);
- const float4_t tmp2 = float4_madd(tmp1, half, zero);
+ const float4_t tmp1 = float4_mul(tmp0, _a);
+ const float4_t tmp2 = float4_mul(tmp1, half);
const float4_t tmp3 = float4_nmsub(tmp0, tmp1, one);
const float4_t result = float4_madd(tmp3, tmp2, tmp1);
return result;
}
+ BX_FLOAT4_INLINE float4_t float4_sqrt_nr1_ni(float4_t _a)
+ {
+ const float4_t half = float4_splat(0.5f);
+
+ float4_t result = _a;
+ for (uint32_t ii = 0; ii < 11; ++ii)
+ {
+ const float4_t tmp1 = float4_div(_a, result);
+ const float4_t tmp2 = float4_add(tmp1, result);
+ result = float4_mul(tmp2, half);
+ }
+
+ return result;
+ }
+
BX_FLOAT4_INLINE float4_t float4_rsqrt_ni(float4_t _a)
{
const float4_t one = float4_splat(1.0f);
diff --git a/3rdparty/bx/include/bx/maputil.h b/3rdparty/bx/include/bx/maputil.h
index f334aeff0ce..21e6067043d 100644
--- a/3rdparty/bx/include/bx/maputil.h
+++ b/3rdparty/bx/include/bx/maputil.h
@@ -24,6 +24,35 @@ namespace bx
typename MapType::value_type pair(_key, _value);
return _map.insert(it, pair);
}
+
+ template<typename MapType>
+ bool mapRemove(MapType& _map, const typename MapType::value_type::first_type& _first)
+ {
+ typename MapType::const_iterator it = _map.find(_first);
+ if (it != _map.end() )
+ {
+ _map.erase(it);
+ return true;
+ }
+
+ return false;
+ }
+
+ template<typename MapType>
+ bool mapRemove(MapType& _map, const typename MapType::value_type::second_type& _second)
+ {
+ for (typename MapType::const_iterator it = _map.begin(), itEnd = _map.end(); it != itEnd; ++it)
+ {
+ if (it->second == _second)
+ {
+ _map.erase(it);
+ return true;
+ }
+ }
+
+ return false;
+ }
+
} // namespace bx
#endif // BX_MAPUTIL_H_HEADER_GUARD
diff --git a/3rdparty/bx/include/bx/os.h b/3rdparty/bx/include/bx/os.h
index 314ef0607cc..db9113979f8 100644
--- a/3rdparty/bx/include/bx/os.h
+++ b/3rdparty/bx/include/bx/os.h
@@ -136,7 +136,7 @@ namespace bx
: 0
;
#elif BX_PLATFORM_OSX
-#ifdef MACH_TASK_BASIC_INFO
+# if defined(MACH_TASK_BASIC_INFO)
mach_task_basic_info info;
mach_msg_type_number_t infoCount = MACH_TASK_BASIC_INFO_COUNT;
@@ -145,7 +145,7 @@ namespace bx
, (task_info_t)&info
, &infoCount
);
-#else // MACH_TASK_BASIC_INFO
+# else // MACH_TASK_BASIC_INFO
task_basic_info info;
mach_msg_type_number_t infoCount = TASK_BASIC_INFO_COUNT;
@@ -154,7 +154,7 @@ namespace bx
, (task_info_t)&info
, &infoCount
);
-#endif // MACH_TASK_BASIC_INFO
+# endif // MACH_TASK_BASIC_INFO
if (KERN_SUCCESS != result)
{
return 0;
diff --git a/3rdparty/bx/include/bx/readerwriter.h b/3rdparty/bx/include/bx/readerwriter.h
index 13fe205399e..245d158e742 100644
--- a/3rdparty/bx/include/bx/readerwriter.h
+++ b/3rdparty/bx/include/bx/readerwriter.h
@@ -77,7 +77,7 @@ namespace bx
return _reader->read(_data, _size, _err);
}
- /// Write value.
+ /// Read value.
template<typename Ty>
inline int32_t read(ReaderI* _reader, Ty& _value, Error* _err = NULL)
{
@@ -207,6 +207,25 @@ namespace bx
{
};
+ /// Peek data.
+ inline int32_t peek(ReaderSeekerI* _reader, void* _data, int32_t _size, Error* _err = NULL)
+ {
+ BX_ERROR_SCOPE(_err);
+ int64_t offset = bx::seek(_reader);
+ int32_t size = _reader->read(_data, _size, _err);
+ bx::seek(_reader, offset, bx::Whence::Begin);
+ return size;
+ }
+
+ /// Peek value.
+ template<typename Ty>
+ inline int32_t peek(ReaderSeekerI* _reader, Ty& _value, Error* _err = NULL)
+ {
+ BX_ERROR_SCOPE(_err);
+ BX_STATIC_ASSERT(BX_TYPE_IS_POD(Ty) );
+ return peek(_reader, &_value, sizeof(Ty), _err);
+ }
+
struct BX_NO_VTABLE WriterSeekerI : public WriterI, public SeekerI
{
};
diff --git a/3rdparty/bx/include/tinystl/hash_base.h b/3rdparty/bx/include/tinystl/hash_base.h
index 73b5c9ebda8..f20675db486 100644
--- a/3rdparty/bx/include/tinystl/hash_base.h
+++ b/3rdparty/bx/include/tinystl/hash_base.h
@@ -33,6 +33,9 @@ namespace tinystl {
template<typename Key, typename Value>
struct pair {
+ typedef Key first_type;
+ typedef Value second_type;
+
pair();
pair(const Key& key, const Value& value);
diff --git a/3rdparty/bx/scripts/toolchain.lua b/3rdparty/bx/scripts/toolchain.lua
index 0cabfae5a9d..e87e5f3b236 100644
--- a/3rdparty/bx/scripts/toolchain.lua
+++ b/3rdparty/bx/scripts/toolchain.lua
@@ -47,6 +47,7 @@ function toolchain(_buildDir, _libDir)
allowed = {
{ "vs2012-clang", "Clang 3.6" },
{ "vs2013-clang", "Clang 3.6" },
+ { "vs2015-clang", "Clang 3.9" },
{ "vs2012-xp", "Visual Studio 2012 targeting XP" },
{ "vs2013-xp", "Visual Studio 2013 targeting XP" },
{ "vs2015-xp", "Visual Studio 2015 targeting XP" },
@@ -339,7 +340,11 @@ function toolchain(_buildDir, _libDir)
elseif _ACTION == "vs2012" or _ACTION == "vs2013" or _ACTION == "vs2015" then
if (_ACTION .. "-clang") == _OPTIONS["vs"] then
- premake.vstudio.toolset = ("LLVM-" .. _ACTION)
+ if "vs2015-clang" == _OPTIONS["vs"] then
+ premake.vstudio.toolset = ("LLVM-vs2014")
+ else
+ premake.vstudio.toolset = ("LLVM-" .. _ACTION)
+ end
location (path.join(_buildDir, "projects", _ACTION .. "-clang"))
elseif "winphone8" == _OPTIONS["vs"] then
@@ -746,10 +751,11 @@ function toolchain(_buildDir, _libDir)
objdir (path.join(_buildDir, "android-arm/obj"))
libdirs {
path.join(_libDir, "lib/android-arm"),
- "$(ANDROID_NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/4.8/libs/armeabi-v7a",
+ "$(ANDROID_NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a",
}
includedirs {
- "$(ANDROID_NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/4.8/libs/armeabi-v7a/include",
+ "$(ANDROID_NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a/include",
+ "$(ANDROID_NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/4.9/include",
}
buildoptions {
"--sysroot=" .. path.join("$(ANDROID_NDK_ROOT)/platforms", androidPlatform, "arch-arm"),
diff --git a/3rdparty/bx/tests/float4_t.cpp b/3rdparty/bx/tests/float4_t.cpp
index 9f39fcc9e48..3bdfb1976b1 100644
--- a/3rdparty/bx/tests/float4_t.cpp
+++ b/3rdparty/bx/tests/float4_t.cpp
@@ -5,6 +5,7 @@
#include "test.h"
#include <bx/float4_t.h>
+#include <bx/fpumath.h>
#include <string.h>
using namespace bx;
@@ -70,10 +71,10 @@ void float4_check_float(const char* _str, bx::float4_t _a, float _0, float _1, f
, _0, _1, _2, _3
);
- CHECK_EQUAL(c.f[0], _0);
- CHECK_EQUAL(c.f[1], _1);
- CHECK_EQUAL(c.f[2], _2);
- CHECK_EQUAL(c.f[3], _3);
+ CHECK(bx::fequal(c.f[0], _0, 0.0001f) );
+ CHECK(bx::fequal(c.f[1], _1, 0.0001f) );
+ CHECK(bx::fequal(c.f[2], _2, 0.0001f) );
+ CHECK(bx::fequal(c.f[3], _3, 0.0001f) );
}
void float4_check_string(const char* _str, bx::float4_t _a)
@@ -235,6 +236,24 @@ TEST(float4_arithmetic)
);
}
+TEST(float4_sqrt)
+{
+ float4_check_float("float4_sqrt"
+ , float4_sqrt(float4_ld(1.0f, 16.0f, 65536.0f, 123456.0f) )
+ , 1.0f, 4.0f, 256.0f, 351.363060096f
+ );
+
+ float4_check_float("float4_sqrt_nr_ni"
+ , float4_sqrt_nr_ni(float4_ld(1.0f, 16.0f, 65536.0f, 123456.0f) )
+ , 1.0f, 4.0f, 256.0f, 351.363060096f
+ );
+
+ float4_check_float("float4_sqrt_nr1_ni"
+ , float4_sqrt_nr1_ni(float4_ld(1.0f, 16.0f, 65536.0f, 123456.0f) )
+ , 1.0f, 4.0f, 256.0f, 351.363060096f
+ );
+}
+
TEST(float4)
{
const float4_t isplat = float4_isplat(0x80000001);
diff --git a/3rdparty/bx/tools/bin/darwin/genie b/3rdparty/bx/tools/bin/darwin/genie
index 9113b07986b..d938ff91dc5 100644
--- a/3rdparty/bx/tools/bin/darwin/genie
+++ b/3rdparty/bx/tools/bin/darwin/genie
Binary files differ
diff --git a/3rdparty/bx/tools/bin/linux/genie b/3rdparty/bx/tools/bin/linux/genie
index c7be887f7d6..1487e071d06 100644
--- a/3rdparty/bx/tools/bin/linux/genie
+++ b/3rdparty/bx/tools/bin/linux/genie
Binary files differ
diff --git a/3rdparty/bx/tools/bin/windows/genie.exe b/3rdparty/bx/tools/bin/windows/genie.exe
index fb46691d96f..232485d34fd 100644
--- a/3rdparty/bx/tools/bin/windows/genie.exe
+++ b/3rdparty/bx/tools/bin/windows/genie.exe
Binary files differ