18 #include <system_error>
21 inline namespace _V1 {
22 namespace ext::oneapi::experimental {
81 "Invalid descriptor `image_type` passed to "
82 "`get_mip_level_desc`. A mipmap level descriptor can only be "
83 "requested by a descriptor with mipmap image type!");
87 size_t width = std::max<size_t>(this->width >>
level, 1);
88 size_t height = this->height == 0
90 : std::max<size_t>(this->height >>
level, 1);
92 : std::max<size_t>(this->depth >>
level, 1);
104 switch (this->type) {
106 if (this->array_size > 1) {
110 "Standard images cannot have array_size greater than 1! Use "
111 "image_type::array for image arrays.");
113 if (this->num_levels > 1) {
117 "Standard images cannot have num_levels greater than 1! Use "
118 "image_type::mipmap for mipmap images.");
123 if (this->array_size <= 1) {
126 "Image array must have array_size greater than "
127 "1! Use image_type::standard otherwise.");
129 if (this->depth != 0) {
132 "Cannot have 3D image arrays! Either depth must "
133 "be 0 or array_size must be 1.");
135 if (this->num_levels != 1) {
138 "Cannot have mipmap image arrays! Either "
139 "num_levels or array_size must be 1.");
144 if (this->array_size > 1) {
148 "Mipmap images cannot have array_size greater than 1! Use "
149 "image_type::array for image arrays.");
151 if (this->num_levels <= 1) {
154 "Mipmap images must have num_levels greater than "
155 "1! Use image_type::standard otherwise.");
160 if (this->array_size != 6) {
163 "Cubemap images must have array_size of 6 only! "
164 "Use image_type::array instead.");
166 if (this->depth != 0 || this->height == 0 ||
167 this->width != this->height) {
171 "Cubemap images must be square with valid and equivalent width and "
172 "height! Use image_type::array instead.");
174 if (this->num_levels != 1) {
177 "Cannot have mipmap cubemaps! Either num_levels "
178 "or array_size must be 1.");
const CoordT const float level
image_type
image type enum
A struct to describe the properties of an image.
image_channel_order channel_order
image_descriptor(range< 1 > dims, image_channel_order channel_order, image_channel_type channel_type, image_type type=image_type::standard, unsigned int num_levels=1, unsigned int array_size=1)
image_descriptor()=default
image_descriptor(range< 2 > dims, image_channel_order channel_order, image_channel_type channel_type, image_type type=image_type::standard, unsigned int num_levels=1, unsigned int array_size=1)
image_descriptor get_mip_level_desc(unsigned int level) const
Get the descriptor for a mipmap level.
image_descriptor(range< 3 > dims, image_channel_order channel_order, image_channel_type channel_type, image_type type=image_type::standard, unsigned int num_levels=1, unsigned int array_size=1)
image_channel_type channel_type