diff options
author | Dave Airlie <[email protected]> | 2019-12-03 15:23:45 +1000 |
---|---|---|
committer | Dave Airlie <[email protected]> | 2019-12-21 13:07:17 +1000 |
commit | e6b2af56cb037e3174d049478e0ad7c7715780e4 (patch) | |
tree | 4b1ae4eedbec123d8502b6c7c8e8954d6475fc2d /src/gallium/drivers/llvmpipe/lp_screen.c | |
parent | c717ac1247c3c7243af2f1b2732cccb882b75f11 (diff) |
llvmpipe: switch to NIR by default
Add LP_DEBUG=tgsi_ir (tgsi already taken) to fallback to TGSI paths.
Disable NIR_VALIDATE in CI (Michel/Eric acked)
Reviewed-by: Roland Scheidegger <[email protected]>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/2303>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/2303>
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_screen.c')
-rw-r--r-- | src/gallium/drivers/llvmpipe/lp_screen.c | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_screen.c b/src/gallium/drivers/llvmpipe/lp_screen.c index 94810de8372..b238cce808f 100644 --- a/src/gallium/drivers/llvmpipe/lp_screen.c +++ b/src/gallium/drivers/llvmpipe/lp_screen.c @@ -73,7 +73,7 @@ static const struct debug_named_value lp_debug_flags[] = { { "mem", DEBUG_MEM, NULL }, { "fs", DEBUG_FS, NULL }, { "cs", DEBUG_CS, NULL }, - { "nir", DEBUG_NIR, NULL }, + { "tgsi_ir", DEBUG_TGSI_IR, NULL }, DEBUG_NAMED_VALUE_END }; #endif @@ -395,8 +395,10 @@ llvmpipe_get_param(struct pipe_screen *screen, enum pipe_cap param) case PIPE_CAP_TGSI_FS_FACE_IS_INTEGER_SYSVAL: return 1; case PIPE_CAP_LOAD_CONSTBUF: - case PIPE_CAP_PACKED_UNIFORMS: - return !!(LP_DEBUG & DEBUG_NIR); + case PIPE_CAP_PACKED_UNIFORMS: { + struct llvmpipe_screen *lscreen = llvmpipe_screen(screen); + return !lscreen->use_tgsi; + } default: return u_pipe_screen_get_param_defaults(screen, param); } @@ -411,16 +413,27 @@ llvmpipe_get_shader_param(struct pipe_screen *screen, { case PIPE_SHADER_FRAGMENT: case PIPE_SHADER_COMPUTE: + if (param == PIPE_SHADER_CAP_PREFERRED_IR) { + struct llvmpipe_screen *lscreen = llvmpipe_screen(screen); + if (lscreen->use_tgsi) + return PIPE_SHADER_IR_TGSI; + else + return PIPE_SHADER_IR_NIR; + } + switch (param) { default: - if ((LP_DEBUG & DEBUG_NIR) && param == PIPE_SHADER_CAP_PREFERRED_IR) - return PIPE_SHADER_IR_NIR; return gallivm_get_shader_param(param); } case PIPE_SHADER_VERTEX: case PIPE_SHADER_GEOMETRY: - if ((LP_DEBUG & DEBUG_NIR) && param == PIPE_SHADER_CAP_PREFERRED_IR) - return PIPE_SHADER_IR_NIR; + if (param == PIPE_SHADER_CAP_PREFERRED_IR) { + struct llvmpipe_screen *lscreen = llvmpipe_screen(screen); + if (lscreen->use_tgsi) + return PIPE_SHADER_IR_TGSI; + else + return PIPE_SHADER_IR_NIR; + } switch (param) { case PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS: @@ -822,6 +835,7 @@ llvmpipe_create_screen(struct sw_winsys *winsys) screen->base.finalize_nir = llvmpipe_finalize_nir; llvmpipe_init_screen_resource_funcs(&screen->base); + screen->use_tgsi = (LP_DEBUG & DEBUG_TGSI_IR); screen->num_threads = util_cpu_caps.nr_cpus > 1 ? util_cpu_caps.nr_cpus : 0; #ifdef EMBEDDED_DEVICE screen->num_threads = 0; |