Move Vectormath main
C++20 game and graphics mathematics
Loading...
Searching...
No Matches
LayoutTraits.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <cstddef>
4#include <span>
5#include <type_traits>
6
7#include <mv/math/Vec3.hpp>
9
10namespace mv::math
11{
12 enum class GpuLayout
13 {
16 };
17
18 template <typename T, GpuLayout Layout>
19 inline constexpr bool IsGpuLayoutCompatible = false;
20
21 template <>
22 inline constexpr bool
24
25 template <>
26 inline constexpr bool
28 true;
29
30 template <>
31 inline constexpr bool
33
34 template <GpuLayout Layout, typename T>
36 [[nodiscard]] std::span<const std::byte> AsGpuBytes(
37 std::span<const T> values) noexcept
38 {
39 return std::as_bytes(values);
40 }
41} // namespace mv::math
42
43static_assert(
46static_assert(
49static_assert(
Vec3< float > Vec3f
Definition Vec3.hpp:344
std::span< const std::byte > AsGpuBytes(std::span< const T > values) noexcept
constexpr bool IsGpuLayoutCompatible