[Mesa-dev] [PATCH 2/2] i965/disk_cache: Add in the INTEL_DEBUG value to the renderer string

Jordan Justen jordan.l.justen at intel.com
Sun Jul 22 04:45:01 UTC 2018


Since various options within INTEL_DEBUG could impact code generation,
we should add this into the renderer string so changing the
INTEL_DEBUG setting will cause the shader cache to work properly.

An example that will affect the program generated by i965 is the
INTEL_DEBUG=nocompact option.

Adding in the entire 64-bits of INTEL_DEBUG is overkill. Many
INTEL_DEBUG options won't actually impact the program generated by the
driver. Nevertheless, it is more maintainable and safer to just add
the entire 64-bit value.

Cc: Timothy Arceri <tarceri at itsqueeze.com>
Signed-off-by: Jordan Justen <jordan.l.justen at intel.com>
---
 src/mesa/drivers/dri/i965/brw_disk_cache.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_disk_cache.c b/src/mesa/drivers/dri/i965/brw_disk_cache.c
index a678c355b9d..6e50476f812 100644
--- a/src/mesa/drivers/dri/i965/brw_disk_cache.c
+++ b/src/mesa/drivers/dri/i965/brw_disk_cache.c
@@ -378,9 +378,10 @@ brw_disk_cache_init(struct intel_screen *screen)
 {
 #ifdef ENABLE_SHADER_CACHE
    /* array length: print length + null char + 1 extra to verify it is unused */
-   char renderer[11];
-   MAYBE_UNUSED int len = snprintf(renderer, sizeof(renderer), "i965_%04x",
-                                   screen->deviceID);
+   char renderer[28];
+   MAYBE_UNUSED int len =
+      snprintf(renderer, sizeof(renderer), "i965_%04x_%016" PRIx64,
+               screen->deviceID, INTEL_DEBUG);
    assert(len == sizeof(renderer) - 2);
 
    const struct build_id_note *note =
-- 
2.18.0



More information about the mesa-dev mailing list