static void
nouveau_disk_cache_create(struct nouveau_screen *screen)
{
- uint32_t mesa_timestamp;
- char *timestamp_str;
- int res;
-
- if (disk_cache_get_function_timestamp(nouveau_disk_cache_create,
- &mesa_timestamp)) {
- res = asprintf(×tamp_str, "%u", mesa_timestamp);
- if (res != -1) {
- screen->disk_shader_cache =
- disk_cache_create(nouveau_screen_get_name(&screen->base),
- timestamp_str, 0);
- free(timestamp_str);
- }
- }
+ struct mesa_sha1 ctx;
+ unsigned char sha1[20];
+ char cache_id[20 * 2 + 1];
+ uint64_t driver_flags = 0;
+
+ _mesa_sha1_init(&ctx);
+ if (!disk_cache_get_function_identifier(nouveau_disk_cache_create,
+ &ctx))
+ return;
+
+ _mesa_sha1_final(&ctx, sha1);
+ disk_cache_format_hex_id(cache_id, sha1, 20 * 2);
+
+ if (screen->prefer_nir)
+ driver_flags |= NOUVEAU_SHADER_CACHE_FLAGS_IR_NIR;
+ else
+ driver_flags |= NOUVEAU_SHADER_CACHE_FLAGS_IR_TGSI;
+
+ screen->disk_shader_cache =
+ disk_cache_create(nouveau_screen_get_name(&screen->base),
+ cache_id, driver_flags);
}
int
if (nv_dbg)
nouveau_mesa_debug = atoi(nv_dbg);
+ screen->prefer_nir = debug_get_bool_option("NV50_PROG_USE_NIR", false);
+
/* These must be set before any failure is possible, as the cleanup
* paths assume they're responsible for deleting them.
*/
nouveau_disk_cache_create(screen);
+ screen->transfer_pushbuf_threshold = 192;
screen->lowmem_bindings = PIPE_BIND_GLOBAL; /* gallium limit */
screen->vidmem_bindings =
PIPE_BIND_RENDER_TARGET | PIPE_BIND_DEPTH_STENCIL |