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

◆ gpu_data_format_components()

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

Number of scalar components in one element of a GpuDataFormat.

Parameters
fmtGpuDataFormat value.
Returns
1 for scalars, 2 to 4 for vectors, 16 for MAT4_F32, 0 for unrecognised formats.

Definition at line 62 of file GpuDataFormat.cpp.

63{
64 switch (fmt) {
65 case GpuDataFormat::FLOAT32:
66 case GpuDataFormat::FLOAT64:
67 case GpuDataFormat::INT32:
68 case GpuDataFormat::UINT32:
69 case GpuDataFormat::UINT8:
70 case GpuDataFormat::UINT16:
71 return 1;
72 case GpuDataFormat::VEC2_F32:
73 case GpuDataFormat::VEC2_F64:
74 return 2;
75 case GpuDataFormat::VEC3_F32:
76 case GpuDataFormat::VEC3_F64:
77 return 3;
78 case GpuDataFormat::VEC4_F32:
79 case GpuDataFormat::VEC4_F64:
80 return 4;
81 case GpuDataFormat::MAT4_F32:
82 return 16;
83 default:
84 return 0;
85 }
86}

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(), and pack_gpu_components().

+ Here is the caller graph for this function: