Skip to content

Commit 72d32ca

Browse files
committed
Updated flatbuffers and submodules.
Updated glslang, SPIRV-Cross, and SPIRV-Tools to the latest versions. Updated the external flatbuffers includes and generated flatbuffer header to use the latest version. Incremented version to 1.4.6.
1 parent 5e5d152 commit 72d32ca

File tree

8 files changed

+713
-82
lines changed

8 files changed

+713
-82
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ endif()
6060

6161
set(MSL_MAJOR_VERSION 1)
6262
set(MSL_MINOR_VERSION 4)
63-
set(MSL_PATCH_VERSION 5)
63+
set(MSL_PATCH_VERSION 6)
6464
set(MSL_VERSION ${MSL_MAJOR_VERSION}.${MSL_MINOR_VERSION}.${MSL_PATCH_VERSION})
6565

6666
set(MSL_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})

Compile/SPIRV-Cross

Submodule SPIRV-Cross updated 244 files

Compile/SPIRV-Tools

Submodule SPIRV-Tools updated 410 files

Compile/glslang

Submodule glslang updated 185 files

Shared/external/flatbuffers/base.h

Lines changed: 51 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,17 @@
4646
#include <iterator>
4747
#include <memory>
4848

49+
#if defined(__unix__) && !defined(FLATBUFFERS_LOCALE_INDEPENDENT)
50+
#include <unistd.h>
51+
#endif
52+
4953
#ifdef _STLPORT_VERSION
5054
#define FLATBUFFERS_CPP98_STL
5155
#endif
52-
#ifndef FLATBUFFERS_CPP98_STL
53-
#include <functional>
54-
#endif
5556

56-
#include "flatbuffers/stl_emulation.h"
57+
#ifdef __ANDROID__
58+
#include <android/api-level.h>
59+
#endif
5760

5861
#if defined(__ICCARM__)
5962
#include <intrinsics.h>
@@ -139,8 +142,8 @@
139142
#endif
140143
#endif // !defined(FLATBUFFERS_LITTLEENDIAN)
141144

142-
#define FLATBUFFERS_VERSION_MAJOR 1
143-
#define FLATBUFFERS_VERSION_MINOR 12
145+
#define FLATBUFFERS_VERSION_MAJOR 2
146+
#define FLATBUFFERS_VERSION_MINOR 0
144147
#define FLATBUFFERS_VERSION_REVISION 0
145148
#define FLATBUFFERS_STRING_EXPAND(X) #X
146149
#define FLATBUFFERS_STRING(X) FLATBUFFERS_STRING_EXPAND(X)
@@ -154,24 +157,29 @@ namespace flatbuffers {
154157
defined(__clang__)
155158
#define FLATBUFFERS_FINAL_CLASS final
156159
#define FLATBUFFERS_OVERRIDE override
160+
#define FLATBUFFERS_EXPLICIT_CPP11 explicit
157161
#define FLATBUFFERS_VTABLE_UNDERLYING_TYPE : flatbuffers::voffset_t
158162
#else
159163
#define FLATBUFFERS_FINAL_CLASS
160164
#define FLATBUFFERS_OVERRIDE
165+
#define FLATBUFFERS_EXPLICIT_CPP11
161166
#define FLATBUFFERS_VTABLE_UNDERLYING_TYPE
162167
#endif
163168

164169
#if (!defined(_MSC_VER) || _MSC_VER >= 1900) && \
165170
(!defined(__GNUC__) || (__GNUC__ * 100 + __GNUC_MINOR__ >= 406)) || \
166171
(defined(__cpp_constexpr) && __cpp_constexpr >= 200704)
167172
#define FLATBUFFERS_CONSTEXPR constexpr
173+
#define FLATBUFFERS_CONSTEXPR_CPP11 constexpr
174+
#define FLATBUFFERS_CONSTEXPR_DEFINED
168175
#else
169176
#define FLATBUFFERS_CONSTEXPR const
177+
#define FLATBUFFERS_CONSTEXPR_CPP11
170178
#endif
171179

172180
#if (defined(__cplusplus) && __cplusplus >= 201402L) || \
173181
(defined(__cpp_constexpr) && __cpp_constexpr >= 201304)
174-
#define FLATBUFFERS_CONSTEXPR_CPP14 FLATBUFFERS_CONSTEXPR
182+
#define FLATBUFFERS_CONSTEXPR_CPP14 FLATBUFFERS_CONSTEXPR_CPP11
175183
#else
176184
#define FLATBUFFERS_CONSTEXPR_CPP14
177185
#endif
@@ -189,9 +197,25 @@ namespace flatbuffers {
189197
#if (!defined(_MSC_VER) || _MSC_FULL_VER >= 180020827) && \
190198
(!defined(__GNUC__) || (__GNUC__ * 100 + __GNUC_MINOR__ >= 404)) || \
191199
defined(__clang__)
192-
#define FLATBUFFERS_DELETE_FUNC(func) func = delete;
200+
#define FLATBUFFERS_DELETE_FUNC(func) func = delete
193201
#else
194-
#define FLATBUFFERS_DELETE_FUNC(func) private: func;
202+
#define FLATBUFFERS_DELETE_FUNC(func) private: func
203+
#endif
204+
205+
#if (!defined(_MSC_VER) || _MSC_VER >= 1900) && \
206+
(!defined(__GNUC__) || (__GNUC__ * 100 + __GNUC_MINOR__ >= 409)) || \
207+
defined(__clang__)
208+
#define FLATBUFFERS_DEFAULT_DECLARATION
209+
#endif
210+
211+
// Check if we can use template aliases
212+
// Not possible if Microsoft Compiler before 2012
213+
// Possible is the language feature __cpp_alias_templates is defined well
214+
// Or possible if the C++ std is C+11 or newer
215+
#if (defined(_MSC_VER) && _MSC_VER > 1700 /* MSVC2012 */) \
216+
|| (defined(__cpp_alias_templates) && __cpp_alias_templates >= 200704) \
217+
|| (defined(__cplusplus) && __cplusplus >= 201103L)
218+
#define FLATBUFFERS_TEMPLATES_ALIASES
195219
#endif
196220

197221
#ifndef FLATBUFFERS_HAS_STRING_VIEW
@@ -236,10 +260,8 @@ namespace flatbuffers {
236260

237261
#ifndef FLATBUFFERS_LOCALE_INDEPENDENT
238262
// Enable locale independent functions {strtof_l, strtod_l,strtoll_l, strtoull_l}.
239-
// They are part of the POSIX-2008 but not part of the C/C++ standard.
240-
// GCC/Clang have definition (_XOPEN_SOURCE>=700) if POSIX-2008.
241263
#if ((defined(_MSC_VER) && _MSC_VER >= 1800) || \
242-
(defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE>=700)))
264+
(defined(_XOPEN_VERSION) && (_XOPEN_VERSION>=700)) && (!defined(__ANDROID_API__) || (defined(__ANDROID_API__) && (__ANDROID_API__>=21))))
243265
#define FLATBUFFERS_LOCALE_INDEPENDENT 1
244266
#else
245267
#define FLATBUFFERS_LOCALE_INDEPENDENT 0
@@ -308,7 +330,13 @@ typedef uintmax_t largest_scalar_t;
308330
// We support aligning the contents of buffers up to this size.
309331
#define FLATBUFFERS_MAX_ALIGNMENT 16
310332

333+
inline bool VerifyAlignmentRequirements(size_t align, size_t min_align = 1) {
334+
return (min_align <= align) && (align <= (FLATBUFFERS_MAX_ALIGNMENT)) &&
335+
(align & (align - 1)) == 0; // must be power of 2
336+
}
337+
311338
#if defined(_MSC_VER)
339+
#pragma warning(disable: 4351) // C4351: new behavior: elements of array ... will be default initialized
312340
#pragma warning(push)
313341
#pragma warning(disable: 4127) // C4127: conditional expression is constant
314342
#endif
@@ -374,6 +402,13 @@ T ReadScalar(const void *p) {
374402
return EndianScalar(*reinterpret_cast<const T *>(p));
375403
}
376404

405+
// See https://github.com/google/flatbuffers/issues/5950
406+
407+
#if (FLATBUFFERS_GCC >= 100000) && (FLATBUFFERS_GCC < 110000)
408+
#pragma GCC diagnostic push
409+
#pragma GCC diagnostic ignored "-Wstringop-overflow"
410+
#endif
411+
377412
template<typename T>
378413
// UBSAN: C++ aliasing type rules, see std::bit_cast<> for details.
379414
__supress_ubsan__("alignment")
@@ -386,6 +421,10 @@ template<typename T> __supress_ubsan__("alignment") void WriteScalar(void *p, Of
386421
*reinterpret_cast<uoffset_t *>(p) = EndianScalar(t.o);
387422
}
388423

424+
#if (FLATBUFFERS_GCC >= 100000) && (FLATBUFFERS_GCC < 110000)
425+
#pragma GCC diagnostic pop
426+
#endif
427+
389428
// Computes how many bytes you'd have to pad to be able to write an
390429
// "scalar_size" scalar if the buffer had grown to "buf_size" (downwards in
391430
// memory).

0 commit comments

Comments
 (0)