struct anv_device *device,
const VkImageViewCreateInfo* pCreateInfo,
struct anv_cmd_buffer *cmd_buffer,
- uint32_t offset)
+ uint32_t offset,
+ VkImageUsageFlags usage_mask)
{
ANV_FROM_HANDLE(anv_image, image, pCreateInfo->image);
const VkImageSubresourceRange *range = &pCreateInfo->subresourceRange;
cube_usage = 0;
}
- if (image->usage & VK_IMAGE_USAGE_SAMPLED_BIT) {
+ if (image->usage & usage_mask & VK_IMAGE_USAGE_SAMPLED_BIT) {
iview->sampler_surface_state = alloc_surface_state(device, cmd_buffer);
isl_view.usage = cube_usage | ISL_SURF_USAGE_TEXTURE_BIT;
iview->sampler_surface_state.alloc_size = 0;
}
- if (image->usage & VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT) {
+ if (image->usage & usage_mask & VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT) {
iview->color_rt_surface_state = alloc_surface_state(device, cmd_buffer);
isl_view.usage = cube_usage | ISL_SURF_USAGE_RENDER_TARGET_BIT;
iview->color_rt_surface_state.alloc_size = 0;
}
- if (image->usage & VK_IMAGE_USAGE_STORAGE_BIT) {
+ if (image->usage & usage_mask & VK_IMAGE_USAGE_STORAGE_BIT) {
iview->storage_surface_state = alloc_surface_state(device, cmd_buffer);
if (has_matching_storage_typed_format(device, format)) {
if (view == NULL)
return vk_error(VK_ERROR_OUT_OF_HOST_MEMORY);
- anv_image_view_init(view, device, pCreateInfo, NULL, 0);
+ anv_image_view_init(view, device, pCreateInfo, NULL, 0, ~0);
*pView = anv_image_view_to_handle(view);
.layerCount = 1
},
},
- cmd_buffer, 0);
+ cmd_buffer, 0, VK_IMAGE_USAGE_SAMPLED_BIT);
struct anv_image_view dest_iview;
anv_image_view_init(&dest_iview, cmd_buffer->device,
.layerCount = 1,
},
},
- cmd_buffer, 0);
+ cmd_buffer, 0, VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT);
meta_emit_blit(cmd_buffer,
anv_image_from_handle(src_image),
.layerCount = pRegions[r].dstSubresource.layerCount,
},
},
- cmd_buffer, 0);
+ cmd_buffer, 0, VK_IMAGE_USAGE_SAMPLED_BIT);
const uint32_t dest_base_array_slice =
anv_meta_get_iview_layer(dest_image, &pRegions[r].dstSubresource,
.layerCount = 1
},
},
- cmd_buffer, img_o);
+ cmd_buffer, img_o, VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT);
const VkExtent3D img_extent_el = meta_region_extent_el(dest_image->vk_format,
&pRegions[r].extent);
.layerCount = 1
},
},
- cmd_buffer, 0);
+ cmd_buffer, 0, VK_IMAGE_USAGE_SAMPLED_BIT);
const VkOffset3D dest_offset = {
.x = pRegions[r].dstOffsets[0].x,
.layerCount = 1
},
},
- cmd_buffer, 0);
+ cmd_buffer, 0, VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT);
meta_emit_blit(cmd_buffer,
src_image, &src_iview,
.layerCount = 1,
},
},
- cmd_buffer, 0);
+ cmd_buffer, 0, VK_IMAGE_USAGE_SAMPLED_BIT);
uint32_t img_x = 0;
uint32_t img_y = 0;
.layerCount = 1
},
},
- cmd_buffer, img_o);
+ cmd_buffer, img_o, VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT);
const VkExtent3D img_extent_el = meta_region_extent_el(dest_image->vk_format,
&pRegions[r].imageExtent);
.layerCount = pRegions[r].imageSubresource.layerCount,
},
},
- cmd_buffer, 0);
+ cmd_buffer, 0, VK_IMAGE_USAGE_SAMPLED_BIT);
struct anv_image *dest_image =
make_image_for_buffer(vk_device, destBuffer, src_image->vk_format,
.layerCount = 1
},
},
- cmd_buffer, 0);
+ cmd_buffer, 0, VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT);
meta_emit_blit(cmd_buffer,
anv_image_from_handle(srcImage),
.layerCount = 1
},
},
- cmd_buffer, 0);
+ cmd_buffer, 0, VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT);
VkFramebuffer fb;
anv_CreateFramebuffer(device_h,
.layerCount = 1,
},
},
- cmd_buffer, 0);
+ cmd_buffer, 0, VK_IMAGE_USAGE_SAMPLED_BIT);
struct anv_image_view dest_iview;
anv_image_view_init(&dest_iview, cmd_buffer->device,
.layerCount = 1,
},
},
- cmd_buffer, 0);
+ cmd_buffer, 0, VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT);
VkFramebuffer fb_h;
anv_CreateFramebuffer(device_h,
struct anv_device *device,
const VkImageViewCreateInfo* pCreateInfo,
struct anv_cmd_buffer *cmd_buffer,
- uint32_t offset);
+ uint32_t offset,
+ VkImageUsageFlags usage_mask);
void
anv_fill_image_surface_state(struct anv_device *device, struct anv_state state,