Started refactor to lazily compilable shaders.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#define DEFINE_ENUM_FLAG_OPERATORS(ENUM_TYPE) \
|
||||
#define DEFINE_ENUM_BITFIELD_OPERATORS(ENUM_TYPE) \
|
||||
[[nodiscard]] constexpr ENUM_TYPE operator|( \
|
||||
const ENUM_TYPE lhs, const ENUM_TYPE rhs \
|
||||
) { \
|
||||
@@ -35,6 +35,24 @@
|
||||
); \
|
||||
} \
|
||||
\
|
||||
constexpr ENUM_TYPE operator<<( \
|
||||
ENUM_TYPE& lhs, \
|
||||
int shift \
|
||||
) { \
|
||||
return static_cast<ENUM_TYPE>( \
|
||||
static_cast<std::underlying_type_t<ENUM_TYPE>>(lhs) << shift \
|
||||
); \
|
||||
} \
|
||||
\
|
||||
constexpr ENUM_TYPE operator<<( \
|
||||
ENUM_TYPE& lhs, \
|
||||
int shift \
|
||||
) { \
|
||||
return static_cast<ENUM_TYPE>( \
|
||||
static_cast<std::underlying_type_t<ENUM_TYPE>>(lhs) << shift \
|
||||
); \
|
||||
} \
|
||||
\
|
||||
constexpr ENUM_TYPE& operator|=( \
|
||||
ENUM_TYPE& lhs, \
|
||||
const ENUM_TYPE rhs \
|
||||
@@ -54,4 +72,18 @@ constexpr ENUM_TYPE& operator^=( \
|
||||
const ENUM_TYPE rhs \
|
||||
) { \
|
||||
return lhs = lhs ^ rhs; \
|
||||
} \
|
||||
\
|
||||
constexpr ENUM_TYPE& operator<<=( \
|
||||
ENUM_TYPE& lhs, \
|
||||
const int shift \
|
||||
) { \
|
||||
return lhs = lhs << shift; \
|
||||
} \
|
||||
\
|
||||
constexpr ENUM_TYPE& operator>>=( \
|
||||
ENUM_TYPE& lhs, \
|
||||
const int shift \
|
||||
) { \
|
||||
return lhs = lhs >> shift; \
|
||||
}
|
||||
Reference in New Issue
Block a user