Lines Matching refs:image
58 struct vk_image *image, in vk_image_init() argument
61 vk_object_base_init(device, &image->base, VK_OBJECT_TYPE_IMAGE); in vk_image_init()
76 image->create_flags = pCreateInfo->flags; in vk_image_init()
77 image->image_type = pCreateInfo->imageType; in vk_image_init()
78 vk_image_set_format(image, pCreateInfo->format); in vk_image_init()
79 image->extent = sanitize_image_extent(pCreateInfo->imageType, in vk_image_init()
81 image->mip_levels = pCreateInfo->mipLevels; in vk_image_init()
82 image->array_layers = pCreateInfo->arrayLayers; in vk_image_init()
83 image->samples = pCreateInfo->samples; in vk_image_init()
84 image->tiling = pCreateInfo->tiling; in vk_image_init()
85 image->usage = pCreateInfo->usage; in vk_image_init()
87 if (image->aspects & VK_IMAGE_ASPECT_STENCIL_BIT) { in vk_image_init()
91 image->stencil_usage = in vk_image_init()
95 image->stencil_usage = 0; in vk_image_init()
101 image->external_handle_types = ext_mem_info->handleTypes; in vk_image_init()
103 image->external_handle_types = 0; in vk_image_init()
107 image->wsi_legacy_scanout = wsi_info && wsi_info->scanout; in vk_image_init()
110 image->drm_format_mod = ((1ULL << 56) - 1) /* DRM_FORMAT_MOD_INVALID */; in vk_image_init()
117 assert(image->format == VK_FORMAT_UNDEFINED); in vk_image_init()
118 assert(image->external_handle_types & in vk_image_init()
120 image->android_external_format = ext_format->externalFormat; in vk_image_init()
122 image->android_external_format = 0; in vk_image_init()
133 struct vk_image *image = in vk_image_create() local
136 if (image == NULL) in vk_image_create()
139 vk_image_init(device, image, pCreateInfo); in vk_image_create()
141 return image; in vk_image_create()
145 vk_image_finish(struct vk_image *image) in vk_image_finish() argument
147 vk_object_base_finish(&image->base); in vk_image_finish()
153 struct vk_image *image) in vk_image_destroy() argument
155 vk_object_free(device, alloc, image); in vk_image_destroy()
164 VK_FROM_HANDLE(vk_image, image, _image); in vk_common_GetImageDrmFormatModifierPropertiesEXT()
169 assert(image->tiling == VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT); in vk_common_GetImageDrmFormatModifierPropertiesEXT()
170 pProperties->drmFormatModifier = image->drm_format_mod; in vk_common_GetImageDrmFormatModifierPropertiesEXT()
177 vk_image_set_format(struct vk_image *image, VkFormat format) in vk_image_set_format() argument
179 image->format = format; in vk_image_set_format()
180 image->aspects = vk_format_aspects(format); in vk_image_set_format()
184 vk_image_usage(const struct vk_image *image, in vk_image_usage() argument
187 assert(!(aspect_mask & ~image->aspects)); in vk_image_usage()
208 return image->stencil_usage; in vk_image_usage()
211 return image->usage & image->stencil_usage; in vk_image_usage()
214 return image->usage; in vk_image_usage()
242 vk_image_expand_aspect_mask(const struct vk_image *image, in vk_image_expand_aspect_mask() argument
246 assert(image->aspects & VK_IMAGE_ASPECT_ANY_COLOR_MASK_MESA); in vk_image_expand_aspect_mask()
247 return image->aspects; in vk_image_expand_aspect_mask()
249 assert(aspect_mask && !(aspect_mask & ~image->aspects)); in vk_image_expand_aspect_mask()
255 vk_image_extent_to_elements(const struct vk_image *image, VkExtent3D extent) in vk_image_extent_to_elements() argument
258 vk_format_description(image->format); in vk_image_extent_to_elements()
260 extent = vk_image_sanitize_extent(image, extent); in vk_image_extent_to_elements()
269 vk_image_offset_to_elements(const struct vk_image *image, VkOffset3D offset) in vk_image_offset_to_elements() argument
272 vk_format_description(image->format); in vk_image_offset_to_elements()
274 offset = vk_image_sanitize_offset(image, offset); in vk_image_offset_to_elements()
288 vk_image_buffer_copy_layout(const struct vk_image *image, in vk_image_buffer_copy_layout() argument
291 VkExtent3D extent = vk_image_sanitize_extent(image, region->imageExtent); in vk_image_buffer_copy_layout()
299 VkFormat format = vk_format_get_aspect_format(image->format, aspect); in vk_image_buffer_copy_layout()
334 VK_FROM_HANDLE(vk_image, image, pCreateInfo->image); in vk_image_view_init()
337 image_view->image = image; in vk_image_view_init()
345 assert(image->image_type == VK_IMAGE_TYPE_1D); in vk_image_view_init()
349 if (image->create_flags & (VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT | in vk_image_view_init()
351 assert(image->image_type == VK_IMAGE_TYPE_3D); in vk_image_view_init()
353 assert(image->image_type == VK_IMAGE_TYPE_2D); in vk_image_view_init()
356 assert(image->image_type == VK_IMAGE_TYPE_3D); in vk_image_view_init()
360 assert(image->image_type == VK_IMAGE_TYPE_2D); in vk_image_view_init()
361 assert(image->create_flags & VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT); in vk_image_view_init()
376 if (image->aspects == VK_IMAGE_ASPECT_COLOR_BIT || in vk_image_view_init()
377 image->aspects == VK_IMAGE_ASPECT_DEPTH_BIT || in vk_image_view_init()
378 image->aspects == VK_IMAGE_ASPECT_STENCIL_BIT) { in vk_image_view_init()
379 assert(vk_format_get_blocksize(image->format) == in vk_image_view_init()
386 vk_image_expand_aspect_mask(image, range->aspectMask); in vk_image_view_init()
405 if ((image->aspects & VK_IMAGE_ASPECT_PLANE_1_BIT) && in vk_image_view_init()
407 assert(pCreateInfo->format == image->format); in vk_image_view_init()
415 assert(pCreateInfo->format == image->format); in vk_image_view_init()
417 if (!(image->create_flags & VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT)) in vk_image_view_init()
418 assert(pCreateInfo->format == image->format); in vk_image_view_init()
457 assert(range->baseMipLevel < image->mip_levels); in vk_image_view_init()
460 image_view->level_count = vk_image_subresource_level_count(image, range); in vk_image_view_init()
462 image_view->layer_count = vk_image_subresource_layer_count(image, range); in vk_image_view_init()
479 vk_image_mip_level_extent(image, image_view->base_mip_level); in vk_image_view_init()
482 <= image->mip_levels); in vk_image_view_init()
483 switch (image->image_type) { in vk_image_view_init()
489 <= image->array_layers); in vk_image_view_init()
501 vk_image_usage(image, image_view->aspects); in vk_image_view_init()