Lines Matching refs:image

52       unreachable("invalid image type");
58 struct vk_image *image,
61 vk_object_base_init(device, &image->base, VK_OBJECT_TYPE_IMAGE);
76 image->create_flags = pCreateInfo->flags;
77 image->image_type = pCreateInfo->imageType;
78 vk_image_set_format(image, pCreateInfo->format);
79 image->extent = sanitize_image_extent(pCreateInfo->imageType,
81 image->mip_levels = pCreateInfo->mipLevels;
82 image->array_layers = pCreateInfo->arrayLayers;
83 image->samples = pCreateInfo->samples;
84 image->tiling = pCreateInfo->tiling;
85 image->usage = pCreateInfo->usage;
87 if (image->aspects & VK_IMAGE_ASPECT_STENCIL_BIT) {
91 image->stencil_usage =
95 image->stencil_usage = 0;
101 image->external_handle_types = ext_mem_info->handleTypes;
103 image->external_handle_types = 0;
107 image->wsi_legacy_scanout = wsi_info && wsi_info->scanout;
110 image->drm_format_mod = ((1ULL << 56) - 1) /* DRM_FORMAT_MOD_INVALID */;
117 assert(image->format == VK_FORMAT_UNDEFINED);
118 assert(image->external_handle_types &
120 image->android_external_format = ext_format->externalFormat;
122 image->android_external_format = 0;
133 struct vk_image *image =
136 if (image == NULL)
139 vk_image_init(device, image, pCreateInfo);
141 return image;
145 vk_image_finish(struct vk_image *image)
147 vk_object_base_finish(&image->base);
153 struct vk_image *image)
155 vk_object_free(device, alloc, image);
164 VK_FROM_HANDLE(vk_image, image, _image);
169 assert(image->tiling == VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT);
170 pProperties->drmFormatModifier = image->drm_format_mod;
177 vk_image_set_format(struct vk_image *image, VkFormat format)
179 image->format = format;
180 image->aspects = vk_format_aspects(format);
184 vk_image_usage(const struct vk_image *image,
187 assert(!(aspect_mask & ~image->aspects));
191 * "If the image was has a depth-stencil format and was created with
208 return image->stencil_usage;
211 return image->usage & image->stencil_usage;
214 return image->usage;
224 /** Expands the given aspect mask relative to the image
226 * If the image has color plane aspects VK_IMAGE_ASPECT_COLOR_BIT has been
227 * requested, this returns the aspects of the underlying image.
239 * for an image of format VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM.
242 vk_image_expand_aspect_mask(const struct vk_image *image,
246 assert(image->aspects & VK_IMAGE_ASPECT_ANY_COLOR_MASK_MESA);
247 return image->aspects;
249 assert(aspect_mask && !(aspect_mask & ~image->aspects));
255 vk_image_extent_to_elements(const struct vk_image *image, VkExtent3D extent)
258 vk_format_description(image->format);
260 extent = vk_image_sanitize_extent(image, extent);
269 vk_image_offset_to_elements(const struct vk_image *image, VkOffset3D offset)
272 vk_format_description(image->format);
274 offset = vk_image_sanitize_offset(image, offset);
288 vk_image_buffer_copy_layout(const struct vk_image *image,
291 VkExtent3D extent = vk_image_sanitize_extent(image, region->imageExtent);
299 VkFormat format = vk_format_get_aspect_format(image->format, aspect);
334 VK_FROM_HANDLE(vk_image, image, pCreateInfo->image);
337 image_view->image = image;
345 assert(image->image_type == VK_IMAGE_TYPE_1D);
349 if (image->create_flags & (VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT |
351 assert(image->image_type == VK_IMAGE_TYPE_3D);
353 assert(image->image_type == VK_IMAGE_TYPE_2D);
356 assert(image->image_type == VK_IMAGE_TYPE_3D);
360 assert(image->image_type == VK_IMAGE_TYPE_2D);
361 assert(image->create_flags & VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT);
364 unreachable("Invalid image view type");
376 if (image->aspects == VK_IMAGE_ASPECT_COLOR_BIT ||
377 image->aspects == VK_IMAGE_ASPECT_DEPTH_BIT ||
378 image->aspects == VK_IMAGE_ASPECT_STENCIL_BIT) {
379 assert(vk_format_get_blocksize(image->format) ==
386 vk_image_expand_aspect_mask(image, range->aspectMask);
390 * "If the image has a multi-planar format and
391 * subresourceRange.aspectMask is VK_IMAGE_ASPECT_COLOR_BIT, and image
399 * be identical to the image format, and the sampler to be used with the
400 * image view must enable sampler Y′CBCR conversion."
405 if ((image->aspects & VK_IMAGE_ASPECT_PLANE_1_BIT) &&
407 assert(pCreateInfo->format == image->format);
415 assert(pCreateInfo->format == image->format);
417 if (!(image->create_flags & VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT))
418 assert(pCreateInfo->format == image->format);
432 * "If image was created with the VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT
433 * and the image has a multi-planar format, and if
437 * image, and the sampler to be used with the image view must not
457 assert(range->baseMipLevel < image->mip_levels);
460 image_view->level_count = vk_image_subresource_level_count(image, range);
462 image_view->layer_count = vk_image_subresource_layer_count(image, range);
479 vk_image_mip_level_extent(image, image_view->base_mip_level);
482 <= image->mip_levels);
483 switch (image->image_type) {
489 <= image->array_layers);
497 /* If we are creating a color view from a depth/stencil image we compute
501 vk_image_usage(image, image_view->aspects);
596 unreachable("Invalid image layout.");
599 unreachable("Invalid image layout.");
621 * all relevant image aspects."
840 unreachable("Invalid image layout.");
843 unreachable("Invalid image layout.");