diff --git a/src/gallium/drivers/r600/r600_asm.c b/src/gallium/drivers/r600/r600_asm.c index 0a79a1d6525..708c9c342be 100644 --- a/src/gallium/drivers/r600/r600_asm.c +++ b/src/gallium/drivers/r600/r600_asm.c @@ -2735,8 +2735,7 @@ void *r600_create_vertex_fetch_shader(struct pipe_context *ctx, uint32_t *bytecode; int i, j, r, fs_size; struct r600_fetch_shader *shader; - unsigned no_sb = rctx->screen->b.debug_flags & DBG_NO_SB || - (rctx->screen->b.debug_flags & DBG_NIR); + unsigned no_sb = rctx->screen->b.debug_flags & (DBG_NO_SB | DBG_NIR); unsigned sb_disasm = !no_sb || (rctx->screen->b.debug_flags & DBG_SB_DISASM); assert(count < 32); diff --git a/src/gallium/drivers/r600/r600_pipe.c b/src/gallium/drivers/r600/r600_pipe.c index d0a880b8e98..fc7d8d46e12 100644 --- a/src/gallium/drivers/r600/r600_pipe.c +++ b/src/gallium/drivers/r600/r600_pipe.c @@ -245,8 +245,7 @@ fail: } static bool is_nir_enabled(struct r600_common_screen *screen) { - return (screen->debug_flags & DBG_NIR_PREFERRED); /* && - screen->family >= CHIP_CEDAR);*/ + return !(screen->debug_flags & DBG_USE_TGSI); } /* @@ -319,7 +318,7 @@ static int r600_get_param(struct pipe_screen* pscreen, enum pipe_cap param) return 1; case PIPE_CAP_NIR_ATOMICS_AS_DEREF: - return rscreen->b.debug_flags & DBG_NIR_PREFERRED; + return is_nir_enabled(&rscreen->b); case PIPE_CAP_TEXTURE_TRANSFER_MODES: return PIPE_TEXTURE_TRANSFER_BLIT; diff --git a/src/gallium/drivers/r600/r600_pipe.h b/src/gallium/drivers/r600/r600_pipe.h index 837a71f22f3..8e1cc69447f 100644 --- a/src/gallium/drivers/r600/r600_pipe.h +++ b/src/gallium/drivers/r600/r600_pipe.h @@ -270,8 +270,6 @@ struct r600_gs_rings_state { #define DBG_NIR_SB (1 << 28) #define DBG_USE_TGSI (1 << 29) -#define DBG_NIR_PREFERRED (DBG_NIR_SB | DBG_NIR) - struct r600_screen { struct r600_common_screen b; bool has_msaa; diff --git a/src/gallium/drivers/r600/r600_pipe_common.c b/src/gallium/drivers/r600/r600_pipe_common.c index 278c56e5afe..1ba00395a00 100644 --- a/src/gallium/drivers/r600/r600_pipe_common.c +++ b/src/gallium/drivers/r600/r600_pipe_common.c @@ -775,10 +775,7 @@ static void r600_disk_cache_create(struct r600_common_screen *rscreen) /* These flags affect shader compilation. */ uint64_t shader_debug_flags = - rscreen->debug_flags & - (DBG_NIR | - DBG_NIR_PREFERRED | - DBG_USE_TGSI); + rscreen->debug_flags & DBG_USE_TGSI; rscreen->disk_shader_cache = disk_cache_create(r600_get_family_name(rscreen), @@ -1392,7 +1389,7 @@ bool r600_common_screen_init(struct r600_common_screen *rscreen, nir_lower_dtrunc; } - if (!(rscreen->debug_flags & DBG_NIR_PREFERRED)) { + if (rscreen->debug_flags & DBG_USE_TGSI) { rscreen->nir_options.lower_fpow = false; /* TGSI is vector, and NIR-to-TGSI doesn't like it when the diff --git a/src/gallium/drivers/r600/r600_shader.c b/src/gallium/drivers/r600/r600_shader.c index 4f88635e7e4..86a74a73713 100644 --- a/src/gallium/drivers/r600/r600_shader.c +++ b/src/gallium/drivers/r600/r600_shader.c @@ -179,14 +179,15 @@ int r600_pipe_shader_create(struct pipe_context *ctx, pipe_shader_type_from_mesa(sel->nir->info.stage); bool dump = r600_can_dump_shader(&rctx->screen->b, processor); - unsigned use_sb = !(rctx->screen->b.debug_flags & DBG_NO_SB) || + unsigned use_sb = (rctx->screen->b.debug_flags & DBG_USE_TGSI && + !(rctx->screen->b.debug_flags & DBG_NO_SB)) || (rctx->screen->b.debug_flags & DBG_NIR_SB); unsigned sb_disasm; unsigned export_shader; shader->shader.bc.isa = rctx->isa; - if (!(rscreen->b.debug_flags & DBG_NIR_PREFERRED)) { + if (rscreen->b.debug_flags & DBG_USE_TGSI) { assert(sel->ir_type == PIPE_SHADER_IR_TGSI); r = r600_shader_from_tgsi(rctx, shader, key); if (r) { @@ -223,7 +224,7 @@ int r600_pipe_shader_create(struct pipe_context *ctx, tgsi_dump(sel->tokens, 0); } - if (rscreen->b.debug_flags & (DBG_NIR_PREFERRED)) { + if (!(rscreen->b.debug_flags & DBG_USE_TGSI)) { fprintf(stderr, "--NIR --------------------------------------------------------\n"); nir_print_shader(sel->nir, stderr); } diff --git a/src/gallium/drivers/r600/r600_state_common.c b/src/gallium/drivers/r600/r600_state_common.c index df4c64c8e09..d03fcd2b378 100644 --- a/src/gallium/drivers/r600/r600_state_common.c +++ b/src/gallium/drivers/r600/r600_state_common.c @@ -992,7 +992,7 @@ struct r600_pipe_shader_selector *r600_create_shader_state_tokens(struct pipe_co } else if (ir == PIPE_SHADER_IR_NIR){ nir_shader *s = (nir_shader *)prog; - if (!(rscreen->b.debug_flags & DBG_NIR_PREFERRED)) { + if (rscreen->b.debug_flags & DBG_USE_TGSI) { sel->tokens = (void *)nir_to_tgsi(s, ctx->screen); ir = PIPE_SHADER_IR_TGSI; tgsi_scan_shader(sel->tokens, &sel->info); diff --git a/src/gallium/drivers/r600/sfn/sfn_nir.cpp b/src/gallium/drivers/r600/sfn/sfn_nir.cpp index 2f0982314e6..6bd30437bd1 100644 --- a/src/gallium/drivers/r600/sfn/sfn_nir.cpp +++ b/src/gallium/drivers/r600/sfn/sfn_nir.cpp @@ -801,8 +801,7 @@ int r600_shader_from_nir(struct r600_context *rctx, NIR_PASS_V(sh, nir_convert_from_ssa, true); NIR_PASS_V(sh, nir_opt_dce); - if ((rctx->screen->b.debug_flags & DBG_NIR_PREFERRED) && - (rctx->screen->b.debug_flags & DBG_ALL_SHADERS)) { + if (rctx->screen->b.debug_flags & DBG_ALL_SHADERS) { fprintf(stderr, "-- NIR --------------------------------------------------------\n"); struct nir_function *func = (struct nir_function *)exec_list_get_head(&sh->functions); nir_index_ssa_defs(func->impl);