Mesa (master): turnip: Use tu6_reduction_mode() to avoid warning

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue May 26 20:06:05 UTC 2020


Module: Mesa
Branch: master
Commit: 697fe1c8015d14b6d2ebc5ba70cd05439ef1490e
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=697fe1c8015d14b6d2ebc5ba70cd05439ef1490e

Author: Kristian H. Kristensen <hoegsberg at google.com>
Date:   Fri May 22 13:57:53 2020 -0700

turnip: Use tu6_reduction_mode() to avoid warning

This makes it a little more explicit that the values line up.

src/freedreno/vulkan/tu_device.c:2209:75: warning: implicit conversion
from enumeration type 'const VkSamplerReductionMode' (aka 'const enum
VkSamplerReductionMode') to different enumeration type 'enum
a6xx_reduction_mode' [-Wenum-conversion]

Reviewed-by: Rob Clark <robdclark at chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5174>

---

 src/freedreno/vulkan/tu_device.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/src/freedreno/vulkan/tu_device.c b/src/freedreno/vulkan/tu_device.c
index b5f5c23f158..dfadb66d5e2 100644
--- a/src/freedreno/vulkan/tu_device.c
+++ b/src/freedreno/vulkan/tu_device.c
@@ -2165,6 +2165,14 @@ tu6_compare_func(VkCompareOp op)
    return (enum adreno_compare_func) op;
 }
 
+static inline enum a6xx_reduction_mode
+tu6_reduction_mode(VkSamplerReductionMode reduction_mode)
+{
+   /* note: vulkan enum matches hw */
+
+   return (enum a6xx_reduction_mode) reduction_mode;
+}
+
 static void
 tu_init_sampler(struct tu_device *device,
                 struct tu_sampler *sampler,
@@ -2205,8 +2213,8 @@ tu_init_sampler(struct tu_device *device,
    sampler->descriptor[3] = 0;
 
    if (reduction) {
-      /* note: vulkan enum matches hw */
-      sampler->descriptor[2] |= A6XX_TEX_SAMP_2_REDUCTION_MODE(reduction->reductionMode);
+      sampler->descriptor[2] |= A6XX_TEX_SAMP_2_REDUCTION_MODE(
+         tu6_reduction_mode(reduction->reductionMode));
    }
 
    sampler->ycbcr_sampler = ycbcr_conversion ?



More information about the mesa-commit mailing list