Now every context refers to same disk_cache instance in screen.
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Suggested-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
vbo_use_buffer_objects(ctx);
vbo_always_unmap_buffers(ctx);
- brw_disk_cache_init(brw);
+ brw->ctx.Cache = brw->screen->disk_cache;
return true;
}
driDestroyOptionCache(&brw->optionCache);
- disk_cache_destroy(brw->ctx.Cache);
-
/* free the Mesa context */
_mesa_free_context_data(&brw->ctx);
}
void
-brw_disk_cache_init(struct brw_context *brw)
+brw_disk_cache_init(struct intel_screen *screen)
{
#ifdef ENABLE_SHADER_CACHE
if (env_var_as_boolean("MESA_GLSL_CACHE_DISABLE", true))
char renderer[10];
MAYBE_UNUSED int len = snprintf(renderer, sizeof(renderer), "i965_%04x",
- brw->screen->deviceID);
+ screen->deviceID);
assert(len == sizeof(renderer) - 1);
const struct build_id_note *note =
char timestamp[41];
_mesa_sha1_format(timestamp, id_sha1);
- brw->ctx.Cache = disk_cache_create(renderer, timestamp, 0);
+ screen->disk_cache = disk_cache_create(renderer, timestamp, 0);
#endif
}
uint32_t pma_stall_bits);
/* brw_disk_cache.c */
-void brw_disk_cache_init(struct brw_context *brw);
+void brw_disk_cache_init(struct intel_screen *screen);
bool brw_disk_cache_upload_program(struct brw_context *brw,
gl_shader_stage stage);
void brw_disk_cache_write_compute_program(struct brw_context *brw);
#include "compiler/nir/nir.h"
#include "utils.h"
+#include "util/disk_cache.h"
#include "util/xmlpool.h"
static const __DRIconfigOptionsExtension brw_config_options = {
brw_bufmgr_destroy(screen->bufmgr);
driDestroyOptionInfo(&screen->optionCache);
+ disk_cache_destroy(screen->disk_cache);
+
ralloc_free(screen);
sPriv->driverPrivate = NULL;
}
}
}
+ brw_disk_cache_init(screen);
+
return (const __DRIconfig**) intel_screen_make_configs(dri_screen);
}
bool mesa_format_supports_texture[MESA_FORMAT_COUNT];
bool mesa_format_supports_render[MESA_FORMAT_COUNT];
enum isl_format mesa_to_isl_render_format[MESA_FORMAT_COUNT];
+
+ struct disk_cache *disk_cache;
};
extern void intelDestroyContext(__DRIcontext * driContextPriv);