Nice catch!

Reviewed-by: Lionel Landwerlin <lionel.g.landwer...@intel.com>

On 22/07/18 05:45, Jordan Justen wrote:
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 <tarc...@itsqueeze.com>
Signed-off-by: Jordan Justen <jordan.l.jus...@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 =


_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to