radeonsi: set drirc compiler options before calling common screen init

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>
This commit is contained in:
Nicolai Hähnle 2017-08-03 14:53:41 +02:00
parent 3b5743ead5
commit 12ce39d3de
4 changed files with 14 additions and 13 deletions

View 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;
}

View 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);

View 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);

View 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.
*/