vkCreateImageView
函数原型
VkResult vkCreateImageView(
VkDevice device,
const VkImageViewCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkImageView* pView);
描述
创建一个imageview。
参数
device
: 用于创建imageview的逻辑设备。pCreateInfo
:VkImageViewCreateInfo
结构体指针,包含创建imageview的信息。pAllocator
:host memory
分配器。pView
: 创建返回的imageview句柄。
补充
VkImageViewCreateInfo
结构体定义:
typedef struct VkImageViewCreateInfo {
VkStructureType sType;
const void* pNext;
VkImageViewCreateFlags flags; //描述imageview的额外标记
VkImage image; //用于创建imageview的image
VkImageViewType viewType; //指定imageview的类型
VkFormat format; //描述image中纹素的格式和类型
VkComponentMapping components; //描述颜色分量的重新映射(或深度模板分量在转换为颜色分量后)
VkImageSubresourceRange subresourceRange; //mipmap级别以及imageview可访问的layers
} VkImageViewCreateInfo;
VkImageViewCreateFlags
枚举定义:
typedef enum VkImageViewCreateFlagBits {
// Provided by VK_EXT_fragment_density_map
VK_IMAGE_VIEW_CREATE_FRAGMENT_DENSITY_MAP_DYNAMIC_BIT_EXT = 0x00000001,
// Provided by VK_EXT_fragment_density_map2
VK_IMAGE_VIEW_CREATE_FRAGMENT_DENSITY_MAP_DEFERRED_BIT_EXT = 0x00000002,
} VkImageViewCreateFlagBits;