VPP  0.8
A high-level modern C++ API for Vulkan
vpp::ImageViewAttributes< ImageT, SAMPLING, FormatT, ASPECTS, CUBE > Struct Template Reference

A template encoding image view attributes inside C++ type. More...

#include <vppImageView.hpp>

Detailed Description

template<class ImageT, ESamplingMode SAMPLING = SAMPLER_NORMALIZED, class FormatT = typename ImageT::format_type, unsigned int ASPECTS = FormatT::aspects, ECubeMode CUBE = CUBE_ALLOW>
struct vpp::ImageViewAttributes< ImageT, SAMPLING, FormatT, ASPECTS, CUBE >

A template encoding image view attributes inside C++ type.

Advanced image usage in VPP (e.g. in shader code) requires that certain image attributes are known at compile time. This template allows to encode these attributes. This is additional template you should typedef additionally to Image template, in order to define ypour image type.

Template Parameters
ImageTInstance of Image< ... > template specifying the image type.
SAMPLINGType of sampler to be associated with this image. Usually SAMPLER_NORMALIZED.
FormatTFormat class to override image format.
ASPECTSAspect mask.
CUBEWhether cube maps are supported by this view.

If you specify the format (which is optional), it will override declared format of the image. This is quite like to reinterpret_cast or union in C++. The formats should be compatible, which means that single pixel should occupy same area in memory. The pixel data will be reinterpreted according to the new format. See section 30.3.1 in official Vulkan docs (Format Compatibility Classes) for complete list of compatible formats.

An example:

typedef vpp::format< vpp::unorm8_t, vpp::unorm8_t, vpp::unorm8_t, vpp::unorm8_t > MyColorFormat;
MyColorFormat,
vpp::IMG_TYPE_2D,
VK_IMAGE_TILING_OPTIMAL,
VK_SAMPLE_COUNT_1_BIT,
false,
false
> MyColorBufferAttr;
typedef vpp::ImageViewAttributes< MyImage > MyImageViewAttr;

The documentation for this struct was generated from the following file: