- Created Layout for Textures
- Separated Build and Output directories
This commit is contained in:
@@ -21,7 +21,7 @@
|
||||
#define FENNEC_LANG_BITS_H
|
||||
|
||||
#include <fennec/lang/intrinsics.h>
|
||||
#include <fennec/memory/memory.h>
|
||||
#include <fennec/lang/detail/__bits.h>
|
||||
|
||||
namespace fennec
|
||||
{
|
||||
@@ -46,6 +46,20 @@ constexpr ToT bit_cast(const FromT& from)
|
||||
}
|
||||
}
|
||||
|
||||
constexpr void* bitmask(void* arr, const void* mask, size_t n)
|
||||
{
|
||||
if (arr == mask) return arr;
|
||||
uint8_t* d = static_cast<uint8_t*>(arr);
|
||||
const uint8_t* s = static_cast<const uint8_t*>(mask);
|
||||
|
||||
while (n >= 8) { detail::__bitmask_64(d, s); d += 8; s += 8; n -= 8; }
|
||||
while (n >= 4) { detail::__bitmask_32(d, s); d += 4; s += 4; n -= 4; }
|
||||
while (n >= 2) { detail::__bitmask_16(d, s); d += 2; s += 2; n -= 2; }
|
||||
while (n >= 1) { *d++ = *s++; --n; }
|
||||
|
||||
return arr;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif // FENNEC_LANG_BITS_H
|
||||
|
||||
Reference in New Issue
Block a user