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

◆ gpu_data_format_align()

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

Base alignment in bytes of one element, following std430 rules.

Differs from gpu_data_format_bytes for three-component vectors, which align as four.

Parameters
fmtGpuDataFormat value.
Returns
Alignment in bytes, or 0 for unrecognised formats.

Definition at line 35 of file GpuDataFormat.cpp.

36{
37 switch (fmt) {
38 case GpuDataFormat::UINT8:
39 return 1;
40 case GpuDataFormat::UINT16:
41 return 2;
42 case GpuDataFormat::FLOAT32:
43 case GpuDataFormat::INT32:
44 case GpuDataFormat::UINT32:
45 return 4;
46 case GpuDataFormat::FLOAT64:
47 case GpuDataFormat::VEC2_F32:
48 return 8;
49 case GpuDataFormat::VEC3_F32:
50 case GpuDataFormat::VEC4_F32:
51 case GpuDataFormat::MAT4_F32:
52 case GpuDataFormat::VEC2_F64:
53 return 16;
54 case GpuDataFormat::VEC3_F64:
55 case GpuDataFormat::VEC4_F64:
56 return 32;
57 default:
58 return 0;
59 }
60}

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

Referenced by gpu_block_layout().

+ Here is the caller graph for this function: