Rename src/common macros NXT_* to DAWN_*
diff --git a/src/backend/Device.h b/src/backend/Device.h
index 363703b..45bac74 100644
--- a/src/backend/Device.h
+++ b/src/backend/Device.h
@@ -33,7 +33,7 @@
void HandleError(const char* message);
bool ConsumedError(MaybeError maybeError) {
- if (NXT_UNLIKELY(maybeError.IsError())) {
+ if (DAWN_UNLIKELY(maybeError.IsError())) {
ConsumeError(maybeError.AcquireError());
return true;
}
diff --git a/src/backend/Error.h b/src/backend/Error.h
index 11ba3b3..5d02869 100644
--- a/src/backend/Error.h
+++ b/src/backend/Error.h
@@ -56,7 +56,7 @@
#define DAWN_TRY(EXPR) \
{ \
auto DAWN_LOCAL_VAR = EXPR; \
- if (NXT_UNLIKELY(DAWN_LOCAL_VAR.IsError())) { \
+ if (DAWN_UNLIKELY(DAWN_LOCAL_VAR.IsError())) { \
ErrorData* error = DAWN_LOCAL_VAR.AcquireError(); \
AppendBacktrace(error, __FILE__, __func__, __LINE__); \
return {error}; \
@@ -70,7 +70,7 @@
#define DAWN_TRY_ASSIGN(VAR, EXPR) \
{ \
auto DAWN_LOCAL_VAR = EXPR; \
- if (NXT_UNLIKELY(DAWN_LOCAL_VAR.IsError())) { \
+ if (DAWN_UNLIKELY(DAWN_LOCAL_VAR.IsError())) { \
ErrorData* error = DAWN_LOCAL_VAR.AcquireError(); \
AppendBacktrace(error, __FILE__, __func__, __LINE__); \
return {error}; \
diff --git a/src/backend/PerStage.h b/src/backend/PerStage.h
index d615ebe..350405e 100644
--- a/src/backend/PerStage.h
+++ b/src/backend/PerStage.h
@@ -49,22 +49,22 @@
class PerStage {
public:
T& operator[](dawn::ShaderStage stage) {
- NXT_ASSERT(static_cast<uint32_t>(stage) < kNumStages);
+ DAWN_ASSERT(static_cast<uint32_t>(stage) < kNumStages);
return mData[static_cast<uint32_t>(stage)];
}
const T& operator[](dawn::ShaderStage stage) const {
- NXT_ASSERT(static_cast<uint32_t>(stage) < kNumStages);
+ DAWN_ASSERT(static_cast<uint32_t>(stage) < kNumStages);
return mData[static_cast<uint32_t>(stage)];
}
T& operator[](dawn::ShaderStageBit stageBit) {
uint32_t bit = static_cast<uint32_t>(stageBit);
- NXT_ASSERT(bit != 0 && IsPowerOfTwo(bit) && bit <= (1 << kNumStages));
+ DAWN_ASSERT(bit != 0 && IsPowerOfTwo(bit) && bit <= (1 << kNumStages));
return mData[Log2(bit)];
}
const T& operator[](dawn::ShaderStageBit stageBit) const {
uint32_t bit = static_cast<uint32_t>(stageBit);
- NXT_ASSERT(bit != 0 && IsPowerOfTwo(bit) && bit <= (1 << kNumStages));
+ DAWN_ASSERT(bit != 0 && IsPowerOfTwo(bit) && bit <= (1 << kNumStages));
return mData[Log2(bit)];
}
diff --git a/src/backend/d3d12/ShaderModuleD3D12.cpp b/src/backend/d3d12/ShaderModuleD3D12.cpp
index fd505c8..0511b76 100644
--- a/src/backend/d3d12/ShaderModuleD3D12.cpp
+++ b/src/backend/d3d12/ShaderModuleD3D12.cpp
@@ -35,7 +35,7 @@
case dawn::BindingType::StorageBuffer:
return mMap[3];
default:
- NXT_UNREACHABLE();
+ DAWN_UNREACHABLE();
}
}
diff --git a/src/backend/d3d12/d3d12_platform.h b/src/backend/d3d12/d3d12_platform.h
index 68a2267..bfe66b4 100644
--- a/src/backend/d3d12/d3d12_platform.h
+++ b/src/backend/d3d12/d3d12_platform.h
@@ -27,7 +27,7 @@
// Remove windows.h macros after d3d12's include of windows.h
#include "common/Platform.h"
-#if defined(NXT_PLATFORM_WINDOWS)
+#if defined(DAWN_PLATFORM_WINDOWS)
# include "common/windows_with_undefs.h"
#endif
diff --git a/src/backend/opengl/DeviceGL.h b/src/backend/opengl/DeviceGL.h
index 65cf19f..58c5329 100644
--- a/src/backend/opengl/DeviceGL.h
+++ b/src/backend/opengl/DeviceGL.h
@@ -24,7 +24,7 @@
#include "glad/glad.h"
// Remove windows.h macros after glad's include of windows.h
-#if defined(NXT_PLATFORM_WINDOWS)
+#if defined(DAWN_PLATFORM_WINDOWS)
# include "common/windows_with_undefs.h"
#endif
diff --git a/src/backend/opengl/ShaderModuleGL.cpp b/src/backend/opengl/ShaderModuleGL.cpp
index 8eef5ac..5adb954 100644
--- a/src/backend/opengl/ShaderModuleGL.cpp
+++ b/src/backend/opengl/ShaderModuleGL.cpp
@@ -51,7 +51,7 @@
spirv_cross::CompilerGLSL::Options options;
// TODO(cwallez@chromium.org): discover the backing context version and use that.
-#if defined(NXT_PLATFORM_APPLE)
+#if defined(DAWN_PLATFORM_APPLE)
options.version = 410;
#else
options.version = 440;
diff --git a/src/backend/vulkan/DeviceVk.cpp b/src/backend/vulkan/DeviceVk.cpp
index 10a459d..1dbe3c3 100644
--- a/src/backend/vulkan/DeviceVk.cpp
+++ b/src/backend/vulkan/DeviceVk.cpp
@@ -42,9 +42,9 @@
#include <iostream>
-#if NXT_PLATFORM_LINUX
+#if DAWN_PLATFORM_LINUX
const char kVulkanLibName[] = "libvulkan.so.1";
-#elif NXT_PLATFORM_WINDOWS
+#elif DAWN_PLATFORM_WINDOWS
const char kVulkanLibName[] = "vulkan-1.dll";
#else
# error "Unimplemented Vulkan backend platform"
diff --git a/src/common/Assert.cpp b/src/common/Assert.cpp
index c8afeda..fc88fd2 100644
--- a/src/common/Assert.cpp
+++ b/src/common/Assert.cpp
@@ -22,5 +22,5 @@
const char* condition) {
std::cerr << "Assertion failure at " << file << ":" << line << " (" << function
<< "): " << condition << std::endl;
- NXT_BREAKPOINT();
+ DAWN_BREAKPOINT();
}
diff --git a/src/common/Assert.h b/src/common/Assert.h
index a0f3ab7..1957e99 100644
--- a/src/common/Assert.h
+++ b/src/common/Assert.h
@@ -22,7 +22,7 @@
// release it does nothing at runtime.
//
// In case of name clashes (with for example a testing library), you can define the
-// NXT_SKIP_ASSERT_SHORTHANDS to only define the NXT_ prefixed macros.
+// DAWN_SKIP_ASSERT_SHORTHANDS to only define the DAWN_ prefixed macros.
//
// These asserts feature:
// - Logging of the error with file, line and function information.
@@ -31,45 +31,45 @@
// MSVC triggers a warning in /W4 for do {} while(0). SDL worked around this by using (0,0) and
// points out that it looks like an owl face.
-#if defined(NXT_COMPILER_MSVC)
-# define NXT_ASSERT_LOOP_CONDITION (0, 0)
+#if defined(DAWN_COMPILER_MSVC)
+# define DAWN_ASSERT_LOOP_CONDITION (0, 0)
#else
-# define NXT_ASSERT_LOOP_CONDITION (0)
+# define DAWN_ASSERT_LOOP_CONDITION (0)
#endif
-// NXT_ASSERT_CALLSITE_HELPER generates the actual assert code. In Debug it does what you would
+// DAWN_ASSERT_CALLSITE_HELPER generates the actual assert code. In Debug it does what you would
// expect of an assert and in release it tries to give hints to make the compiler generate better
// code.
-#if defined(NXT_ENABLE_ASSERTS)
-# define NXT_ASSERT_CALLSITE_HELPER(file, func, line, condition) \
+#if defined(DAWN_ENABLE_ASSERTS)
+# define DAWN_ASSERT_CALLSITE_HELPER(file, func, line, condition) \
do { \
if (!(condition)) { \
HandleAssertionFailure(file, func, line, #condition); \
} \
- } while (NXT_ASSERT_LOOP_CONDITION)
+ } while (DAWN_ASSERT_LOOP_CONDITION)
#else
-# if defined(NXT_COMPILER_MSVC)
-# define NXT_ASSERT_CALLSITE_HELPER(file, func, line, condition) __assume(condition)
-# elif defined(NXT_COMPILER_CLANG) && defined(__builtin_assume)
-# define NXT_ASSERT_CALLSITE_HELPER(file, func, line, condition) __builtin_assume(condition)
+# if defined(DAWN_COMPILER_MSVC)
+# define DAWN_ASSERT_CALLSITE_HELPER(file, func, line, condition) __assume(condition)
+# elif defined(DAWN_COMPILER_CLANG) && defined(__builtin_assume)
+# define DAWN_ASSERT_CALLSITE_HELPER(file, func, line, condition) __builtin_assume(condition)
# else
-# define NXT_ASSERT_CALLSITE_HELPER(file, func, line, condition) \
- do { \
- NXT_UNUSED(sizeof(condition)); \
- } while (NXT_ASSERT_LOOP_CONDITION)
+# define DAWN_ASSERT_CALLSITE_HELPER(file, func, line, condition) \
+ do { \
+ DAWN_UNUSED(sizeof(condition)); \
+ } while (DAWN_ASSERT_LOOP_CONDITION)
# endif
#endif
-#define NXT_ASSERT(condition) NXT_ASSERT_CALLSITE_HELPER(__FILE__, __func__, __LINE__, condition)
-#define NXT_UNREACHABLE() \
- do { \
- NXT_ASSERT(NXT_ASSERT_LOOP_CONDITION && "Unreachable code hit"); \
- NXT_BUILTIN_UNREACHABLE(); \
- } while (NXT_ASSERT_LOOP_CONDITION)
+#define DAWN_ASSERT(condition) DAWN_ASSERT_CALLSITE_HELPER(__FILE__, __func__, __LINE__, condition)
+#define DAWN_UNREACHABLE() \
+ do { \
+ DAWN_ASSERT(DAWN_ASSERT_LOOP_CONDITION && "Unreachable code hit"); \
+ DAWN_BUILTIN_UNREACHABLE(); \
+ } while (DAWN_ASSERT_LOOP_CONDITION)
-#if !defined(NXT_SKIP_ASSERT_SHORTHANDS)
-# define ASSERT NXT_ASSERT
-# define UNREACHABLE NXT_UNREACHABLE
+#if !defined(DAWN_SKIP_ASSERT_SHORTHANDS)
+# define ASSERT DAWN_ASSERT
+# define UNREACHABLE DAWN_UNREACHABLE
#endif
void HandleAssertionFailure(const char* file,
diff --git a/src/common/BitSetIterator.h b/src/common/BitSetIterator.h
index d73cb24..432433a 100644
--- a/src/common/BitSetIterator.h
+++ b/src/common/BitSetIterator.h
@@ -94,7 +94,7 @@
template <size_t N, typename T>
typename BitSetIterator<N, T>::Iterator& BitSetIterator<N, T>::Iterator::operator++() {
- NXT_ASSERT(mBits.any());
+ DAWN_ASSERT(mBits.any());
mBits.set(mCurrentBit - mOffset, 0);
mCurrentBit = getNextBit();
return *this;
diff --git a/src/common/Compiler.h b/src/common/Compiler.h
index 16bab3f..15b6ce5 100644
--- a/src/common/Compiler.h
+++ b/src/common/Compiler.h
@@ -16,31 +16,31 @@
#define COMMON_COMPILER_H_
// Defines macros for compiler-specific functionality
-// - NXT_COMPILER_[CLANG|GCC|MSVC]: Compiler detection
-// - NXT_BREAKPOINT(): Raises an exception and breaks in the debugger
-// - NXT_BUILTIN_UNREACHABLE(): Hints the compiler that a code path is unreachable
-// - NXT_NO_DISCARD: An attribute that is C++17 [[nodiscard]] where available
-// - NXT_(UN)?LIKELY(EXPR): Where available, hints the compiler that the expression will be true
+// - DAWN_COMPILER_[CLANG|GCC|MSVC]: Compiler detection
+// - DAWN_BREAKPOINT(): Raises an exception and breaks in the debugger
+// - DAWN_BUILTIN_UNREACHABLE(): Hints the compiler that a code path is unreachable
+// - DAWN_NO_DISCARD: An attribute that is C++17 [[nodiscard]] where available
+// - DAWN_(UN)?LIKELY(EXPR): Where available, hints the compiler that the expression will be true
// (resp. false) to help it generate code that leads to better branch prediction.
-// - NXT_UNUSED(EXPR): Prevents unused variable/expression warnings on EXPR.
+// - DAWN_UNUSED(EXPR): Prevents unused variable/expression warnings on EXPR.
// Clang and GCC
#if defined(__GNUC__)
# if defined(__clang__)
-# define NXT_COMPILER_CLANG
+# define DAWN_COMPILER_CLANG
# else
-# define NXT_COMPILER_GCC
+# define DAWN_COMPILER_GCC
# endif
# if defined(__i386__) || defined(__x86_64__)
-# define NXT_BREAKPOINT() __asm__ __volatile__("int $3\n\t")
+# define DAWN_BREAKPOINT() __asm__ __volatile__("int $3\n\t")
# else
# error "Implement BREAKPOINT on your platform"
# endif
-# define NXT_BUILTIN_UNREACHABLE() __builtin_unreachable()
-# define NXT_LIKELY(x) __builtin_expect(!!(x), 1)
-# define NXT_UNLIKELY(x) __builtin_expect(!!(x), 0)
+# define DAWN_BUILTIN_UNREACHABLE() __builtin_unreachable()
+# define DAWN_LIKELY(x) __builtin_expect(!!(x), 1)
+# define DAWN_UNLIKELY(x) __builtin_expect(!!(x), 0)
# if !defined(__has_cpp_attribute)
# define __has_cpp_attribute(name) 0
@@ -50,23 +50,23 @@
// Also avoid warn_unused_result with GCC because it is only a function attribute and not a type
// attribute.
# if __has_cpp_attribute(warn_unused_result) && defined(__clang__)
-# define NXT_NO_DISCARD __attribute__((warn_unused_result))
-# elif NXT_CPP_VERSION >= 17 && __has_cpp_attribute(nodiscard)
-# define NXT_NO_DISCARD [[nodiscard]]
+# define DAWN_NO_DISCARD __attribute__((warn_unused_result))
+# elif DAWN_CPP_VERSION >= 17 && __has_cpp_attribute(nodiscard)
+# define DAWN_NO_DISCARD [[nodiscard]]
# endif
// MSVC
#elif defined(_MSC_VER)
-# define NXT_COMPILER_MSVC
+# define DAWN_COMPILER_MSVC
extern void __cdecl __debugbreak(void);
-# define NXT_BREAKPOINT() __debugbreak()
+# define DAWN_BREAKPOINT() __debugbreak()
-# define NXT_BUILTIN_UNREACHABLE() __assume(false)
+# define DAWN_BUILTIN_UNREACHABLE() __assume(false)
// Visual Studio 2017 15.3 adds support for [[nodiscard]]
-# if _MSC_VER >= 1911 && NXT_CPP_VERSION >= 17
-# define NXT_NO_DISCARD [[nodiscard]]
+# if _MSC_VER >= 1911 && DAWN_CPP_VERSION >= 17
+# define DAWN_NO_DISCARD [[nodiscard]]
# endif
#else
@@ -74,17 +74,17 @@
#endif
// It seems that (void) EXPR works on all compilers to silence the unused variable warning.
-#define NXT_UNUSED(EXPR) (void)EXPR
+#define DAWN_UNUSED(EXPR) (void)EXPR
// Add noop replacements for macros for features that aren't supported by the compiler.
-#if !defined(NXT_LIKELY)
-# define NXT_LIKELY(X) X
+#if !defined(DAWN_LIKELY)
+# define DAWN_LIKELY(X) X
#endif
-#if !defined(NXT_UNLIKELY)
-# define NXT_UNLIKELY(X) X
+#if !defined(DAWN_UNLIKELY)
+# define DAWN_UNLIKELY(X) X
#endif
-#if !defined(NXT_NO_DISCARD)
-# define NXT_NO_DISCARD
+#if !defined(DAWN_NO_DISCARD)
+# define DAWN_NO_DISCARD
#endif
#endif // COMMON_COMPILER_H_
diff --git a/src/common/DynamicLib.cpp b/src/common/DynamicLib.cpp
index 6e30e4c..6de7ced 100644
--- a/src/common/DynamicLib.cpp
+++ b/src/common/DynamicLib.cpp
@@ -16,9 +16,9 @@
#include "common/Platform.h"
-#if NXT_PLATFORM_WINDOWS
+#if DAWN_PLATFORM_WINDOWS
# include "common/windows_with_undefs.h"
-#elif NXT_PLATFORM_POSIX
+#elif DAWN_PLATFORM_POSIX
# include <dlfcn.h>
#else
# error "Unsupported platform for DynamicLib"
@@ -42,13 +42,13 @@
}
bool DynamicLib::Open(const std::string& filename, std::string* error) {
-#if NXT_PLATFORM_WINDOWS
+#if DAWN_PLATFORM_WINDOWS
mHandle = LoadLibraryA(filename.c_str());
if (mHandle == nullptr && error != nullptr) {
*error = "Windows Error: " + std::to_string(GetLastError());
}
-#elif NXT_PLATFORM_POSIX
+#elif DAWN_PLATFORM_POSIX
mHandle = dlopen(filename.c_str(), RTLD_NOW);
if (mHandle == nullptr && error != nullptr) {
@@ -66,9 +66,9 @@
return;
}
-#if NXT_PLATFORM_WINDOWS
+#if DAWN_PLATFORM_WINDOWS
FreeLibrary(static_cast<HMODULE>(mHandle));
-#elif NXT_PLATFORM_POSIX
+#elif DAWN_PLATFORM_POSIX
dlclose(mHandle);
#else
# error "Unsupported platform for DynamicLib"
@@ -80,13 +80,13 @@
void* DynamicLib::GetProc(const std::string& procName, std::string* error) const {
void* proc = nullptr;
-#if NXT_PLATFORM_WINDOWS
+#if DAWN_PLATFORM_WINDOWS
proc = reinterpret_cast<void*>(GetProcAddress(static_cast<HMODULE>(mHandle), procName.c_str()));
if (proc == nullptr && error != nullptr) {
*error = "Windows Error: " + std::to_string(GetLastError());
}
-#elif NXT_PLATFORM_POSIX
+#elif DAWN_PLATFORM_POSIX
proc = reinterpret_cast<void*>(dlsym(mHandle, procName.c_str()));
if (proc == nullptr && error != nullptr) {
diff --git a/src/common/HashUtils.h b/src/common/HashUtils.h
index 987135c..4b0306c 100644
--- a/src/common/HashUtils.h
+++ b/src/common/HashUtils.h
@@ -36,9 +36,9 @@
// return hash;
template <typename T>
void HashCombine(size_t* hash, const T& value) {
-#if defined(NXT_PLATFORM_64_BIT)
+#if defined(DAWN_PLATFORM_64_BIT)
const size_t offset = 0x9e3779b97f4a7c16;
-#elif defined(NXT_PLATFORM_32_BIT)
+#elif defined(DAWN_PLATFORM_32_BIT)
const size_t offset = 0x9e3779b9;
#else
# error "Unsupported platform"
diff --git a/src/common/Math.cpp b/src/common/Math.cpp
index 41caa76..6aec721 100644
--- a/src/common/Math.cpp
+++ b/src/common/Math.cpp
@@ -16,13 +16,13 @@
#include "common/Assert.h"
-#if defined(NXT_COMPILER_MSVC)
+#if defined(DAWN_COMPILER_MSVC)
# include <intrin.h>
#endif
uint32_t ScanForward(uint32_t bits) {
ASSERT(bits != 0);
-#if defined(NXT_COMPILER_MSVC)
+#if defined(DAWN_COMPILER_MSVC)
unsigned long firstBitIndex = 0ul;
unsigned char ret = _BitScanForward(&firstBitIndex, bits);
ASSERT(ret != 0);
@@ -34,7 +34,7 @@
uint32_t Log2(uint32_t value) {
ASSERT(value != 0);
-#if defined(NXT_COMPILER_MSVC)
+#if defined(DAWN_COMPILER_MSVC)
unsigned long firstBitIndex = 0ul;
unsigned char ret = _BitScanReverse(&firstBitIndex, value);
ASSERT(ret != 0);
diff --git a/src/common/Platform.h b/src/common/Platform.h
index d7a9229..3b84fa7 100644
--- a/src/common/Platform.h
+++ b/src/common/Platform.h
@@ -16,22 +16,22 @@
#define COMMON_PLATFORM_H_
#if defined(_WIN32) || defined(_WIN64)
-# define NXT_PLATFORM_WINDOWS 1
+# define DAWN_PLATFORM_WINDOWS 1
#elif defined(__linux__)
-# define NXT_PLATFORM_LINUX 1
-# define NXT_PLATFORM_POSIX 1
+# define DAWN_PLATFORM_LINUX 1
+# define DAWN_PLATFORM_POSIX 1
#elif defined(__APPLE__)
-# define NXT_PLATFORM_APPLE 1
-# define NXT_PLATFORM_POSIX 1
+# define DAWN_PLATFORM_APPLE 1
+# define DAWN_PLATFORM_POSIX 1
#else
# error "Unsupported platform."
#endif
#if defined(_WIN64) || defined(__aarch64__) || defined(__x86_64__)
-# define NXT_PLATFORM_64_BIT 1
+# define DAWN_PLATFORM_64_BIT 1
static_assert(sizeof(sizeof(char)) == 8, "Expect sizeof(size_t) == 8");
#elif defined(_WIN32) || defined(__i386__) || defined(__arm__)
-# define NXT_PLATFORM_32_BIT 1
+# define DAWN_PLATFORM_32_BIT 1
static_assert(sizeof(sizeof(char)) == 4, "Expect sizeof(size_t) == 4");
#else
# error "Unsupported platform"
diff --git a/src/common/Result.h b/src/common/Result.h
index ad45d32..1aeac54 100644
--- a/src/common/Result.h
+++ b/src/common/Result.h
@@ -55,7 +55,7 @@
// Specialization of Result for returning errors only via pointers. It is basically a pointer
// where nullptr is both Success and Empty.
template <typename E>
-class NXT_NO_DISCARD Result<void, E*> {
+class DAWN_NO_DISCARD Result<void, E*> {
public:
Result();
Result(E* error);
@@ -85,7 +85,7 @@
// Specialization of Result when both the error an success are pointers. It is implemented as a
// tagged pointer. The tag for Success is 0 so that returning the value is fastest.
template <typename T, typename E>
-class NXT_NO_DISCARD Result<T*, E*> {
+class DAWN_NO_DISCARD Result<T*, E*> {
public:
static_assert(alignof_if_defined_else_default<T, 4> >= 4,
"Result<T*, E*> reserves two bits for tagging pointers");
diff --git a/src/common/SerialQueue.h b/src/common/SerialQueue.h
index 5c33d76..3fcead8 100644
--- a/src/common/SerialQueue.h
+++ b/src/common/SerialQueue.h
@@ -117,7 +117,7 @@
template <typename T>
void SerialQueue<T>::Enqueue(const T& value, Serial serial) {
- NXT_ASSERT(Empty() || mStorage.back().first <= serial);
+ DAWN_ASSERT(Empty() || mStorage.back().first <= serial);
if (Empty() || mStorage.back().first < serial) {
mStorage.emplace_back(SerialPair(serial, {}));
@@ -127,7 +127,7 @@
template <typename T>
void SerialQueue<T>::Enqueue(T&& value, Serial serial) {
- NXT_ASSERT(Empty() || mStorage.back().first <= serial);
+ DAWN_ASSERT(Empty() || mStorage.back().first <= serial);
if (Empty() || mStorage.back().first < serial) {
mStorage.emplace_back(SerialPair(serial, {}));
@@ -137,15 +137,15 @@
template <typename T>
void SerialQueue<T>::Enqueue(const std::vector<T>& values, Serial serial) {
- NXT_ASSERT(values.size() > 0);
- NXT_ASSERT(Empty() || mStorage.back().first <= serial);
+ DAWN_ASSERT(values.size() > 0);
+ DAWN_ASSERT(Empty() || mStorage.back().first <= serial);
mStorage.emplace_back(SerialPair(serial, {values}));
}
template <typename T>
void SerialQueue<T>::Enqueue(std::vector<T>&& values, Serial serial) {
- NXT_ASSERT(values.size() > 0);
- NXT_ASSERT(Empty() || mStorage.back().first <= serial);
+ DAWN_ASSERT(values.size() > 0);
+ DAWN_ASSERT(Empty() || mStorage.back().first <= serial);
mStorage.emplace_back(SerialPair(serial, {values}));
}
@@ -186,7 +186,7 @@
template <typename T>
Serial SerialQueue<T>::FirstSerial() const {
- NXT_ASSERT(!Empty());
+ DAWN_ASSERT(!Empty());
return mStorage.front().first;
}
diff --git a/src/common/vulkan_platform.h b/src/common/vulkan_platform.h
index d34cf39..6381e4f 100644
--- a/src/common/vulkan_platform.h
+++ b/src/common/vulkan_platform.h
@@ -89,7 +89,7 @@
// Remove windows.h macros after vulkan_platform's include of windows.h
#include "common/Platform.h"
-#if defined(NXT_PLATFORM_WINDOWS)
+#if defined(DAWN_PLATFORM_WINDOWS)
# include "common/windows_with_undefs.h"
#endif
diff --git a/src/common/windows_with_undefs.h b/src/common/windows_with_undefs.h
index 6226314..c481546 100644
--- a/src/common/windows_with_undefs.h
+++ b/src/common/windows_with_undefs.h
@@ -17,7 +17,7 @@
#include "common/Compiler.h"
-#if !defined(NXT_PLATFORM_WINDOWS)
+#if !defined(DAWN_PLATFORM_WINDOWS)
# error "windows_with_undefs.h included on non-Windows"
#endif
diff --git a/src/tests/NXTTest.cpp b/src/tests/NXTTest.cpp
index df482cf..11bd443 100644
--- a/src/tests/NXTTest.cpp
+++ b/src/tests/NXTTest.cpp
@@ -129,10 +129,10 @@
void NXTTest::SetUp() {
mBinding = utils::CreateBinding(ParamToBackendType(GetParam()));
- NXT_ASSERT(mBinding != nullptr);
+ DAWN_ASSERT(mBinding != nullptr);
GLFWwindow* testWindow = GetWindowForBackend(mBinding, GetParam());
- NXT_ASSERT(testWindow != nullptr);
+ DAWN_ASSERT(testWindow != nullptr);
mBinding->SetWindow(testWindow);
@@ -323,7 +323,7 @@
void NXTTest::SlotMapReadCallback(nxtBufferMapAsyncStatus status,
const void* data,
nxtCallbackUserdata userdata_) {
- NXT_ASSERT(status == NXT_BUFFER_MAP_ASYNC_STATUS_SUCCESS);
+ DAWN_ASSERT(status == NXT_BUFFER_MAP_ASYNC_STATUS_SUCCESS);
auto userdata = reinterpret_cast<MapReadUserdata*>(static_cast<uintptr_t>(userdata_));
userdata->test->mReadbackSlots[userdata->slot].mappedData = data;
@@ -334,7 +334,7 @@
void NXTTest::ResolveExpectations() {
for (const auto& expectation : mDeferredExpectations) {
- NXT_ASSERT(mReadbackSlots[expectation.readbackSlot].mappedData != nullptr);
+ DAWN_ASSERT(mReadbackSlots[expectation.readbackSlot].mappedData != nullptr);
// Get a pointer to the mapped copy of the data for the expectation.
const char* data = reinterpret_cast<const char*>(mReadbackSlots[expectation.readbackSlot].mappedData);
@@ -343,7 +343,7 @@
uint32_t size;
std::vector<char> packedData;
if (expectation.rowBytes != expectation.rowPitch) {
- NXT_ASSERT(expectation.rowPitch > expectation.rowBytes);
+ DAWN_ASSERT(expectation.rowPitch > expectation.rowBytes);
uint32_t rowCount = (expectation.size + expectation.rowPitch - 1) / expectation.rowPitch;
uint32_t packedSize = rowCount * expectation.rowBytes;
packedData.resize(packedSize);
@@ -436,7 +436,7 @@
template<typename T>
testing::AssertionResult ExpectEq<T>::Check(const void* data, size_t size) {
- NXT_ASSERT(size == sizeof(T) * mExpected.size());
+ DAWN_ASSERT(size == sizeof(T) * mExpected.size());
const T* actual = reinterpret_cast<const T*>(data);
diff --git a/src/tests/end2end/InputStateTests.cpp b/src/tests/end2end/InputStateTests.cpp
index b8d7621..a14ac14 100644
--- a/src/tests/end2end/InputStateTests.cpp
+++ b/src/tests/end2end/InputStateTests.cpp
@@ -54,7 +54,7 @@
case VertexFormat::FloatR32:
return component >= 1;
default:
- NXT_UNREACHABLE();
+ DAWN_UNREACHABLE();
}
}
diff --git a/src/tests/unittests/BitSetIteratorTests.cpp b/src/tests/unittests/BitSetIteratorTests.cpp
index 4bffd61..cc6c3ed 100644
--- a/src/tests/unittests/BitSetIteratorTests.cpp
+++ b/src/tests/unittests/BitSetIteratorTests.cpp
@@ -51,7 +51,7 @@
// causing an unreachable code warning in MSVS
bool sawBit = false;
for (unsigned long bit : IterateBitSet(mStateBits)) {
- NXT_UNUSED(bit);
+ DAWN_UNUSED(bit);
sawBit = true;
}
EXPECT_FALSE(sawBit);
diff --git a/src/tests/unittests/ErrorTests.cpp b/src/tests/unittests/ErrorTests.cpp
index a11c5b0..925ca57 100644
--- a/src/tests/unittests/ErrorTests.cpp
+++ b/src/tests/unittests/ErrorTests.cpp
@@ -178,7 +178,7 @@
auto Try = [ReturnError]() -> ResultOrError<int*> {
int* result = nullptr;
DAWN_TRY_ASSIGN(result, ReturnError());
- NXT_UNUSED(result);
+ DAWN_UNUSED(result);
// DAWN_TRY should return before this point
EXPECT_FALSE(true);
@@ -233,7 +233,7 @@
auto Try = [ReturnError]() -> MaybeError {
int* result = nullptr;
DAWN_TRY_ASSIGN(result, ReturnError());
- NXT_UNUSED(result);
+ DAWN_UNUSED(result);
return {};
};
diff --git a/src/tests/unittests/SerialQueueTests.cpp b/src/tests/unittests/SerialQueueTests.cpp
index accdedd..2c45c2f 100644
--- a/src/tests/unittests/SerialQueueTests.cpp
+++ b/src/tests/unittests/SerialQueueTests.cpp
@@ -27,7 +27,7 @@
// Iterating on empty queue 1) works 2) doesn't produce any values
for (int value : queue.IterateAll()) {
- NXT_UNUSED(value);
+ DAWN_UNUSED(value);
ASSERT_TRUE(false);
}
@@ -50,7 +50,7 @@
ASSERT_TRUE(queue.Empty());
for (int value : queue.IterateAll()) {
- NXT_UNUSED(value);
+ DAWN_UNUSED(value);
ASSERT_TRUE(false);
}
}
diff --git a/src/utils/OpenGLBinding.cpp b/src/utils/OpenGLBinding.cpp
index fcfe673..8e7e64a 100644
--- a/src/utils/OpenGLBinding.cpp
+++ b/src/utils/OpenGLBinding.cpp
@@ -99,7 +99,7 @@
class OpenGLBinding : public BackendBinding {
public:
void SetupGLFWWindowHints() override {
-#if defined(NXT_PLATFORM_APPLE)
+#if defined(DAWN_PLATFORM_APPLE)
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 4);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 1);
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GLFW_TRUE);
diff --git a/src/utils/SystemUtils.cpp b/src/utils/SystemUtils.cpp
index aa54d24..b72a2ca 100644
--- a/src/utils/SystemUtils.cpp
+++ b/src/utils/SystemUtils.cpp
@@ -14,9 +14,9 @@
#include "common/Platform.h"
-#if defined(NXT_PLATFORM_WINDOWS)
+#if defined(DAWN_PLATFORM_WINDOWS)
# include <Windows.h>
-#elif defined(NXT_PLATFORM_POSIX)
+#elif defined(DAWN_PLATFORM_POSIX)
# include <unistd.h>
#else
# error "Unsupported platform."
@@ -24,11 +24,11 @@
namespace utils {
-#if defined(NXT_PLATFORM_WINDOWS)
+#if defined(DAWN_PLATFORM_WINDOWS)
void USleep(unsigned int usecs) {
Sleep(static_cast<DWORD>(usecs / 1000));
}
-#elif defined(NXT_PLATFORM_POSIX)
+#elif defined(DAWN_PLATFORM_POSIX)
void USleep(unsigned int usecs) {
usleep(usecs);
}