Mesa (staging/18.1): i965: Disable shader cache with INTEL_DEBUG=shader_time
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Thu Aug 2 18:25:45 UTC 2018
Module: Mesa
Branch: staging/18.1
Commit: 7a1e5f9b45e7b8c7dca96bee52fbaeb09d5684cb
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=7a1e5f9b45e7b8c7dca96bee52fbaeb09d5684cb
Author: Jordan Justen <jordan.l.justen at intel.com>
Date: Tue Jul 24 17:13:52 2018 -0700
i965: Disable shader cache with INTEL_DEBUG=shader_time
Shader time hard codes an index of the shader time buffer within the
gen program.
In order to support shader time in the disk shader cache, we'd need to
add the shader time index into the program key. This should work, but
probably is not worth it for this particular debug feature.
Therefore, let's just disable the disk shader cache if the shader time
debug feature is used.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106382
Fixes: 96fe36f7acc "i965: Enable disk shader cache by default"
Cc: Eero Tamminen <eero.t.tamminen at intel.com>
Cc: Kenneth Graunke <kenneth at whitecape.org>
Signed-off-by: Jordan Justen <jordan.l.justen at intel.com>
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
(cherry picked from commit 3887700dfd7597fba654a4a713c274213a4a8755)
Merged conflicts resolved by Dylan
Conflicts:
src/mesa/drivers/dri/i965/brw_disk_cache.c
---
src/intel/common/gen_debug.h | 7 +++++--
src/mesa/drivers/dri/i965/brw_disk_cache.c | 3 +++
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/src/intel/common/gen_debug.h b/src/intel/common/gen_debug.h
index 6040bf7425..3db7f3bc6e 100644
--- a/src/intel/common/gen_debug.h
+++ b/src/intel/common/gen_debug.h
@@ -84,10 +84,13 @@ extern uint64_t INTEL_DEBUG;
#define DEBUG_COLOR (1ull << 40)
#define DEBUG_REEMIT (1ull << 41)
+/* These flags are not compatible with the disk shader cache */
+#define DEBUG_DISK_CACHE_DISABLE_MASK DEBUG_SHADER_TIME
+
/* These flags may affect program generation */
#define DEBUG_DISK_CACHE_MASK \
- (DEBUG_SHADER_TIME | DEBUG_NO16 | DEBUG_NO_DUAL_OBJECT_GS | DEBUG_NO8 | \
- DEBUG_SPILL_FS | DEBUG_SPILL_VEC4 | DEBUG_NO_COMPACTION | DEBUG_DO32)
+ (DEBUG_NO16 | DEBUG_NO_DUAL_OBJECT_GS | DEBUG_NO8 | DEBUG_SPILL_FS | \
+ DEBUG_SPILL_VEC4 | DEBUG_NO_COMPACTION | DEBUG_DO32)
#ifdef HAVE_ANDROID_PLATFORM
#define LOG_TAG "INTEL-MESA"
diff --git a/src/mesa/drivers/dri/i965/brw_disk_cache.c b/src/mesa/drivers/dri/i965/brw_disk_cache.c
index b32d824bf0..36d796756f 100644
--- a/src/mesa/drivers/dri/i965/brw_disk_cache.c
+++ b/src/mesa/drivers/dri/i965/brw_disk_cache.c
@@ -422,6 +422,9 @@ void
brw_disk_cache_init(struct intel_screen *screen)
{
#ifdef ENABLE_SHADER_CACHE
+ if (INTEL_DEBUG & DEBUG_DISK_CACHE_DISABLE_MASK)
+ return;
+
char renderer[10];
MAYBE_UNUSED int len = snprintf(renderer, sizeof(renderer), "i965_%04x",
screen->deviceID);
More information about the mesa-commit
mailing list