Fixes: 4bb6c49375e "radv: Allow ETC2 on RAVEN and VEGA10 instead of all GFX9."
---
 src/amd/vulkan/radv_device.c  |  3 +--
 src/amd/vulkan/radv_formats.c | 12 +++++++++---
 src/amd/vulkan/radv_private.h |  1 +
 3 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c
index 190de86b2cd..53f2c05fc42 100644
--- a/src/amd/vulkan/radv_device.c
+++ b/src/amd/vulkan/radv_device.c
@@ -739,8 +739,7 @@ void radv_GetPhysicalDeviceFeatures(
                .alphaToOne                               = true,
                .multiViewport                            = true,
                .samplerAnisotropy                        = true,
-               .textureCompressionETC2                   = 
pdevice->rad_info.chip_class >= GFX9 ||
-                                                           
pdevice->rad_info.family == CHIP_STONEY,
+               .textureCompressionETC2                   = 
radv_device_supports_etc(pdevice),
                .textureCompressionASTC_LDR               = false,
                .textureCompressionBC                     = true,
                .occlusionQueryPrecise                    = true,
diff --git a/src/amd/vulkan/radv_formats.c b/src/amd/vulkan/radv_formats.c
index 499d94befeb..0a3ff9ebbd9 100644
--- a/src/amd/vulkan/radv_formats.c
+++ b/src/amd/vulkan/radv_formats.c
@@ -595,6 +595,14 @@ static bool 
radv_is_filter_minmax_format_supported(VkFormat format)
        }
 }
 
+bool
+radv_device_supports_etc(struct radv_physical_device *physical_device)
+{
+       return physical_device->rad_info.family == CHIP_VEGA10 ||
+              physical_device->rad_info.family == CHIP_RAVEN ||
+              physical_device->rad_info.family == CHIP_STONEY;
+}
+
 static void
 radv_physical_device_get_format_properties(struct radv_physical_device 
*physical_device,
                                           VkFormat format,
@@ -612,9 +620,7 @@ radv_physical_device_get_format_properties(struct 
radv_physical_device *physical
        }
 
        if (desc->layout == VK_FORMAT_LAYOUT_ETC &&
-           physical_device->rad_info.family != CHIP_VEGA10 &&
-           physical_device->rad_info.family != CHIP_RAVEN &&
-           physical_device->rad_info.family != CHIP_STONEY) {
+           !radv_device_supports_etc(physical_device)) {
                out_properties->linearTilingFeatures = linear;
                out_properties->optimalTilingFeatures = tiled;
                out_properties->bufferFeatures = buffer;
diff --git a/src/amd/vulkan/radv_private.h b/src/amd/vulkan/radv_private.h
index ddabcedc958..27b5a9e77cd 100644
--- a/src/amd/vulkan/radv_private.h
+++ b/src/amd/vulkan/radv_private.h
@@ -1465,6 +1465,7 @@ bool radv_format_pack_clear_color(VkFormat format,
 bool radv_is_colorbuffer_format_supported(VkFormat format, bool *blendable);
 bool radv_dcc_formats_compatible(VkFormat format1,
                                  VkFormat format2);
+bool radv_device_supports_etc(struct radv_physical_device *physical_device);
 
 struct radv_fmask_info {
        uint64_t offset;
-- 
2.20.1

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to