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

◆ element_type_bytes()

size_t MayaFlux::Portal::Graphics::element_type_bytes ( GpuBufferBinding::ElementType  et)
noexcept

Byte width of one GpuBufferBinding::ElementType element.

Bridges to Kakshya::gpu_data_format_bytes for FLOAT32/UINT32/INT32, the single authoritative sizing source. Returns 0 for PASSTHROUGH, IMAGE_STORAGE, and IMAGE_SAMPLED, which carry no fixed element width.

Parameters
etElementType to size.
Returns
Byte width, or 0 if unsized.

Definition at line 7 of file GraphicsUtils.cpp.

8{
9 switch (et) {
10 case GpuBufferBinding::ElementType::FLOAT32:
11 return Kakshya::gpu_data_format_bytes(Kakshya::GpuDataFormat::FLOAT32);
12 case GpuBufferBinding::ElementType::UINT32:
13 return Kakshya::gpu_data_format_bytes(Kakshya::GpuDataFormat::UINT32);
14 case GpuBufferBinding::ElementType::INT32:
15 return Kakshya::gpu_data_format_bytes(Kakshya::GpuDataFormat::INT32);
16 case GpuBufferBinding::ElementType::PASSTHROUGH:
17 case GpuBufferBinding::ElementType::IMAGE_STORAGE:
18 case GpuBufferBinding::ElementType::IMAGE_SAMPLED:
19 default:
20 return 0;
21 }
22}

References MayaFlux::Kakshya::FLOAT32, MayaFlux::Portal::Graphics::GpuBufferBinding::FLOAT32, MayaFlux::Kakshya::gpu_data_format_bytes(), MayaFlux::Portal::Graphics::GpuBufferBinding::IMAGE_SAMPLED, MayaFlux::Portal::Graphics::GpuBufferBinding::IMAGE_STORAGE, MayaFlux::Kakshya::INT32, MayaFlux::Portal::Graphics::GpuBufferBinding::INT32, MayaFlux::Portal::Graphics::GpuBufferBinding::PASSTHROUGH, MayaFlux::Kakshya::UINT32, and MayaFlux::Portal::Graphics::GpuBufferBinding::UINT32.

Referenced by MayaFlux::Yantra::GpuResourceManager::ensure_shared_buffer().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: