Kanzi 4.0.0-beta2
utilities.hpp File Reference

Namespaces

namespace  kanzi
 
namespace  kanzi::gfx
 

Functions

constexpr v2u32 kanzi::gfx::calculateDimensionsForMip (v2u32 dims, uint8_t mip)
 Calculates the dimensions of a 2-dimensional mip level.
 
constexpr v3u32 kanzi::gfx::calculateDimensionsForMip (v3u32 dims, uint8_t mip)
 Calculates the dimensions of a 3-dimensional mip level.
 
KANZI_GFX_API ChannelType kanzi::gfx::formatToChannelType (Format format)
 Gets the channel encoding type for a graphics format.
 
KANZI_GFX_API v2u8 kanzi::gfx::getBlockSize (Format format)
 Gets the block size in pixels of a compressed format.
 
KANZI_GFX_API uint32_t kanzi::gfx::getBlockStride (Format format)
 Gets the block stride in bytes for a compressed graphics format.
 
KANZI_GFX_API uint32_t kanzi::gfx::getChannelCount (Format format)
 Gets the number of color and alpha channels in a graphics format.
 
KANZI_GFX_API v4u8 kanzi::gfx::getColorBits (Format format)
 Gets the number of bits used to represent each color and alpha channel.
 
KANZI_GFX_API v2u8 kanzi::gfx::getDepthStencilBits (Format format)
 Gets the number of bits used to represent each depth and stencil channel.
 
uint8_t kanzi::gfx::getFaceCount (gfx::ImageType type)
 Gets the face count for a given resource type.
 
KANZI_GFX_API AspectMask kanzi::gfx::getFormatAspects (Format format)
 Gets the aspect mask for a given graphics format.
 
KANZI_GFX_API FormatFeatureFlag kanzi::gfx::getFormatFeatures (Format format)
 Gets device feature flags for a format for the current backend and device.
 
KANZI_GFX_API size_t kanzi::gfx::getImageSize (Format format, v3u32 dimensions)
 Gets the size in bytes of an image with the specified format and dimensions.
 
uint32_t kanzi::gfx::getIndexBufferStride (IndexBufferType type)
 Gets the stride in bytes of an index buffer type.
 
KANZI_GFX_API uint32_t kanzi::gfx::getPixelStride (Format format)
 Gets the pixel stride in bytes for an uncompressed graphics format.
 
constexpr ShaderFormatFamily kanzi::gfx::getShaderFormatFamily (ShaderFormat format)
 Gets the Shader format family for a given shader format.
 
KANZI_GFX_API platform::SurfaceBits kanzi::gfx::getSurfaceBitsFromFormat (Format color, Format depthStencil=Format::None)
 Converts a color and depth stencil Format into a SurfaceBits structure.
 
KANZI_GFX_API bool kanzi::gfx::isAlpha (Format format)
 Returns whether a graphics format contains an alpha channel.
 
KANZI_GFX_API bool kanzi::gfx::isAstcHdrCompressed (Format format)
 Returns whether a graphics format is ASTC HDR compressed.
 
KANZI_GFX_API bool kanzi::gfx::isColor (Format format)
 Returns whether a graphics format contains a color channel.
 
KANZI_GFX_API bool kanzi::gfx::isCompressed (Format format)
 Returns whether a graphics format is compressed.
 
KANZI_GFX_API bool kanzi::gfx::isDepth (Format format)
 Returns whether a graphics format contains a depth channel.
 
KANZI_GFX_API bool kanzi::gfx::isSRGBEncoded (Format format)
 Returns whether the color channels of a graphics format are sRGB-encoded.
 
KANZI_GFX_API bool kanzi::gfx::isStencil (Format format)
 Returns whether a graphics format contains a stencil channel.
 
KANZI_GFX_API FixedString kanzi::gfx::toFixedString (FilterMode filter)
 Gets a string representation of a filter mode.
 
KANZI_GFX_API string kanzi::gfx::toString (DevicePropertyId propertyId)
 Gets the device property identifier as a string.
 
KANZI_GFX_API string kanzi::gfx::toString (FeatureId feature)
 Gets the Feature identifier as a string.
 
KANZI_GFX_API string kanzi::gfx::toString (ShaderFormat format)
 Gets the shader format as a string.
 
KANZI_GFX_API string kanzi::gfx::toString (ShaderStage stage)
 Gets the shader stage as a string.
 
Format kanzi::gfx::tryGetDepthStencilFromSurfaceBits (const platform::SurfaceBits &properties)
 Matches a SurfaceBits structure to a depth stencil graphics format.
 
Format kanzi::gfx::tryGetFormatFromSurfaceBits (const platform::SurfaceBits &properties)
 Matches a SurfaceBits structure to a graphics format.