radeonsi: set drirc compiler options before calling common screen init
authorNicolai Hähnle <nicolai.haehnle@amd.com>
Thu, 3 Aug 2017 12:53:41 +0000 (14:53 +0200)
committerNicolai Hähnle <nicolai.haehnle@amd.com>
Fri, 4 Aug 2017 08:46:01 +0000 (10:46 +0200)
Also, access the options directly, allowing us to get rid of the
PIPE_SCREEN_xxx flags.

Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/gallium/drivers/r600/r600_pipe.c
src/gallium/drivers/radeon/r600_pipe_common.c
src/gallium/drivers/radeon/r600_pipe_common.h
src/gallium/drivers/radeonsi/si_pipe.c

index 9263659be328d5840ffe3bb387e45f0e928645bd..023f1b4bd14f81f6db20ef9ce1065c2ed4b3bb68 100644 (file)
@@ -651,7 +651,7 @@ struct pipe_screen *r600_screen_create(struct radeon_winsys *ws,
        rscreen->b.b.get_shader_param = r600_get_shader_param;
        rscreen->b.b.resource_create = r600_resource_create;
 
-       if (!r600_common_screen_init(&rscreen->b, ws, config->flags)) {
+       if (!r600_common_screen_init(&rscreen->b, ws)) {
                FREE(rscreen);
                return NULL;
        }
index e9402f89137498bc847c2ce87467a8b827ae3217..1342092fec5b992b71d6c6d14455eca521f0ef34 100644 (file)
@@ -1335,7 +1335,7 @@ struct pipe_resource *r600_resource_create_common(struct pipe_screen *screen,
 }
 
 bool r600_common_screen_init(struct r600_common_screen *rscreen,
-                            struct radeon_winsys *ws, unsigned flags)
+                            struct radeon_winsys *ws)
 {
        char family_name[32] = {}, llvm_string[32] = {}, kernel_version[128] = {};
        struct utsname uname_data;
@@ -1392,15 +1392,10 @@ bool r600_common_screen_init(struct r600_common_screen *rscreen,
 
        rscreen->family = rscreen->info.family;
        rscreen->chip_class = rscreen->info.chip_class;
-       rscreen->debug_flags = debug_get_flags_option("R600_DEBUG", common_debug_options, 0);
+       rscreen->debug_flags |= debug_get_flags_option("R600_DEBUG", common_debug_options, 0);
        rscreen->has_rbplus = false;
        rscreen->rbplus_allowed = false;
 
-       /* Set the flag in debug_flags, so that the shader cache takes it
-        * into account. */
-       if (flags & PIPE_SCREEN_ENABLE_CORRECT_TGSI_DERIVATIVES_AFTER_KILL)
-               rscreen->debug_flags |= DBG_FS_CORRECT_DERIVS_AFTER_KILL;
-
        r600_disk_cache_create(rscreen);
 
        slab_create_parent(&rscreen->pool_transfers, sizeof(struct r600_transfer), 64);
index fb52dfb529772c58dcca30b29e9e3a751a9c13bf..9a733274dc9904f42bd7ec5f32709f68db7f3041 100644 (file)
@@ -748,7 +748,7 @@ void r600_draw_rectangle(struct blitter_context *blitter,
                         enum blitter_attrib_type type,
                         const union pipe_color_union *attrib);
 bool r600_common_screen_init(struct r600_common_screen *rscreen,
-                            struct radeon_winsys *ws, unsigned flags);
+                            struct radeon_winsys *ws);
 void r600_destroy_common_screen(struct r600_common_screen *rscreen);
 void r600_preflush_suspend_features(struct r600_common_context *ctx);
 void r600_postflush_resume_features(struct r600_common_context *ctx);
index b32a77dcc4688a79214cf4b5fb8637e46617021a..395853c7d9f3940cb9982cd2732eba33772381a9 100644 (file)
@@ -987,16 +987,22 @@ struct pipe_screen *radeonsi_screen_create(struct radeon_winsys *ws,
 
        si_init_screen_state_functions(sscreen);
 
-       if (!r600_common_screen_init(&sscreen->b, ws, config->flags) ||
+       /* Set these flags in debug_flags early, so that the shader cache takes
+        * them into account.
+        */
+       if (driQueryOptionb(config->options,
+                           "glsl_correct_derivatives_after_discard"))
+               sscreen->b.debug_flags |= DBG_FS_CORRECT_DERIVS_AFTER_KILL;
+       if (driQueryOptionb(config->options, "radeonsi_enable_sisched"))
+               sscreen->b.debug_flags |= DBG_SI_SCHED;
+
+       if (!r600_common_screen_init(&sscreen->b, ws) ||
            !si_init_gs_info(sscreen) ||
            !si_init_shader_cache(sscreen)) {
                FREE(sscreen);
                return NULL;
        }
 
-       if (driQueryOptionb(config->options, "radeonsi_enable_sisched"))
-               sscreen->b.debug_flags |= DBG_SI_SCHED;
-
        /* Only enable as many threads as we have target machines, but at most
         * the number of CPUs - 1 if there is more than one.
         */