From c8042c289e7622e918bd852227426c9413c9beb5 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Tue, 10 Dec 2019 14:55:43 +1000 Subject: [PATCH] llvmpipe: add debug option to enable OpenCL support. LP_DEBUG=cl will enable CL support for now. Acked-by: Roland Scheidegger --- src/gallium/drivers/llvmpipe/lp_debug.h | 1 + src/gallium/drivers/llvmpipe/lp_screen.c | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/llvmpipe/lp_debug.h b/src/gallium/drivers/llvmpipe/lp_debug.h index 972831a4f0e..4e17f41cd9d 100644 --- a/src/gallium/drivers/llvmpipe/lp_debug.h +++ b/src/gallium/drivers/llvmpipe/lp_debug.h @@ -46,6 +46,7 @@ #define DEBUG_FS 0x8000 #define DEBUG_CS 0x10000 #define DEBUG_TGSI_IR 0x20000 +#define DEBUG_CL 0x40000 /* Performance flags. These are active even on release builds. */ diff --git a/src/gallium/drivers/llvmpipe/lp_screen.c b/src/gallium/drivers/llvmpipe/lp_screen.c index 2a665c10fd3..8258614aebe 100644 --- a/src/gallium/drivers/llvmpipe/lp_screen.c +++ b/src/gallium/drivers/llvmpipe/lp_screen.c @@ -74,6 +74,7 @@ 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 }, DEBUG_NAMED_VALUE_END }; #endif @@ -411,8 +412,10 @@ llvmpipe_get_shader_param(struct pipe_screen *screen, { switch(shader) { - case PIPE_SHADER_FRAGMENT: case PIPE_SHADER_COMPUTE: + if ((LP_DEBUG & DEBUG_CL) && param == PIPE_SHADER_CAP_SUPPORTED_IRS) + return (1 << PIPE_SHADER_IR_TGSI) | (1 << PIPE_SHADER_IR_NIR) | (1 << PIPE_SHADER_IR_NIR_SERIALIZED); + case PIPE_SHADER_FRAGMENT: if (param == PIPE_SHADER_CAP_PREFERRED_IR) { struct llvmpipe_screen *lscreen = llvmpipe_screen(screen); if (lscreen->use_tgsi) @@ -420,7 +423,6 @@ llvmpipe_get_shader_param(struct pipe_screen *screen, else return PIPE_SHADER_IR_NIR; } - switch (param) { default: return gallivm_get_shader_param(param); -- 2.30.2