Some types of Vulkan objects are used in many different structures and command parameters, and are described here. These types include offsets, extents, and rectangles.
Offsets are used to describe a pixel location within an image or framebuffer, as an (x,y) location for two-dimensional images, or an (x,y,z) location for three-dimensional images.
A two-dimensional offsets is defined by the structure:
typedef struct VkOffset2D { int32_t x; int32_t y; } VkOffset2D;
A three-dimensional offset is defined by the structure:
typedef struct VkOffset3D { int32_t x; int32_t y; int32_t z; } VkOffset3D;
Extents are used to describe the size of a rectangular region of pixels within an image or framebuffer, as (width,height) for two-dimensional images, or as (width,height,depth) for three-dimensional images.
A two-dimensional extent is defined by the structure:
typedef struct VkExtent2D { uint32_t width; uint32_t height; } VkExtent2D;
A three-dimensional extent is defined by the structure:
typedef struct VkExtent3D { uint32_t width; uint32_t height; uint32_t depth; } VkExtent3D;
Rectangles are used to describe a specified rectangular region of pixels within an image or framebuffer. Rectangles include both an offset and an extent of the same dimensionality, as described above. Two-dimensional rectangles are defined by the structure
typedef struct VkRect2D { VkOffset2D offset; VkExtent2D extent; } VkRect2D;