MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ gpu_data_format_bytes()

MAYAFLUX_API size_t MayaFlux::Kakshya::gpu_data_format_bytes ( GpuDataFormat  fmt)
noexcept

Byte size of one element of a GpuDataFormat.

Single authoritative source for format sizing. Used by TextureAccess, ShaderSpec, and any other system that needs to derive byte counts from GpuDataFormat without duplicating the switch.

Parameters
fmtGpuDataFormat value.
Returns
Byte size of one element, or 0 for unrecognised formats.

Definition at line 5 of file GpuDataFormat.cpp.

6{
7 switch (fmt) {
8 case GpuDataFormat::UINT8:
9 return 1;
10 case GpuDataFormat::UINT16:
11 return 2;
12 case GpuDataFormat::FLOAT32:
13 case GpuDataFormat::INT32:
14 case GpuDataFormat::UINT32:
15 return 4;
16 case GpuDataFormat::FLOAT64:
17 case GpuDataFormat::VEC2_F32:
18 return 8;
19 case GpuDataFormat::VEC3_F32:
20 return 12;
21 case GpuDataFormat::VEC4_F32:
22 case GpuDataFormat::VEC2_F64:
23 return 16;
24 case GpuDataFormat::VEC3_F64:
25 return 24;
26 case GpuDataFormat::VEC4_F64:
27 return 32;
28 case GpuDataFormat::MAT4_F32:
29 return 64;
30 default:
31 return 0;
32 }
33}

References FLOAT32, FLOAT64, INT32, MAT4_F32, UINT16, UINT32, UINT8, VEC2_F32, VEC2_F64, VEC3_F32, VEC3_F64, VEC4_F32, and VEC4_F64.

Referenced by MayaFlux::Buffers::FormaBindingsProcessor::bind_push_constant(), MayaFlux::Kakshya::TextureAccess::bytes_per_texel(), MayaFlux::Portal::Graphics::element_type_bytes(), MayaFlux::Buffers::ShaderProcessor::feed(), MayaFlux::Buffers::FormaBindingsProcessor::flush_typed_push_constant(), gpu_block_layout(), and pack_gpu_components().

+ Here is the caller graph for this function: