diff --git a/src/gallium/drivers/nouveau/nouveau_screen.c b/src/gallium/drivers/nouveau/nouveau_screen.c index ed5759231ea..22924204514 100644 --- a/src/gallium/drivers/nouveau/nouveau_screen.c +++ b/src/gallium/drivers/nouveau/nouveau_screen.c @@ -296,9 +296,6 @@ nouveau_screen_init(struct nouveau_screen *screen, struct nouveau_device *dev) nouveau_mesa_debug = atoi(nv_dbg); screen->force_enable_cl = debug_get_bool_option("NOUVEAU_ENABLE_CL", false); - if (screen->force_enable_cl) - glsl_type_singleton_init_or_ref(); - screen->disable_fences = debug_get_bool_option("NOUVEAU_DISABLE_FENCES", false); /* These must be set before any failure is possible, as the cleanup @@ -444,6 +441,9 @@ nouveau_screen_init(struct nouveau_screen *screen, struct nouveau_device *dev) NOUVEAU_BO_GART | NOUVEAU_BO_MAP, &mm_config); screen->mm_VRAM = nouveau_mm_create(dev, NOUVEAU_BO_VRAM, &mm_config); + + glsl_type_singleton_init_or_ref(); + return 0; err: @@ -457,8 +457,7 @@ nouveau_screen_fini(struct nouveau_screen *screen) { int fd = screen->drm->fd; - if (screen->force_enable_cl) - glsl_type_singleton_decref(); + glsl_type_singleton_decref(); if (screen->has_svm) os_munmap(screen->svm_cutout, screen->svm_cutout_size);