mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-22 22:10:10 +01:00
anv/image: Check DISJOINT in vkGetPhysicalDeviceImageFormatProperties2 (v2)
The code did not return error when VK_IMAGE_CREATE_DISJOINT_BIT was incompatible with the other input params. If the Vulkan spec forbids a set of input params for vkCreateImage, but permits them for vkGetPhysicalDeviceImageFormatProperties2, then vkGetPhysicalDeviceImageFormatProperties2 must reject those input params with failure. - v2: Clearer commit message. CC: <mesa-stable@lists.freedesktop.org> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> (v2) Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
This commit is contained in:
parent
19906022e2
commit
51a19c83b0
1 changed files with 25 additions and 0 deletions
|
|
@ -923,6 +923,31 @@ anv_get_image_format_properties(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (info->flags & VK_IMAGE_CREATE_DISJOINT_BIT) {
|
||||||
|
/* From the Vulkan 1.2.149 spec, VkImageCreateInfo:
|
||||||
|
*
|
||||||
|
* If format is a multi-planar format, and if imageCreateFormatFeatures
|
||||||
|
* (as defined in Image Creation Limits) does not contain
|
||||||
|
* VK_FORMAT_FEATURE_DISJOINT_BIT, then flags must not contain
|
||||||
|
* VK_IMAGE_CREATE_DISJOINT_BIT.
|
||||||
|
*/
|
||||||
|
if (format->n_planes > 1 &&
|
||||||
|
!(format_feature_flags & VK_FORMAT_FEATURE_DISJOINT_BIT)) {
|
||||||
|
goto unsupported;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* From the Vulkan 1.2.149 spec, VkImageCreateInfo:
|
||||||
|
*
|
||||||
|
* If format is not a multi-planar format, and flags does not include
|
||||||
|
* VK_IMAGE_CREATE_ALIAS_BIT, flags must not contain
|
||||||
|
* VK_IMAGE_CREATE_DISJOINT_BIT.
|
||||||
|
*/
|
||||||
|
if (format->n_planes == 1 &&
|
||||||
|
!(info->flags & VK_IMAGE_CREATE_ALIAS_BIT)) {
|
||||||
|
goto unsupported;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (info->usage & VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT) {
|
if (info->usage & VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT) {
|
||||||
/* Nothing to check. */
|
/* Nothing to check. */
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue