23 enum class state_type { uninitialized, drawing, uploaded };
50 [[nodiscard]]
constexpr explicit operator bool()
const noexcept
52 return device !=
nullptr;
55 [[nodiscard]]
constexpr extent2 size()
const noexcept
57 return extent2{narrow_cast<float>(width), narrow_cast<float>(height)};
62 hilet num_columns = (width + page_size - 1) / page_size;
63 hilet num_rows = (height + page_size - 1) / page_size;
64 return {num_columns, num_rows};
67 [[nodiscard]]
constexpr extent2 size_in_float_pages()
const noexcept
69 constexpr auto page_size_ = f32x4{narrow_cast<float>(page_size), narrow_cast<float>(page_size), 1.0f, 1.0f};
70 auto size = f32x4{narrow_cast<float>(width), narrow_cast<float>(height)};
71 return extent2{size / page_size_};