if (!view)
continue;
- const struct anv_format *format =
- anv_format_for_vk_format(view->format);
-
struct anv_state state =
anv_cmd_buffer_alloc_surface_state(cmd_buffer, 64, 64);
d->dynamic_offsets[surface_slots[b].dynamic_slot];
offset = view->offset + dynamic_offset;
- anv_fill_buffer_surface_state(state.map, format, offset,
+ anv_fill_buffer_surface_state(state.map, view->format, offset,
view->range - dynamic_offset);
} else {
offset = view->offset;
view->offset = buffer->offset + pCreateInfo->offset;
view->surface_state =
anv_state_pool_alloc(&device->surface_state_pool, 64, 64);
- view->format = pCreateInfo->format;
+ view->format = anv_format_for_vk_format(pCreateInfo->format);
view->range = pCreateInfo->range;
- anv_fill_buffer_surface_state(view->surface_state.map,
- anv_format_for_vk_format(pCreateInfo->format),
+ anv_fill_buffer_surface_state(view->surface_state.map, view->format,
view->offset, pCreateInfo->range);
*pView = anv_buffer_view_to_handle(bview);
struct anv_surface_view *view = &iview->view;
struct anv_surface *surface;
- const struct anv_format *format_info =
- anv_format_for_vk_format(pCreateInfo->format);
-
const struct anv_image_view_info *view_type_info
= &anv_image_view_info_table[pCreateInfo->viewType];
view->bo = image->bo;
view->offset = image->offset + surface->offset;
- view->format = pCreateInfo->format;
+ view->format = anv_format_for_vk_format(pCreateInfo->format);
iview->extent = (VkExtent3D) {
.width = anv_minify(image->extent.width, range->baseMipLevel),
struct GEN8_RENDER_SURFACE_STATE surface_state = {
.SurfaceType = view_type_info->surface_type,
.SurfaceArray = image->array_size > 1,
- .SurfaceFormat = format_info->surface_format,
+ .SurfaceFormat = view->format->surface_format,
.SurfaceVerticalAlignment = anv_valign[surface->v_align],
.SurfaceHorizontalAlignment = anv_halign[surface->h_align],
.TileMode = surface->tile_mode,
ANV_FROM_HANDLE(anv_image, image, pCreateInfo->image);
struct anv_surface_view *view = &aview->view;
struct anv_surface *surface = &image->primary_surface;
- const struct anv_format *format_info =
- anv_format_for_vk_format(pCreateInfo->format);
aview->base.attachment_type = ANV_ATTACHMENT_VIEW_TYPE_COLOR;
view->bo = image->bo;
view->offset = image->offset + surface->offset;
- view->format = pCreateInfo->format;
+ view->format = anv_format_for_vk_format(pCreateInfo->format);
aview->base.extent = (VkExtent3D) {
.width = anv_minify(image->extent.width, pCreateInfo->mipLevel),
struct GEN8_RENDER_SURFACE_STATE surface_state = {
.SurfaceType = SURFTYPE_2D,
.SurfaceArray = image->array_size > 1,
- .SurfaceFormat = format_info->surface_format,
+ .SurfaceFormat = view->format->surface_format,
.SurfaceVerticalAlignment = anv_valign[surface->v_align],
.SurfaceHorizontalAlignment = anv_halign[surface->h_align],
.TileMode = surface->tile_mode,
.attachmentCount = 1,
.pAttachments = &(VkAttachmentDescription) {
.sType = VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION,
- .format = dest->view.format,
+ .format = dest->view.format->vk_format,
.loadOp = VK_ATTACHMENT_LOAD_OP_LOAD,
.storeOp = VK_ATTACHMENT_STORE_OP_STORE,
.initialLayout = VK_IMAGE_LAYOUT_GENERAL,
.attachmentCount = 1,
.pAttachments = &(VkAttachmentDescription) {
.sType = VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION,
- .format = view.view.format,
+ .format = view.view.format->vk_format,
.loadOp = VK_ATTACHMENT_LOAD_OP_LOAD,
.storeOp = VK_ATTACHMENT_STORE_OP_STORE,
.initialLayout = VK_IMAGE_LAYOUT_GENERAL,