* Exactly one bit must be set in \a aspect.
*/
struct anv_format
-anv_get_format(VkFormat vk_format, VkImageAspectFlags aspect,
- VkImageTiling tiling)
+anv_get_format(const struct brw_device_info *devinfo, VkFormat vk_format,
+ VkImageAspectFlags aspect, VkImageTiling tiling)
{
struct anv_format format = anv_formats[vk_format];
VK_FORMAT_FEATURE_BLIT_DST_BIT;
} else {
struct anv_format linear_fmt, tiled_fmt;
- linear_fmt = anv_get_format(format, VK_IMAGE_ASPECT_COLOR_BIT,
+ linear_fmt = anv_get_format(physical_device->info, format,
+ VK_IMAGE_ASPECT_COLOR_BIT,
VK_IMAGE_TILING_LINEAR);
- tiled_fmt = anv_get_format(format, VK_IMAGE_ASPECT_COLOR_BIT,
+ tiled_fmt = anv_get_format(physical_device->info, format,
+ VK_IMAGE_ASPECT_COLOR_BIT,
VK_IMAGE_TILING_OPTIMAL);
linear = get_image_format_properties(gen, linear_fmt.isl_format,
ok = isl_surf_init(&dev->isl_dev, &anv_surf->isl,
.dim = vk_to_isl_surf_dim[vk_info->imageType],
- .format = anv_get_isl_format(vk_info->format, aspect, vk_info->tiling),
+ .format = anv_get_isl_format(&dev->info, vk_info->format,
+ aspect, vk_info->tiling),
.width = image->extent.width,
.height = image->extent.height,
.depth = image->extent.depth,
iview->aspect_mask = pCreateInfo->subresourceRange.aspectMask;
iview->vk_format = pCreateInfo->format;
- struct anv_format format =
- anv_get_format(pCreateInfo->format, range->aspectMask, image->tiling);
+ struct anv_format format = anv_get_format(&device->info, pCreateInfo->format,
+ range->aspectMask, image->tiling);
iview->base_layer = range->baseArrayLayer;
iview->base_mip = range->baseMipLevel;
/* TODO: Handle the format swizzle? */
- view->format = anv_get_isl_format(pCreateInfo->format,
+ view->format = anv_get_isl_format(&device->info, pCreateInfo->format,
VK_IMAGE_ASPECT_COLOR_BIT,
VK_IMAGE_TILING_LINEAR);
view->bo = buffer->bo;
&anv_image_get_surface_for_aspect_mask(image, aspect)->isl;
struct anv_meta_blit2d_surf img_bsurf =
blit_surf_for_image(image, img_isl_surf);
- enum isl_format buf_format = anv_get_isl_format(image->vk_format, aspect,
+ enum isl_format buf_format = anv_get_isl_format(&cmd_buffer->device->info,
+ image->vk_format, aspect,
VK_IMAGE_TILING_LINEAR);
struct anv_meta_blit2d_surf buf_bsurf = {
.bo = buffer->bo,
};
struct anv_format
-anv_get_format(VkFormat format, VkImageAspectFlags aspect,
- VkImageTiling tiling);
+anv_get_format(const struct brw_device_info *devinfo, VkFormat format,
+ VkImageAspectFlags aspect, VkImageTiling tiling);
static inline enum isl_format
-anv_get_isl_format(VkFormat vk_format, VkImageAspectFlags aspect,
- VkImageTiling tiling)
+anv_get_isl_format(const struct brw_device_info *devinfo, VkFormat vk_format,
+ VkImageAspectFlags aspect, VkImageTiling tiling)
{
- return anv_get_format(vk_format, aspect, tiling).isl_format;
+ return anv_get_format(devinfo, vk_format, aspect, tiling).isl_format;
}
/**
for (uint32_t i = 0; i < info->vertexAttributeDescriptionCount; i++) {
const VkVertexInputAttributeDescription *desc =
&info->pVertexAttributeDescriptions[i];
- enum isl_format format = anv_get_isl_format(desc->format,
+ enum isl_format format = anv_get_isl_format(&pipeline->device->info,
+ desc->format,
VK_IMAGE_ASPECT_COLOR_BIT,
VK_IMAGE_TILING_LINEAR);