util: Move gallium's PIPE_FORMAT utils to /util/format/
[mesa.git] / src / gallium / drivers / nouveau / nouveau_screen.c
index 0af69252d70e1173819d91cd339895eceb609162..de9cce3812aa9c6aea382fb67f4452e2138876d1 100644 (file)
@@ -4,8 +4,8 @@
 
 #include "util/u_memory.h"
 #include "util/u_inlines.h"
-#include "util/u_format.h"
-#include "util/u_format_s3tc.h"
+#include "util/format/u_format.h"
+#include "util/format/u_format_s3tc.h"
 #include "util/u_string.h"
 
 #include "util/os_time.h"
@@ -23,6 +23,8 @@
 #include "nouveau_mm.h"
 #include "nouveau_buffer.h"
 
+#include <compiler/glsl_types.h>
+
 /* XXX this should go away */
 #include "state_tracker/drm_driver.h"
 
@@ -187,6 +189,9 @@ nouveau_screen_init(struct nouveau_screen *screen, struct nouveau_device *dev)
       nouveau_mesa_debug = atoi(nv_dbg);
 
    screen->prefer_nir = debug_get_bool_option("NV50_PROG_USE_NIR", false);
+   screen->force_enable_cl = debug_get_bool_option("NOUVEAU_ENABLE_CL", false);
+   if (screen->force_enable_cl)
+      glsl_type_singleton_init_or_ref();
 
    /* These must be set before any failure is possible, as the cleanup
     * paths assume they're responsible for deleting them.
@@ -279,6 +284,9 @@ nouveau_screen_fini(struct nouveau_screen *screen)
 {
    int fd = screen->drm->fd;
 
+   if (screen->force_enable_cl)
+      glsl_type_singleton_decref();
+
    nouveau_mm_destroy(screen->mm_GART);
    nouveau_mm_destroy(screen->mm_VRAM);