Skip to content

Commit

Permalink
Updated Oculus SDK to 39.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
BastiaanOlij committed May 20, 2022
1 parent bb6d274 commit a605199
Show file tree
Hide file tree
Showing 83 changed files with 5,555 additions and 428 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ inline const char* GetCurrentThreadName(char threadName[MAX_THREAD_NAME_LEN]) {
return &threadName[0];
}

#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wvla-extension"
#endif // __clang__

inline bool
Error(const char* mutexName, const char* fileName, const int32_t lineNumber, const char* fmt, ...) {
va_list argPtr;
Expand All @@ -91,6 +96,10 @@ Error(const char* mutexName, const char* fileName, const int32_t lineNumber, con
return false;
}

#ifdef __clang__
#pragma clang diagnostic pop
#endif // __clang__

// DJB2 string hash function to generate a continuous hash from a string and an a value type
template <typename type_>
static uint64_t GenHash(const char* str1, const type_ value) {
Expand Down
6 changes: 3 additions & 3 deletions thirdparty/oculus_mobile_sdk/1stParty/OVR/Include/OVR_JSON.h
Original file line number Diff line number Diff line change
Expand Up @@ -877,15 +877,15 @@ class JSON {
case 4:
*--ptr2 = static_cast<char>((uc | 0x80) & 0xBF);
uc >>= 6;
// no break, fall through
[[fallthrough]];
case 3:
*--ptr2 = static_cast<char>((uc | 0x80) & 0xBF);
uc >>= 6;
// no break
[[fallthrough]];
case 2:
*--ptr2 = static_cast<char>((uc | 0x80) & 0xBF);
uc >>= 6;
// no break
[[fallthrough]];
case 1:
*--ptr2 = (char)(uc | firstByteMark[len]);
// no break
Expand Down
42 changes: 26 additions & 16 deletions thirdparty/oculus_mobile_sdk/1stParty/OVR/Include/OVR_LogUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ inline void LogWithFileTag(const int prio, const char* fileTag, const char* fmt,
#define OVR_FAIL(...) \
{ \
LogWithFileTag(0, __FILE__, __VA_ARGS__); \
exit(0); \
abort(); \
}
#define OVR_LOG_WITH_TAG(__tag__, ...) LogWithTag(0, __FILE__, __VA_ARGS__)
#define OVR_ASSERT_WITH_TAG(__expr__, __tag__)
Expand Down Expand Up @@ -262,22 +262,32 @@ inline void LogWithFileTag(const int prio, const char* fileTag, const char* fmt,
#endif

#elif defined(OVR_OS_MAC) || defined(OVR_OS_LINUX)

#define OVR_LOG(...) \
{}
#define OVR_WARN(...) \
{}
#define OVR_ERROR(...) \
{}
#define OVR_FAIL(...) \
{ \
; \
exit(0); \
#include <string>
#include <folly/logging/xlog.h>

// Helper that converts a printf-style format string to an std::string. Needed
// because the folly macros don't accept printf-style strings.
#define FORMAT_STR(...) \
([&] { \
size_t _buf_len = snprintf(nullptr, 0, __VA_ARGS__); \
std::string _format_str_result; \
_format_str_result.resize(_buf_len); \
snprintf(_format_str_result.data(), _buf_len + 1, __VA_ARGS__); \
return _format_str_result; \
}())

#define OVR_LOG(...) XLOG(INFO, FORMAT_STR(__VA_ARGS__))
#define OVR_WARN(...) XLOG(WARN, FORMAT_STR(__VA_ARGS__))
#define OVR_ERROR(...) XLOG(ERR, FORMAT_STR(__VA_ARGS__))
#define OVR_FAIL(...) XLOG(FATAL, FORMAT_STR(__VA_ARGS__))
#define OVR_LOG_WITH_TAG(__tag__, ...) OVR_LOG(__VA_ARGS__)
#define OVR_ASSERT_WITH_TAG(__expr__, __tag__) \
{ \
if (!(__expr__)) { \
OVR_FAIL("ASSERTION FAILED: %s", #__expr__); \
} \
}
#define OVR_LOG_WITH_TAG(__tag__, ...) \
{}
#define OVR_ASSERT_WITH_TAG(__expr__, __tag__) \
{}

#else
#error "unknown platform"
#endif
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// Facebook Technologies, LLC Proprietary and Confidential.

#include <OVR_LogUtils.h>

#include <gtest/gtest.h>

namespace OVR {
namespace {

TEST(LogUtilsTest, FatalTest) {
EXPECT_DEATH(OVR_FAIL("death message"), "death message");
}

} // namespace
} // namespace OVR
20 changes: 20 additions & 0 deletions thirdparty/oculus_mobile_sdk/3rdParty/khronos/ktx/README.meta
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Summary

This is a pre-built KTX library built from a version (refer: ktx.gitversion) of the Khronos KTX Repo

- The original is hosted at https://github.com/KhronosGroup/KTX-Software

# Updating

### How to update

1. Check out the source repo from the URL above
2. Make sure you have your local ANDROID_NDK path setup.
3. Your local machine needs to have Cmake, Ninja, and clang. (If you do not have Ninja or it does not work, you can remove this from the following build script)
4. Run ci_tools/build_android.sh - You may need to modify this script to manually input your ANDROID_NDK path
5. Move the newly built libktx.so, libktx_read.so, and libobjUtil.a files into lib/android/arm64-v8a
6. Replace include/ktx.h with the latest from github (if necessary)

### When to update

- Ideally we do not need to update this library, but if there are some crucial fixes or changes that are necessary, we can run these steps to update.
Loading

0 comments on commit a605199

Please sign in to comment.