Skip to content

Commit 1bc1f61

Browse files
committed
Incremented version to 1.7.3.
Updated glslang, SPIRV-Cross, and SPIRV-Tools to the latest versions. Use the latest release tag for glslang rather than latest HEAD. Updated prebuilt flatbuffers to the latest version.
1 parent ff07ea7 commit 1bc1f61

File tree

20 files changed

+692
-310
lines changed

20 files changed

+692
-310
lines changed

CMakeLists.txt

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

8282
set(MSL_MAJOR_VERSION 1)
8383
set(MSL_MINOR_VERSION 7)
84-
set(MSL_PATCH_VERSION 2)
84+
set(MSL_PATCH_VERSION 3)
8585
set(MSL_VERSION ${MSL_MAJOR_VERSION}.${MSL_MINOR_VERSION}.${MSL_PATCH_VERSION})
8686

8787
set(MSL_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})

Client/src/Module.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2016-2019 Aaron Barany
2+
* Copyright 2016-2023 Aaron Barany
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -19,12 +19,17 @@
1919
#if MSL_GCC || MSL_CLANG
2020
#pragma GCC diagnostic push
2121
#pragma GCC diagnostic ignored "-Wconversion"
22+
#elif MSL_MSC
23+
#pragma warning(push)
24+
#pragma warning(disable: 4244)
2225
#endif
2326

2427
#include "mslb_generated.h"
2528

2629
#if MSL_GCC || MSL_CLANG
2730
#pragma GCC diagnostic pop
31+
#elif MSL_MSC
32+
#pragma warning(pop)
2833
#endif
2934

3035
#include <errno.h>

Compile/CMakeLists.txt

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,9 @@ endif()
2727
file(GLOB_RECURSE glslangSources
2828
${GLSLANG_DIR}/glslang/MachineIndependent/*.cpp ${GLSLANG_DIR}/glslang/GenericCodeGen/*.cpp
2929
${GLSLANG_DIR}/glslang/Public/*.h ${GLSLANG_DIR}/glslang/Include/*.h
30+
${GLSLANG_DIR}/glslang/ResourceLimits/*.cpp ${GLSLANG_DIR}/glslang/ResourceLimits/*.h
3031
${GLSLANG_DIR}/OGLCompilersDLL/*.cpp ${GLSLANG_DIR}/OGLCompilersDLL/*.h
3132
${GLSLANG_DIR}/SPIRV/*.cpp ${GLSLANG_DIR}/SPIRV/*.h)
32-
set(glslResourceSources
33-
${GLSLANG_DIR}/StandAlone/ResourceLimits.cpp ${GLSLANG_DIR}/glslang/Public/ResourceLimits.h)
3433
file(GLOB spirvCrossSources ${SPIRV_CROSS_DIR}/spirv_*.cpp ${SPIRV_CROSS_DIR}/spirv_*.hpp)
3534

3635
# SPIRV-Tools has too complex of a build configuration to just embed the source in this library,
@@ -39,11 +38,18 @@ file(GLOB spirvCrossSources ${SPIRV_CROSS_DIR}/spirv_*.cpp ${SPIRV_CROSS_DIR}/sp
3938
set(SPIRV_SKIP_EXECUTABLES ON CACHE BOOL "" FORCE)
4039
set(SPIRV_SKIP_TESTS ON CACHE BOOL "" FORCE)
4140
set(SKIP_SPIRV_TOOLS_INSTALL ${MSL_SHARED} CACHE BOOL "" FORCE)
41+
# Ignore warnings for SPIRV-Tools.
42+
if (NOT MSVC)
43+
set(origCxxFlags ${CMAKE_CXX_FLAGS})
44+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -w")
45+
endif()
4246
add_subdirectory(SPIRV-Tools)
47+
if (NOT MSVC)
48+
set(CMAKE_CXX_FLAGS ${origCxxFlags})
49+
endif()
4350

4451
# Don't care about warnings for external files.
45-
set(externalSources
46-
${glslangSources} ${glslangOsSources} ${glslResourceSources} ${spirvCrossSources})
52+
set(externalSources ${glslangSources} ${glslangOsSources} ${spirvCrossSources})
4753
if (MSVC)
4854
set_source_files_properties(${externalSources} PROPERTIES COMPILE_FLAGS /w)
4955
else()

Compile/SPIRV-Cross

Submodule SPIRV-Cross updated 110 files

Compile/SPIRV-Tools

Submodule SPIRV-Tools updated 79 files

Compile/glslang

Submodule glslang updated 108 files

Compile/src/CompiledResult.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2016-2019 Aaron Barany
2+
* Copyright 2016-2023 Aaron Barany
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -20,12 +20,17 @@
2020
#if MSL_GCC || MSL_CLANG
2121
#pragma GCC diagnostic push
2222
#pragma GCC diagnostic ignored "-Wconversion"
23+
#elif MSL_MSC
24+
#pragma warning(push)
25+
#pragma warning(disable: 4244)
2326
#endif
2427

2528
#include "mslb_generated.h"
2629

2730
#if MSL_GCC || MSL_CLANG
2831
#pragma GCC diagnostic pop
32+
#elif MSL_MSC
33+
#pragma warning(pop)
2934
#endif
3035

3136
#include <fstream>

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,17 @@ The following software is required to build MSL:
5555
5656
The glslang, SPIRV-Cross, and SPIRV-Tools submodules can be grabbed by running `git submodule update --init --recursive`.
5757

58-
Additionally, additional tools such as Microsoft's HLSL compiler and Apple's Metal compiler will be required when compiling shaders for certain platforms.
58+
Additional tools such as Microsoft's HLSL compiler and Apple's Metal compiler will be required when compiling shaders for certain platforms.
5959

6060
# Platforms
6161

6262
MSL has been built for and tested on the following platforms:
6363

6464
* Linux (GCC and LLVM clang)
65-
* Windows (requires Visual Studio 2015 or later)
66-
* Mac OS X
65+
* Windows (requires Visual Studio 2017 or later)
66+
* macOS
67+
68+
C++17 must be supported by the compiler being used.
6769

6870
# Building
6971

Shared/external/flatbuffers/array.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#ifndef FLATBUFFERS_ARRAY_H_
1818
#define FLATBUFFERS_ARRAY_H_
1919

20+
#include <cstdint>
2021
#include <memory>
2122

2223
#include "flatbuffers/base.h"
@@ -37,7 +38,7 @@ template<typename T, uint16_t length> class Array {
3738
public:
3839
typedef uint16_t size_type;
3940
typedef typename IndirectHelper<IndirectHelperType>::return_type return_type;
40-
typedef VectorConstIterator<T, return_type> const_iterator;
41+
typedef VectorConstIterator<T, return_type, uoffset_t> const_iterator;
4142
typedef VectorReverseIterator<const_iterator> const_reverse_iterator;
4243

4344
// If T is a LE-scalar or a struct (!scalar_tag::value).
@@ -158,11 +159,13 @@ template<typename T, uint16_t length> class Array {
158159

159160
// Specialization for Array[struct] with access using Offset<void> pointer.
160161
// This specialization used by idl_gen_text.cpp.
161-
template<typename T, uint16_t length> class Array<Offset<T>, length> {
162+
template<typename T, uint16_t length, template<typename> class OffsetT>
163+
class Array<OffsetT<T>, length> {
162164
static_assert(flatbuffers::is_same<T, void>::value, "unexpected type T");
163165

164166
public:
165167
typedef const void *return_type;
168+
typedef uint16_t size_type;
166169

167170
const uint8_t *Data() const { return data_; }
168171

Shared/external/flatbuffers/base.h

Lines changed: 27 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
#include <vector>
4444
#include <set>
4545
#include <algorithm>
46+
#include <limits>
4647
#include <iterator>
4748
#include <memory>
4849

@@ -139,8 +140,8 @@
139140
#endif // !defined(FLATBUFFERS_LITTLEENDIAN)
140141

141142
#define FLATBUFFERS_VERSION_MAJOR 23
142-
#define FLATBUFFERS_VERSION_MINOR 3
143-
#define FLATBUFFERS_VERSION_REVISION 3
143+
#define FLATBUFFERS_VERSION_MINOR 5
144+
#define FLATBUFFERS_VERSION_REVISION 26
144145
#define FLATBUFFERS_STRING_EXPAND(X) #X
145146
#define FLATBUFFERS_STRING(X) FLATBUFFERS_STRING_EXPAND(X)
146147
namespace flatbuffers {
@@ -233,12 +234,17 @@ namespace flatbuffers {
233234
}
234235
#define FLATBUFFERS_HAS_STRING_VIEW 1
235236
// Check for absl::string_view
236-
#elif __has_include("absl/strings/string_view.h") && (__cplusplus >= 201411)
237-
#include "absl/strings/string_view.h"
238-
namespace flatbuffers {
239-
typedef absl::string_view string_view;
240-
}
241-
#define FLATBUFFERS_HAS_STRING_VIEW 1
237+
#elif __has_include("absl/strings/string_view.h") && \
238+
__has_include("absl/base/config.h") && \
239+
(__cplusplus >= 201411)
240+
#include "absl/base/config.h"
241+
#if !defined(ABSL_USES_STD_STRING_VIEW)
242+
#include "absl/strings/string_view.h"
243+
namespace flatbuffers {
244+
typedef absl::string_view string_view;
245+
}
246+
#define FLATBUFFERS_HAS_STRING_VIEW 1
247+
#endif
242248
#endif
243249
#endif // __has_include
244250
#endif // !FLATBUFFERS_HAS_STRING_VIEW
@@ -273,14 +279,14 @@ namespace flatbuffers {
273279
#endif // !FLATBUFFERS_LOCALE_INDEPENDENT
274280

275281
// Suppress Undefined Behavior Sanitizer (recoverable only). Usage:
276-
// - __suppress_ubsan__("undefined")
277-
// - __suppress_ubsan__("signed-integer-overflow")
282+
// - FLATBUFFERS_SUPPRESS_UBSAN("undefined")
283+
// - FLATBUFFERS_SUPPRESS_UBSAN("signed-integer-overflow")
278284
#if defined(__clang__) && (__clang_major__ > 3 || (__clang_major__ == 3 && __clang_minor__ >=7))
279-
#define __suppress_ubsan__(type) __attribute__((no_sanitize(type)))
285+
#define FLATBUFFERS_SUPPRESS_UBSAN(type) __attribute__((no_sanitize(type)))
280286
#elif defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 409)
281-
#define __suppress_ubsan__(type) __attribute__((no_sanitize_undefined))
287+
#define FLATBUFFERS_SUPPRESS_UBSAN(type) __attribute__((no_sanitize_undefined))
282288
#else
283-
#define __suppress_ubsan__(type)
289+
#define FLATBUFFERS_SUPPRESS_UBSAN(type)
284290
#endif
285291

286292
// This is constexpr function used for checking compile-time constants.
@@ -318,9 +324,11 @@ namespace flatbuffers {
318324
// Also, using a consistent offset type maintains compatibility of serialized
319325
// offset values between 32bit and 64bit systems.
320326
typedef uint32_t uoffset_t;
327+
typedef uint64_t uoffset64_t;
321328

322329
// Signed offsets for references that can go in both directions.
323330
typedef int32_t soffset_t;
331+
typedef int64_t soffset64_t;
324332

325333
// Offset/index used in v-tables, can be changed to uint8_t in
326334
// format forks to save a bit of space if desired.
@@ -329,7 +337,8 @@ typedef uint16_t voffset_t;
329337
typedef uintmax_t largest_scalar_t;
330338

331339
// In 32bits, this evaluates to 2GB - 1
332-
#define FLATBUFFERS_MAX_BUFFER_SIZE ((1ULL << (sizeof(::flatbuffers::soffset_t) * 8 - 1)) - 1)
340+
#define FLATBUFFERS_MAX_BUFFER_SIZE std::numeric_limits<::flatbuffers::soffset_t>::max()
341+
#define FLATBUFFERS_MAX_64_BUFFER_SIZE std::numeric_limits<::flatbuffers::soffset64_t>::max()
333342

334343
// The minimum size buffer that can be a valid flatbuffer.
335344
// Includes the offset to the root table (uoffset_t), the offset to the vtable
@@ -413,7 +422,7 @@ template<typename T> T EndianScalar(T t) {
413422

414423
template<typename T>
415424
// UBSAN: C++ aliasing type rules, see std::bit_cast<> for details.
416-
__suppress_ubsan__("alignment")
425+
FLATBUFFERS_SUPPRESS_UBSAN("alignment")
417426
T ReadScalar(const void *p) {
418427
return EndianScalar(*reinterpret_cast<const T *>(p));
419428
}
@@ -427,13 +436,13 @@ T ReadScalar(const void *p) {
427436

428437
template<typename T>
429438
// UBSAN: C++ aliasing type rules, see std::bit_cast<> for details.
430-
__suppress_ubsan__("alignment")
439+
FLATBUFFERS_SUPPRESS_UBSAN("alignment")
431440
void WriteScalar(void *p, T t) {
432441
*reinterpret_cast<T *>(p) = EndianScalar(t);
433442
}
434443

435444
template<typename T> struct Offset;
436-
template<typename T> __suppress_ubsan__("alignment") void WriteScalar(void *p, Offset<T> t) {
445+
template<typename T> FLATBUFFERS_SUPPRESS_UBSAN("alignment") void WriteScalar(void *p, Offset<T> t) {
437446
*reinterpret_cast<uoffset_t *>(p) = EndianScalar(t.o);
438447
}
439448

@@ -444,7 +453,7 @@ template<typename T> __suppress_ubsan__("alignment") void WriteScalar(void *p, O
444453
// Computes how many bytes you'd have to pad to be able to write an
445454
// "scalar_size" scalar if the buffer had grown to "buf_size" (downwards in
446455
// memory).
447-
__suppress_ubsan__("unsigned-integer-overflow")
456+
FLATBUFFERS_SUPPRESS_UBSAN("unsigned-integer-overflow")
448457
inline size_t PaddingBytes(size_t buf_size, size_t scalar_size) {
449458
return ((~buf_size) + 1) & (scalar_size - 1);
450459
}

0 commit comments

Comments
 (0)