From 1b2e345110ef4f3e56934c0444e37ec9ebdc4bdd Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Thu, 14 May 2020 15:23:48 +1000 Subject: [PATCH] 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 Part-of: --- 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, -- 2.30.2