Module: Mesa
Branch: main
Commit: a031bfdb9d3cb255b72808567e809ed9ca4992ea
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=a031bfdb9d3cb255b72808567e809ed9ca4992ea

Author: Matt Coster <[email protected]>
Date:   Tue Apr 25 16:31:22 2023 +0100

pvr: Fixup format features

Fixes: dEQP-VK.api.info.format_features.*

Signed-off-by: Matt Coster <[email protected]>
Reviewed-by: Frank Binns <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22749>

---

 src/imagination/vulkan/pvr_formats.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/src/imagination/vulkan/pvr_formats.c 
b/src/imagination/vulkan/pvr_formats.c
index e99656f666e..6000fdd72ea 100644
--- a/src/imagination/vulkan/pvr_formats.c
+++ b/src/imagination/vulkan/pvr_formats.c
@@ -491,7 +491,8 @@ pvr_get_image_format_features2(const struct pvr_format 
*pvr_format,
 
          if (!vk_format_is_int(vk_format) &&
              !vk_format_is_depth_or_stencil(vk_format) &&
-             first_component_size < 32) {
+             (first_component_size < 32 ||
+              vk_format_is_block_compressed(vk_format))) {
             flags |= VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_FILTER_LINEAR_BIT;
          }
       } else if (!vk_format_is_block_compressed(vk_format)) {
@@ -517,7 +518,7 @@ pvr_get_image_format_features2(const struct pvr_format 
*pvr_format,
    if (vk_tiling == VK_IMAGE_TILING_OPTIMAL) {
       if (vk_format_is_color(vk_format) &&
           vk_format_get_nr_components(vk_format) == 1 &&
-          vk_format_get_blocksize(vk_format) == 32 &&
+          vk_format_get_blocksizebits(vk_format) == 32 &&
           vk_format_is_int(vk_format)) {
          flags |= VK_FORMAT_FEATURE_2_STORAGE_IMAGE_BIT |
                   VK_FORMAT_FEATURE_2_STORAGE_IMAGE_ATOMIC_BIT;
@@ -616,7 +617,7 @@ pvr_get_buffer_format_features2(const struct pvr_format 
*pvr_format)
 
    if (vk_format_is_color(vk_format) &&
        vk_format_get_nr_components(vk_format) == 1 &&
-       vk_format_get_blocksize(vk_format) == 32 &&
+       vk_format_get_blocksizebits(vk_format) == 32 &&
        vk_format_is_int(vk_format)) {
       flags |= VK_FORMAT_FEATURE_2_STORAGE_TEXEL_BUFFER_BIT |
                VK_FORMAT_FEATURE_2_STORAGE_TEXEL_BUFFER_ATOMIC_BIT;
@@ -643,6 +644,11 @@ pvr_get_buffer_format_features2(const struct pvr_format 
*pvr_format)
    case VK_FORMAT_R32G32B32A32_SFLOAT:
       flags |= VK_FORMAT_FEATURE_2_STORAGE_TEXEL_BUFFER_BIT;
       break;
+
+   case VK_FORMAT_B10G11R11_UFLOAT_PACK32:
+      flags |= VK_FORMAT_FEATURE_2_UNIFORM_TEXEL_BUFFER_BIT;
+      break;
+
    default:
       break;
    }

Reply via email to