The VkClearColorValue
structure is defined as:
typedef union VkClearColorValue { float float32[4]; int32_t int32[4]; uint32_t uint32[4]; } VkClearColorValue;
float32
are the color clear values when the format of the image or
attachment is one of the formats in the
Interpretation of Numeric Format
table other than signed integer (SINT
) or unsigned integer
(UINT
).
Floating point values are automatically converted to the format of the
image, with the clear value being treated as linear if the image is
sRGB.
int32
are the color clear values when the format of the image or
attachment is signed integer (SINT
).
Signed integer values are converted to the format of the image by
casting to the smaller type (with negative 32-bit values mapping to
negative values in the smaller type).
If the integer clear value is not representable in the target type (e.g.
would overflow in conversion to that type), the clear value is
undefined.
uint32
are the color clear values when the format of the image or
attachment is unsigned integer (UINT
).
Unsigned integer values are converted to the format of the image by
casting to the integer type with fewer bits.
The four array elements of the clear color map to R, G, B, and A components of image formats, in order.
If the image has more than one sample, the same value is written to all samples for any pixels being cleared.
The VkClearDepthStencilValue
structure is defined as:
typedef struct VkClearDepthStencilValue { float depth; uint32_t stencil; } VkClearDepthStencilValue;
depth
is the clear value for the depth aspect of the depth/stencil
attachment.
It is a floating-point value which is automatically converted to the
attachment’s format.
stencil
is the clear value for the stencil aspect of the
depth/stencil attachment.
It is a 32-bit integer value which is converted to the attachment’s
format by taking the appropriate number of LSBs.
The VkClearValue
union is defined as:
typedef union VkClearValue { VkClearColorValue color; VkClearDepthStencilValue depthStencil; } VkClearValue;
color
specifies the color image clear values to use when clearing
a color image or attachment.
depthStencil
specifies the depth and stencil clear values to use
when clearing a depth/stencil image or attachment.
This union is used where part of the API requires either color or
depth/stencil clear values, depending on the attachment, and defines the
initial clear values in the VkRenderPassBeginInfo
structure.