Remove redundant override in anv and hasvk as well.
Fixed
android.graphics.cts.BasicVulkanGpuTest#testBasicBufferImportAndRenderingExternalFormat
for radv.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22619>
iview->image = image;
iview->n_planes = anv_image_aspect_get_planes(iview->vk.aspects);
- /* Check if a conversion info was passed. */
- VkFormat conv_format = VK_FORMAT_UNDEFINED;
- const VkSamplerYcbcrConversionInfo *conv_info =
- vk_find_struct_const(pCreateInfo->pNext, SAMPLER_YCBCR_CONVERSION_INFO);
-
- if (conv_info) {
- VK_FROM_HANDLE(vk_ycbcr_conversion, conversion, conv_info->conversion);
- conv_format = conversion->state.format;
- }
-
- /* Format is undefined, this can happen when using external formats. Set
- * view format from the passed conversion info.
- */
- if (iview->vk.view_format == VK_FORMAT_UNDEFINED && conv_format)
- iview->vk.view_format = conv_format;
-
/* Now go through the underlying image selected planes and map them to
* planes in the image view.
*/
iview->image = image;
iview->n_planes = anv_image_aspect_get_planes(iview->vk.aspects);
- /* Check if a conversion info was passed. */
- VkFormat conv_format = VK_FORMAT_UNDEFINED;
- const VkSamplerYcbcrConversionInfo *conv_info =
- vk_find_struct_const(pCreateInfo->pNext, SAMPLER_YCBCR_CONVERSION_INFO);
-
- if (conv_info) {
- VK_FROM_HANDLE(vk_ycbcr_conversion, conversion, conv_info->conversion);
- conv_format = conversion->state.format;
- }
-
- /* Format is undefined, this can happen when using external formats. Set
- * view format from the passed conversion info.
- */
- if (iview->vk.view_format == VK_FORMAT_UNDEFINED && conv_format)
- iview->vk.view_format = conv_format;
-
/* Now go through the underlying image selected planes and map them to
* planes in the image view.
*/
image_view->create_flags = pCreateInfo->flags;
image_view->image = image;
image_view->view_type = pCreateInfo->viewType;
+
image_view->format = pCreateInfo->format;
+ if (image_view->format == VK_FORMAT_UNDEFINED)
+ image_view->format = image->format;
if (!driver_internal) {
switch (image_view->view_type) {
if (driver_internal) {
image_view->aspects = range->aspectMask;
- image_view->view_format = pCreateInfo->format;
+ image_view->view_format = image_view->format;
} else {
image_view->aspects =
vk_image_expand_aspect_mask(image, range->aspectMask);
*/
if ((image->aspects & VK_IMAGE_ASPECT_PLANE_1_BIT) &&
(range->aspectMask == VK_IMAGE_ASPECT_COLOR_BIT))
- assert(pCreateInfo->format == image->format);
+ assert(image_view->format == image->format);
/* From the Vulkan 1.2.184 spec:
*
*/
if (image_view->aspects & (VK_IMAGE_ASPECT_DEPTH_BIT |
VK_IMAGE_ASPECT_STENCIL_BIT))
- assert(pCreateInfo->format == image->format);
+ assert(image_view->format == image->format);
if (!(image->create_flags & VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT))
- assert(pCreateInfo->format == image->format);
+ assert(image_view->format == image->format);
/* Restrict the format to only the planes chosen.
*
* enable sampler Y′CBCR conversion."
*/
if (image_view->aspects == VK_IMAGE_ASPECT_STENCIL_BIT) {
- image_view->view_format = vk_format_stencil_only(pCreateInfo->format);
+ image_view->view_format = vk_format_stencil_only(image_view->format);
} else if (image_view->aspects == VK_IMAGE_ASPECT_DEPTH_BIT) {
- image_view->view_format = vk_format_depth_only(pCreateInfo->format);
+ image_view->view_format = vk_format_depth_only(image_view->format);
} else {
- image_view->view_format = pCreateInfo->format;
+ image_view->view_format = image_view->format;
}
}
struct vk_image *image;
VkImageViewType view_type;
- /** VkImageViewCreateInfo::format */
+ /** VkImageViewCreateInfo::format or vk_image::format */
VkFormat format;
/** Image view format, relative to the selected aspects
* For color images, we have three cases:
*
* 1. It's a single-plane image in which case this is the unmodified
- * format provided to VkImageViewCreateInfo::format.
+ * format provided to VkImageViewCreateInfo::format or
+ * vk_image::format.
*
* 2. It's a YCbCr view of a multi-plane image in which case the
* client will have asked for VK_IMAGE_ASPECT_COLOR_BIT and the