break;
}
+ struct anv_surface *surface =
+ anv_image_get_surface_for_aspect_mask(image, range->aspectMask);
+
+ iview->image = image;
+ iview->bo = image->bo;
+ iview->offset = image->offset + surface->offset;
+
+ iview->aspect_mask = pCreateInfo->subresourceRange.aspectMask;
+ iview->format = anv_format_for_vk_format(pCreateInfo->format);
+
+ iview->extent = (VkExtent3D) {
+ .width = anv_minify(image->extent.width, range->baseMipLevel),
+ .height = anv_minify(image->extent.height, range->baseMipLevel),
+ .depth = anv_minify(image->extent.depth, range->baseMipLevel),
+ };
+
switch (device->info.gen) {
case 7:
if (device->info.is_haswell)
const struct anv_format *format; /**< VkImageViewCreateInfo::format */
struct anv_bo *bo;
uint32_t offset; /**< Offset into bo. */
+
+ VkImageAspectFlags aspect_mask;
VkExtent3D extent; /**< Extent of VkImageViewCreateInfo::baseMipLevel. */
/** RENDER_SURFACE_STATE when using image as a color render target. */
struct anv_surface *surface =
anv_image_get_surface_for_aspect_mask(image, range->aspectMask);
- const struct anv_format *format =
- anv_format_for_vk_format(pCreateInfo->format);
-
if (pCreateInfo->viewType != VK_IMAGE_VIEW_TYPE_2D)
anv_finishme("non-2D image views");
- iview->image = image;
- iview->bo = image->bo;
- iview->offset = image->offset + surface->offset;
- iview->format = anv_format_for_vk_format(pCreateInfo->format);
-
- iview->extent = (VkExtent3D) {
- .width = anv_minify(image->extent.width, range->baseMipLevel),
- .height = anv_minify(image->extent.height, range->baseMipLevel),
- .depth = anv_minify(image->extent.depth, range->baseMipLevel),
- };
-
uint32_t depth = 1;
if (range->layerCount > 1) {
depth = range->layerCount;
struct GENX(RENDER_SURFACE_STATE) surface_state = {
.SurfaceType = anv_surftype(image, pCreateInfo->viewType, false),
.SurfaceArray = image->array_size > 1,
- .SurfaceFormat = format->surface_format,
+ .SurfaceFormat = iview->format->surface_format,
.SurfaceVerticalAlignment = anv_valign[image_align_sa.height],
.SurfaceHorizontalAlignment = anv_halign[image_align_sa.width],
surface_state.SurfaceFormat =
isl_lower_storage_image_format(&device->isl_dev,
- format->surface_format);
+ iview->format->surface_format);
surface_state.SurfaceMinLOD = range->baseMipLevel;
surface_state.MIPCountLOD = MAX2(range->levelCount, 1) - 1;
uint32_t depth = 1; /* RENDER_SURFACE_STATE::Depth */
uint32_t rt_view_extent = 1; /* RENDER_SURFACE_STATE::RenderTargetViewExtent */
- const struct anv_format *format_info =
- anv_format_for_vk_format(pCreateInfo->format);
-
- iview->image = image;
- iview->bo = image->bo;
- iview->offset = image->offset + surface->offset;
- iview->format = format_info;
-
- iview->extent = (VkExtent3D) {
- .width = anv_minify(image->extent.width, range->baseMipLevel),
- .height = anv_minify(image->extent.height, range->baseMipLevel),
- .depth = anv_minify(image->extent.depth, range->baseMipLevel),
- };
-
switch (image->type) {
case VK_IMAGE_TYPE_1D:
case VK_IMAGE_TYPE_2D:
struct GENX(RENDER_SURFACE_STATE) surface_state = {
.SurfaceType = anv_surftype(image, pCreateInfo->viewType, false),
.SurfaceArray = image->array_size > 1,
- .SurfaceFormat = format_info->surface_format,
+ .SurfaceFormat = iview->format->surface_format,
.SurfaceVerticalAlignment = valign,
.SurfaceHorizontalAlignment = halign,
.TileMode = isl_to_gen_tiling[surface->isl.tiling],
surface_state.SurfaceFormat =
isl_lower_storage_image_format(&device->isl_dev,
- format_info->surface_format);
+ iview->format->surface_format);
surface_state.SurfaceMinLOD = range->baseMipLevel;
surface_state.MIPCountLOD = MAX2(range->levelCount, 1) - 1;