Module vulkano::format [−][src]
Expand description
All the formats of images supported by Vulkan.
Formats
List of suffixes:
-
Unorm
means that the values are unsigned integers that are converted into floating points. The maximum possible representable value becomes1.0
, and the minimum representable value becomes0.0
. For example the value255
in aR8Unorm
will be interpreted as1.0
. -
Snorm
is the same asUnorm
, but the integers are signed and the range is from-1.0
to1.0
instead. -
Uscaled
means that the values are unsigned integers that are converted into floating points. No change in the value is done. For example the value255
in aR8Uscaled
will be interpreted as255.0
. -
Sscaled
is the same asUscaled
expect that the integers are signed. -
Uint
means that the values are unsigned integers. No conversion is performed. -
Sint
means that the values are signed integers. No conversion is performed. -
Ufloat
means that the values are unsigned floating points. No conversion is performed. This format is very unusual. -
Sfloat
means that the values are regular floating points. No conversion is performed. -
Srgb
is the same asUnorm
, except that the value is interpreted as being in the sRGB color space. This means that its value will be converted to fit in the RGB color space when it is read. The fourth channel (usually used for alpha), if present, is not concerned by the conversion.
Choosing a format
The following formats are guaranteed to be supported for everything that is related to texturing (ie. blitting source and sampling them linearly). You should choose one of these formats if you have an image that you are going to sample from:
- B4G4R4A4UnormPack16
- R5G6B5UnormPack16
- A1R5G5B5UnormPack16
- R8Unorm
- R8Snorm
- R8G8Unorm
- R8G8Snorm
- R8G8B8A8Unorm
- R8G8B8A8Snorm
- R8G8B8A8Srgb
- B8G8R8A8Unorm
- B8G8R8A8Srgb
- A8B8G8R8UnormPack32
- A8B8G8R8SnormPack32
- A8B8G8R8SrgbPack32
- A2B10G10R10UnormPack32
- R16Sfloat
- R16G16Sfloat
- R16G16B16A16Sfloat
- B10G11R11UfloatPack32
- E5B9G9R9UfloatPack32
The following formats are guaranteed to be supported for everything that is related to intermediate render targets (ie. blitting destination, color attachment and sampling linearly):
- R5G6B5UnormPack16
- A1R5G5B5UnormPack16
- R8Unorm
- R8G8Unorm
- R8G8B8A8Unorm
- R8G8B8A8Srgb
- B8G8R8A8Unorm
- B8G8R8A8Srgb
- A8B8G8R8UnormPack32
- A8B8G8R8SrgbPack32
- A2B10G10R10UnormPack32
- R16Sfloat
- R16G16Sfloat
- R16G16B16A16Sfloat
For depth images, only D16Unorm
is guaranteed to be supported. For depth-stencil images,
it is guaranteed that either D24Unorm_S8Uint
or D32Sfloat_S8Uint
are supported.
// TODO: storage formats
Structs
FormatFeatures | The features supported by images with a particular format. |
FormatProperties | The properties of an image format that are supported by a physical device. |
IncompatiblePixelsType |
Enums
ClearValue | Describes a uniform value that will be used to fill an image. |
Format | An enumeration of all the possible formats. |
FormatTy |
Traits
ClearValuesTuple | |
Pixel | Trait for Rust types that can represent a pixel in an image. |