• Home
  • Raw
  • Download

Lines Matching refs:image

74 v3d_setup_slices(struct v3dv_image *image)  in v3d_setup_slices()  argument
76 assert(image->cpp > 0); in v3d_setup_slices()
78 uint32_t width = image->vk.extent.width; in v3d_setup_slices()
79 uint32_t height = image->vk.extent.height; in v3d_setup_slices()
80 uint32_t depth = image->vk.extent.depth; in v3d_setup_slices()
91 uint32_t utile_w = v3d_utile_width(image->cpp); in v3d_setup_slices()
92 uint32_t utile_h = v3d_utile_height(image->cpp); in v3d_setup_slices()
96 uint32_t block_width = vk_format_get_blockwidth(image->vk.format); in v3d_setup_slices()
97 uint32_t block_height = vk_format_get_blockheight(image->vk.format); in v3d_setup_slices()
99 assert(image->vk.samples == VK_SAMPLE_COUNT_1_BIT || in v3d_setup_slices()
100 image->vk.samples == VK_SAMPLE_COUNT_4_BIT); in v3d_setup_slices()
101 bool msaa = image->vk.samples != VK_SAMPLE_COUNT_1_BIT; in v3d_setup_slices()
105 assert(image->vk.array_layers > 0); in v3d_setup_slices()
107 assert(image->vk.mip_levels >= 1); in v3d_setup_slices()
110 for (int32_t i = image->vk.mip_levels - 1; i >= 0; i--) { in v3d_setup_slices()
111 struct v3d_resource_slice *slice = &image->slices[i]; in v3d_setup_slices()
135 if (!image->tiled) { in v3d_setup_slices()
137 if (image->vk.image_type == VK_IMAGE_TYPE_1D) in v3d_setup_slices()
138 level_width = align(level_width, 64 / image->cpp); in v3d_setup_slices()
160 slice->ub_pad = v3d_get_ub_pad(image->cpp, level_height); in v3d_setup_slices()
177 slice->stride = level_width * image->cpp; in v3d_setup_slices()
182 slice->padded_height / (2 * v3d_utile_height(image->cpp)); in v3d_setup_slices()
202 image->size = offset; in v3d_setup_slices()
212 image->alignment = image->tiled ? 4096 : image->cpp; in v3d_setup_slices()
214 align(image->slices[0].offset, image->alignment) - image->slices[0].offset; in v3d_setup_slices()
216 image->size += align_offset; in v3d_setup_slices()
217 for (int i = 0; i < image->vk.mip_levels; i++) in v3d_setup_slices()
218 image->slices[i].offset += align_offset; in v3d_setup_slices()
225 if (image->vk.image_type != VK_IMAGE_TYPE_3D) { in v3d_setup_slices()
226 image->cube_map_stride = in v3d_setup_slices()
227 align(image->slices[0].offset + image->slices[0].size, 64); in v3d_setup_slices()
228 image->size += image->cube_map_stride * (image->vk.array_layers - 1); in v3d_setup_slices()
230 image->cube_map_stride = image->slices[0].size; in v3d_setup_slices()
235 v3dv_layer_offset(const struct v3dv_image *image, uint32_t level, uint32_t layer) in v3dv_layer_offset() argument
237 const struct v3d_resource_slice *slice = &image->slices[level]; in v3dv_layer_offset()
239 if (image->vk.image_type == VK_IMAGE_TYPE_3D) in v3dv_layer_offset()
240 return image->mem_offset + slice->offset + layer * slice->size; in v3dv_layer_offset()
242 return image->mem_offset + slice->offset + layer * image->cube_map_stride; in v3dv_layer_offset()
251 struct v3dv_image *image = NULL; in create_image() local
253 image = vk_image_create(&device->vk, pCreateInfo, pAllocator, sizeof(*image)); in create_image()
254 if (image == NULL) in create_image()
295 image->vk.wsi_legacy_scanout) { in create_image()
311 vk_image_destroy(&device->vk, pAllocator, &image->vk); in create_image()
327 image->format = format; in create_image()
328 image->cpp = vk_format_get_blocksize(image->vk.format); in create_image()
329 image->tiled = tiling == VK_IMAGE_TILING_OPTIMAL || in create_image()
333 image->vk.tiling = tiling; in create_image()
334 image->vk.drm_format_mod = modifier; in create_image()
340 image->vk.create_flags |= VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT; in create_image()
342 v3d_setup_slices(image); in create_image()
346 image->slices[0].stride = native_buf_stride; in create_image()
347 image->slices[0].size = image->size = native_buf_size; in create_image()
351 v3dv_image_to_handle(image)); in create_image()
353 vk_object_free(&device->vk, pAllocator, image); in create_image()
359 *pImage = v3dv_image_to_handle(image); in create_image()
434 V3DV_FROM_HANDLE(v3dv_image, image, _image); in v3dv_GetImageSubresourceLayout()
437 &image->slices[subresource->mipLevel]; in v3dv_GetImageSubresourceLayout()
439 v3dv_layer_offset(image, subresource->mipLevel, subresource->arrayLayer) - in v3dv_GetImageSubresourceLayout()
440 image->mem_offset; in v3dv_GetImageSubresourceLayout()
442 layout->depthPitch = image->cube_map_stride; in v3dv_GetImageSubresourceLayout()
443 layout->arrayPitch = image->cube_map_stride; in v3dv_GetImageSubresourceLayout()
445 if (image->vk.image_type != VK_IMAGE_TYPE_3D) { in v3dv_GetImageSubresourceLayout()
455 layout->size = slice->size * image->vk.extent.depth; in v3dv_GetImageSubresourceLayout()
458 &image->slices[subresource->mipLevel - 1]; in v3dv_GetImageSubresourceLayout()
470 V3DV_FROM_HANDLE(v3dv_image, image, _image); in v3dv_DestroyImage()
472 if (image == NULL) in v3dv_DestroyImage()
476 if (image->is_native_buffer_memory) in v3dv_DestroyImage()
477 v3dv_FreeMemory(_device, v3dv_device_memory_to_handle(image->mem), pAllocator); in v3dv_DestroyImage()
480 vk_image_destroy(&device->vk, pAllocator, &image->vk); in v3dv_DestroyImage()
502 V3DV_FROM_HANDLE(v3dv_image, image, pCreateInfo->image); in create_image_view()
512 iview->offset = v3dv_layer_offset(image, iview->vk.base_mip_level, in create_image_view()