llvmpipe: use an alternate env var to enable clover.

This can be used outside debug contexts.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6928>
This commit is contained in:
Dave Airlie 2020-09-29 08:35:20 +10:00
parent 760ba65733
commit b0504ed682
3 changed files with 4 additions and 4 deletions

View file

@ -46,8 +46,7 @@
#define DEBUG_FS 0x8000
#define DEBUG_CS 0x10000
#define DEBUG_TGSI_IR 0x20000
#define DEBUG_CL 0x40000
#define DEBUG_CACHE_STATS 0x80000
#define DEBUG_CACHE_STATS 0x40000
/* Performance flags. These are active even on release builds.
*/

View file

@ -74,7 +74,6 @@ static const struct debug_named_value lp_debug_flags[] = {
{ "fs", DEBUG_FS, NULL },
{ "cs", DEBUG_CS, NULL },
{ "tgsi_ir", DEBUG_TGSI_IR, NULL },
{ "cl", DEBUG_CL, NULL },
{ "cache_stats", DEBUG_CACHE_STATS, NULL },
DEBUG_NAMED_VALUE_END
};
@ -357,7 +356,7 @@ llvmpipe_get_shader_param(struct pipe_screen *screen,
switch(shader)
{
case PIPE_SHADER_COMPUTE:
if ((LP_DEBUG & DEBUG_CL) && param == PIPE_SHADER_CAP_SUPPORTED_IRS)
if ((lscreen->allow_cl) && param == PIPE_SHADER_CAP_SUPPORTED_IRS)
return (1 << PIPE_SHADER_IR_TGSI) | (1 << PIPE_SHADER_IR_NIR) | (1 << PIPE_SHADER_IR_NIR_SERIALIZED);
/* fallthrough */
case PIPE_SHADER_FRAGMENT:
@ -914,6 +913,7 @@ llvmpipe_create_screen(struct sw_winsys *winsys)
screen->base.get_disk_shader_cache = lp_get_disk_shader_cache;
llvmpipe_init_screen_resource_funcs(&screen->base);
screen->allow_cl = !!getenv("LP_CL");
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

View file

@ -62,6 +62,7 @@ struct llvmpipe_screen
mtx_t cs_mutex;
bool use_tgsi;
bool allow_cl;
struct disk_cache *disk_shader_cache;
unsigned num_disk_shader_cache_hits;