[Mesa-dev] [PATCH 2/2] anv: GetDeviceImageFormatProperties: fix TRANSFER formats
Jason Ekstrand
jason at jlekstrand.net
Fri Aug 12 01:52:37 UTC 2016
On Aug 11, 2016 10:25 AM, "Lionel Landwerlin" <llandwerlin at gmail.com> wrote:
>
> We let the user believe we support some transfer formats which we don't.
> This can lead to crashes when actually trying to use those formats for
> example on dEQP-VK.api.copy_and_blit.image_to_image.* tests.
>
> Let all formats we can render to or sample from as meta implements
transfers
> using attachments.
>
> Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
> Cc: Jason Ekstrand <jason at jlekstrand.net>
> ---
> src/intel/vulkan/anv_formats.c | 16 +++++++---------
> 1 file changed, 7 insertions(+), 9 deletions(-)
>
> diff --git a/src/intel/vulkan/anv_formats.c
b/src/intel/vulkan/anv_formats.c
> index b26e48a..13bde90 100644
> --- a/src/intel/vulkan/anv_formats.c
> +++ b/src/intel/vulkan/anv_formats.c
> @@ -509,23 +509,21 @@ VkResult anv_GetPhysicalDeviceImageFormatProperties(
>
> if (usage & VK_IMAGE_USAGE_TRANSFER_SRC_BIT) {
> /* Meta implements transfers by sampling from the source image. */
I think this change is functionally correct. However, the comment above is
bogus. The reason for the restriction is that we only want to support
transfer operations on formats that we support for other things. In other
words, we don't want transfer-only formats.
> - if (!(format_feature_flags & VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT))
{
> + if (!(format_feature_flags &
(VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT |
> +
VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT |
> +
VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT))) {
> goto unsupported;
> }
> }
>
> -#if 0
> if (usage & VK_IMAGE_USAGE_TRANSFER_DST_BIT) {
> - if (anv_format_for_vk_format(format)->has_stencil) {
> - /* Not yet implemented because copying to a W-tiled surface is
crazy
> - * hard.
> - */
> - anv_finishme("support VK_IMAGE_USAGE_TRANSFER_DST_BIT for "
> - "stencil format");
> + /* Meta implements transfers by rendering to the attachment image.
*/
> + if (!(format_feature_flags &
(VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT |
> +
VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT |
> +
VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT))) {
While we're here, let's combine the two checks since they now do the same
thing.
> goto unsupported;
> }
> }
> -#endif
>
> if (usage & VK_IMAGE_USAGE_SAMPLED_BIT) {
> if (!(format_feature_flags & VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT))
{
> --
> 2.8.1
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20160811/5bcaf4dd/attachment.html>
More information about the mesa-dev
mailing list