Mesa (master): nv50/ir/nir: fix cache mode conversion

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Jul 7 11:43:05 UTC 2020


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

Author: Karol Herbst <kherbst at redhat.com>
Date:   Mon Jul  6 20:06:40 2020 +0200

nv50/ir/nir: fix cache mode conversion

The nir access qualifier is actually a bitfield, so we need to read out
like one.

Signed-off-by: Karol Herbst <kherbst at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5747>

---

 src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp
index d5b81b84c35..a972b51b623 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp
@@ -2938,14 +2938,11 @@ Converter::getNIRArgCount(TexInstruction::Target& target)
 CacheMode
 Converter::convert(enum gl_access_qualifier access)
 {
-   switch (access) {
-   case ACCESS_VOLATILE:
+   if (access & ACCESS_VOLATILE)
       return CACHE_CV;
-   case ACCESS_COHERENT:
+   if (access & ACCESS_COHERENT)
       return CACHE_CG;
-   default:
-      return CACHE_CA;
-   }
+   return CACHE_CA;
 }
 
 bool



More information about the mesa-commit mailing list