radv: don't advertise transfer props unless we can do anything else
authorDave Airlie <airlied@redhat.com>
Thu, 4 May 2017 00:51:49 +0000 (10:51 +1000)
committerDave Airlie <airlied@redhat.com>
Thu, 4 May 2017 19:46:02 +0000 (05:46 +1000)
There is no reason to advertise transfer ability for formats we can't
use for anything else. This stops some CTS tests hitting internal
error for 64-bit types when they see the transfer flags.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Dave Airlie <airlied@redhat.com>
src/amd/vulkan/radv_formats.c

index 07942e4217fffb86efdcf10ffe500201d66d5f28..61cc6739842653877e4de6956c14c729cb464fda 100644 (file)
@@ -597,13 +597,13 @@ radv_physical_device_get_format_properties(struct radv_physical_device *physical
                                tiled |= VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT;
                        }
                }
-               if (util_is_power_of_two(vk_format_get_blocksize(format)) && !scaled) {
+               if (tiled && util_is_power_of_two(vk_format_get_blocksize(format)) && !scaled) {
                        tiled |= VK_FORMAT_FEATURE_TRANSFER_SRC_BIT_KHR |
                                 VK_FORMAT_FEATURE_TRANSFER_DST_BIT_KHR;
                }
        }
 
-       if (util_is_power_of_two(vk_format_get_blocksize(format)) && !scaled) {
+       if (linear && util_is_power_of_two(vk_format_get_blocksize(format)) && !scaled) {
                linear |= VK_FORMAT_FEATURE_TRANSFER_SRC_BIT_KHR |
                          VK_FORMAT_FEATURE_TRANSFER_DST_BIT_KHR;
        }