<div dir="ltr">This is better but there are still environment variables that affect compilation.  For instance, the INTEL_SCALAR_VS/TCS/TES/GS environment variables.<br></div><br><div class="gmail_quote"><div dir="ltr">On Sun, Jul 22, 2018 at 9:28 PM Jordan Justen <<a href="mailto:jordan.l.justen@intel.com">jordan.l.justen@intel.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Since various options within INTEL_DEBUG could impact code generation,<br>
we need to set the disk cache driver_flags parameter based on the<br>
INTEL_DEBUG flags in use.<br>
<br>
An example that will affect the program generated by i965 is the<br>
INTEL_DEBUG=nocompact option.<br>
<br>
The DEBUG_DISK_CACHE_MASK value is added to mask the settings of<br>
INTEL_DEBUG that can affect program generation.<br>
<br>
v2:<br>
 * Use driver_flags (Tim)<br>
 * Also update Anvil (Jason)<br>
<br>
Signed-off-by: Jordan Justen <<a href="mailto:jordan.l.justen@intel.com" target="_blank">jordan.l.justen@intel.com</a>><br>
Reviewed-by: Lionel Landwerlin <<a href="mailto:lionel.g.landwerlin@intel.com" target="_blank">lionel.g.landwerlin@intel.com</a>> (v1)<br>
---<br>
 src/intel/common/gen_debug.h               | 5 +++++<br>
 src/intel/vulkan/anv_device.c              | 3 ++-<br>
 src/mesa/drivers/dri/i965/brw_disk_cache.c | 3 ++-<br>
 3 files changed, 9 insertions(+), 2 deletions(-)<br>
<br>
diff --git a/src/intel/common/gen_debug.h b/src/intel/common/gen_debug.h<br>
index f6c44eeb912..aa9f3cf80d7 100644<br>
--- a/src/intel/common/gen_debug.h<br>
+++ b/src/intel/common/gen_debug.h<br>
@@ -84,6 +84,11 @@ extern uint64_t INTEL_DEBUG;<br>
 #define DEBUG_COLOR               (1ull << 40)<br>
 #define DEBUG_REEMIT              (1ull << 41)<br>
<br>
+/* These flags may affect program generation */<br>
+#define DEBUG_DISK_CACHE_MASK \<br>
+   (DEBUG_SHADER_TIME | DEBUG_NO16 | DEBUG_NO_DUAL_OBJECT_GS | DEBUG_NO8 | \<br>
+   DEBUG_SPILL_FS | DEBUG_SPILL_VEC4 | DEBUG_NO_COMPACTION | DEBUG_DO32)<br>
+<br>
 #ifdef HAVE_ANDROID_PLATFORM<br>
 #define LOG_TAG "INTEL-MESA"<br>
 #if ANDROID_API_LEVEL >= 26<br>
diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c<br>
index 247ba641336..97a71563b8a 100644<br>
--- a/src/intel/vulkan/anv_device.c<br>
+++ b/src/intel/vulkan/anv_device.c<br>
@@ -286,7 +286,8 @@ anv_physical_device_init_disk_cache(struct anv_physical_device *device)<br>
    char timestamp[41];<br>
    _mesa_sha1_format(timestamp, device->driver_build_sha1);<br>
<br>
-   device->disk_cache = disk_cache_create(renderer, timestamp, 0);<br>
+   const uint64_t driver_flags = INTEL_DEBUG & DEBUG_DISK_CACHE_MASK;<br>
+   device->disk_cache = disk_cache_create(renderer, timestamp, driver_flags);<br>
 #else<br>
    device->disk_cache = NULL;<br>
 #endif<br>
diff --git a/src/mesa/drivers/dri/i965/brw_disk_cache.c b/src/mesa/drivers/dri/i965/brw_disk_cache.c<br>
index a678c355b9d..8f1b064fd61 100644<br>
--- a/src/mesa/drivers/dri/i965/brw_disk_cache.c<br>
+++ b/src/mesa/drivers/dri/i965/brw_disk_cache.c<br>
@@ -393,6 +393,7 @@ brw_disk_cache_init(struct intel_screen *screen)<br>
    char timestamp[41];<br>
    _mesa_sha1_format(timestamp, id_sha1);<br>
<br>
-   screen->disk_cache = disk_cache_create(renderer, timestamp, 0);<br>
+   const uint64_t driver_flags = INTEL_DEBUG & DEBUG_DISK_CACHE_MASK;<br>
+   screen->disk_cache = disk_cache_create(renderer, timestamp, driver_flags);<br>
 #endif<br>
 }<br>
-- <br>
2.18.0<br>
<br>
_______________________________________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org" target="_blank">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
</blockquote></div>