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 <sroland@vmware.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/2303>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/2303>
This commit is contained in:
Dave Airlie 2019-12-03 15:23:45 +10:00
parent c717ac1247
commit e6b2af56cb
5 changed files with 30 additions and 11 deletions

View File

@ -527,6 +527,7 @@ piglit-quick_gl:
extends: .piglit-test
variables:
LP_NUM_THREADS: 0
NIR_VALIDATE: 0
PIGLIT_OPTIONS: >
--process-isolation false
-x arb_gpu_shader5
@ -542,12 +543,14 @@ piglit-glslparser:
extends: .piglit-test
variables:
LP_NUM_THREADS: 0
NIR_VALIDATE: 0
PIGLIT_PROFILES: glslparser
piglit-quick_shader:
extends: .piglit-test
variables:
LP_NUM_THREADS: 1
NIR_VALIDATE: 0
PIGLIT_PROFILES: quick_shader
.deqp-test:
@ -572,6 +575,7 @@ test-llvmpipe-gles2:
variables:
DEQP_VER: gles2
DEQP_PARALLEL: 4
NIR_VALIDATE: 0
# Don't use threads inside llvmpipe, we've already got all 4 cores
# busy with DEQP_PARALLEL.
LP_NUM_THREADS: 0

View File

@ -398,7 +398,6 @@ spec/!opengl 4.5/compare-framebuffer-parameter-with-get: skip
spec/!opengl 4.5/named-framebuffer-draw-buffers-errors: skip
spec/!opengl 4.5/named-framebuffer-read-buffer-errors: skip
spec/!opengl es 2.0/invalid-es3-queries_gles2: skip
spec/!opengl es 3.0/gles-3.0-transform-feedback-uniform-buffer-object: fail
spec/!opengl es 3.0/minmax: fail
spec/3dfx_texture_compression_fxt1/compressedteximage gl_compressed_rgb_fxt1_3dfx: skip
spec/3dfx_texture_compression_fxt1/compressedteximage gl_compressed_rgba_fxt1_3dfx: skip
@ -2222,8 +2221,8 @@ wgl/wgl-sanity: skip
summary:
name: results
---- --------
pass: 19301
fail: 237
pass: 19302
fail: 236
crash: 2
skip: 1962
timeout: 0

View File

@ -45,7 +45,7 @@
#define DEBUG_MEM 0x4000
#define DEBUG_FS 0x8000
#define DEBUG_CS 0x10000
#define DEBUG_NIR 0x20000
#define DEBUG_TGSI_IR 0x20000
/* Performance flags. These are active even on release builds.
*/

View File

@ -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;

View File

@ -60,6 +60,8 @@ struct llvmpipe_screen
struct lp_cs_tpool *cs_tpool;
mtx_t cs_mutex;
bool use_tgsi;
};