8 if (width == 0 || count > (std::numeric_limits<size_t>::max() - 7) / width)
10 return (
static_cast<size_t>(count) * width + 7) / 8;
18 base =
"i" + std::to_string(
bits);
21 base =
"u" + std::to_string(
bits);
24 base =
"f" + std::to_string(
bits);
27 base =
"handle" + std::to_string(
bits);
30 base =
"bf" + std::to_string(
bits);
33 base =
"c" + std::to_string(
bits);
45 base =
"f8e4m3b11fnuz";
72 base =
"bc" + std::to_string(
bits);
75 return lanes == 1 ? base : base +
"x" + std::to_string(
lanes);
@ VEC3_F64
glm::dvec3 (64-bit components)
@ FLOAT64
64-bit double (audio precision)
@ UINT16
uint16_t, R16F raw half-float storage, packed formats
@ VEC2_F64
glm::dvec2 (64-bit components)
@ VEC2_F32
glm::vec2 (32-bit components)
@ VEC4_F32
glm::vec4 (32-bit components)
@ VEC4_F64
glm::dvec4 (64-bit components)
@ FLOAT32
32-bit float (standard GPU)
@ VEC3_F32
glm::vec3 (32-bit components), not a sampled image format
@ UINT8
uint8_t, R8 / RGBA8 texel data
constexpr size_t element_bits() const noexcept
Bits of one element, lanes included.
std::optional< GpuDataFormat > gpu_format() const noexcept
GpuDataFormat holding exactly this element, when one exists.
std::optional< size_t > storage_bytes(uint64_t count) const noexcept
Packed bytes needed for count elements.
std::string name() const
Short readable name such as f32, bf16, i64, u8.