nv50/ir/nir: fix cache mode conversion
authorKarol Herbst <kherbst@redhat.com>
Mon, 6 Jul 2020 18:06:40 +0000 (20:06 +0200)
committerMarge Bot <eric+marge@anholt.net>
Tue, 7 Jul 2020 11:32:15 +0000 (11:32 +0000)
The nir access qualifier is actually a bitfield, so we need to read out
like one.

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

src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp

index d5b81b84c3579946b89fd08ded6f999fe447786f..a972b51b6230028b693611e689cce0ef724212c8 100644 (file)
@@ -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