Mesa (master): gallivm: don't cache shaders that use fetch functions.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Jun 10 22:26:12 UTC 2020


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

Author: Dave Airlie <airlied at redhat.com>
Date:   Thu May 14 15:23:48 2020 +1000

gallivm: don't cache shaders that use fetch functions.

This needs to be reworked, but it's a bit messy as we have to store
all the fetch pointers to be added as globals later once gallivm
has been initialised further. For now just refuse to cache shaders
that hit these paths (mainly ETC1 and BPTC).

Reviewed-by: Roland Scheidegger <sroland at vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5049>

---

 src/gallium/auxiliary/gallivm/lp_bld_format_aos.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/gallium/auxiliary/gallivm/lp_bld_format_aos.c b/src/gallium/auxiliary/gallivm/lp_bld_format_aos.c
index f8e1a963bb4..d48dbfb69b0 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_format_aos.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_format_aos.c
@@ -54,7 +54,7 @@
 #include "lp_bld_intr.h"
 #include "lp_bld_logic.h"
 #include "lp_bld_bitarit.h"
-
+#include "lp_bld_misc.h"
 
 /**
  * Basic swizzling.  Rearrange the order of the unswizzled array elements
@@ -835,6 +835,8 @@ lp_build_fetch_rgba_aos(struct gallivm_state *gallivm,
          function_type = LLVMFunctionType(ret_type, arg_types,
                                           ARRAY_SIZE(arg_types), 0);
 
+         if (gallivm->cache)
+            gallivm->cache->dont_cache = true;
          /* make const pointer for the C fetch_rgba_8unorm function */
          function = lp_build_const_int_pointer(gallivm,
             func_to_pointer((func_pointer) format_desc->fetch_rgba_8unorm));
@@ -937,6 +939,8 @@ lp_build_fetch_rgba_aos(struct gallivm_state *gallivm,
          arg_types[2] = i32t;
          arg_types[3] = i32t;
 
+         if (gallivm->cache)
+            gallivm->cache->dont_cache = true;
          function = lp_build_const_func_pointer(gallivm,
                                                 func_to_pointer((func_pointer) format_desc->fetch_rgba_float),
                                                 ret_type,



More information about the mesa-commit mailing list