From 8dcf78d6d019ea004547eb5708677d34286f8c2a Mon Sep 17 00:00:00 2001 From: Emma Anholt Date: Thu, 18 May 2023 13:26:43 -0700 Subject: [PATCH] llvmpipe: Drop the LP_DEBUG=tgsi_ir debug option. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit No need to support this, it's unused and untested. Reviewed-by: Alyssa Rosenzweig Acked-by: Marek Olšák Part-of: --- src/gallium/drivers/llvmpipe/lp_debug.h | 1 - src/gallium/drivers/llvmpipe/lp_screen.c | 50 +++++++++----------------------- src/gallium/drivers/llvmpipe/lp_screen.h | 4 +-- 3 files changed, 15 insertions(+), 40 deletions(-) diff --git a/src/gallium/drivers/llvmpipe/lp_debug.h b/src/gallium/drivers/llvmpipe/lp_debug.h index 9bea35c..56cb706 100644 --- a/src/gallium/drivers/llvmpipe/lp_debug.h +++ b/src/gallium/drivers/llvmpipe/lp_debug.h @@ -45,7 +45,6 @@ #define DEBUG_MEM 0x4000 #define DEBUG_FS 0x8000 #define DEBUG_CS 0x10000 -#define DEBUG_TGSI_IR 0x20000 // unused 0x40000 #define DEBUG_NO_FASTPATH 0x80000 #define DEBUG_LINEAR 0x100000 diff --git a/src/gallium/drivers/llvmpipe/lp_screen.c b/src/gallium/drivers/llvmpipe/lp_screen.c index e0940c3..b0a5b61 100644 --- a/src/gallium/drivers/llvmpipe/lp_screen.c +++ b/src/gallium/drivers/llvmpipe/lp_screen.c @@ -79,7 +79,6 @@ static const struct debug_named_value lp_debug_flags[] = { { "mem", DEBUG_MEM, NULL }, { "fs", DEBUG_FS, NULL }, { "cs", DEBUG_CS, NULL }, - { "tgsi_ir", DEBUG_TGSI_IR, NULL }, { "accurate_a0", DEBUG_ACCURATE_A0 }, { "mesh", DEBUG_MESH }, DEBUG_NAMED_VALUE_END @@ -196,10 +195,8 @@ llvmpipe_get_param(struct pipe_screen *screen, enum pipe_cap param) case PIPE_CAP_MAX_GEOMETRY_OUTPUT_VERTICES: case PIPE_CAP_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS: return 1024; - case PIPE_CAP_MAX_VERTEX_STREAMS: { - struct llvmpipe_screen *lscreen = llvmpipe_screen(screen); - return lscreen->use_tgsi ? 1 : 4; - } + case PIPE_CAP_MAX_VERTEX_STREAMS: + return 4; case PIPE_CAP_MAX_VERTEX_ATTRIB_STRIDE: return 2048; case PIPE_CAP_STREAM_OUTPUT_PAUSE_RESUME: @@ -208,10 +205,8 @@ llvmpipe_get_param(struct pipe_screen *screen, enum pipe_cap param) case PIPE_CAP_VERTEX_COLOR_CLAMPED: return 1; case PIPE_CAP_GLSL_FEATURE_LEVEL_COMPATIBILITY: - case PIPE_CAP_GLSL_FEATURE_LEVEL: { - struct llvmpipe_screen *lscreen = llvmpipe_screen(screen); - return lscreen->use_tgsi ? 330 : 450; - } + case PIPE_CAP_GLSL_FEATURE_LEVEL: + return 450; case PIPE_CAP_COMPUTE: return GALLIVM_COROUTINES; case PIPE_CAP_USER_VERTEX_BUFFERS: @@ -255,10 +250,8 @@ llvmpipe_get_param(struct pipe_screen *screen, enum pipe_cap param) case PIPE_CAP_TGSI_TEX_TXF_LZ: case PIPE_CAP_SAMPLER_VIEW_TARGET: return 1; - case PIPE_CAP_FAKE_SW_MSAA: { - struct llvmpipe_screen *lscreen = llvmpipe_screen(screen); - return lscreen->use_tgsi ? 1 : 0; - } + case PIPE_CAP_FAKE_SW_MSAA: + return 0; case PIPE_CAP_TEXTURE_QUERY_LOD: case PIPE_CAP_CONDITIONAL_RENDER_INVERTED: case PIPE_CAP_SHADER_ARRAY_COMPONENTS: @@ -364,14 +357,10 @@ llvmpipe_get_param(struct pipe_screen *screen, enum pipe_cap param) case PIPE_CAP_GL_SPIRV: case PIPE_CAP_POST_DEPTH_COVERAGE: case PIPE_CAP_SHADER_CLOCK: - case PIPE_CAP_PACKED_UNIFORMS: { - struct llvmpipe_screen *lscreen = llvmpipe_screen(screen); - return !lscreen->use_tgsi; - } - case PIPE_CAP_ATOMIC_FLOAT_MINMAX: { - struct llvmpipe_screen *lscreen = llvmpipe_screen(screen); - return !lscreen->use_tgsi && LLVM_VERSION_MAJOR >= 15; - } + case PIPE_CAP_PACKED_UNIFORMS: + return 1; + case PIPE_CAP_ATOMIC_FLOAT_MINMAX: + return LLVM_VERSION_MAJOR >= 15; case PIPE_CAP_NIR_IMAGES_AS_DEREF: return 0; default: @@ -395,31 +384,21 @@ llvmpipe_get_shader_param(struct pipe_screen *screen, FALLTHROUGH; case PIPE_SHADER_MESH: case PIPE_SHADER_TASK: - if (lscreen->use_tgsi) - return 0; - FALLTHROUGH; case PIPE_SHADER_FRAGMENT: - if (param == PIPE_SHADER_CAP_PREFERRED_IR) { - if (lscreen->use_tgsi) - return PIPE_SHADER_IR_TGSI; - else - return PIPE_SHADER_IR_NIR; - } + if (param == PIPE_SHADER_CAP_PREFERRED_IR) + return PIPE_SHADER_IR_NIR; return gallivm_get_shader_param(param); case PIPE_SHADER_TESS_CTRL: case PIPE_SHADER_TESS_EVAL: /* Tessellation shader needs llvm coroutines support */ - if (!GALLIVM_COROUTINES || lscreen->use_tgsi) + if (!GALLIVM_COROUTINES) return 0; FALLTHROUGH; case PIPE_SHADER_VERTEX: case PIPE_SHADER_GEOMETRY: switch (param) { case PIPE_SHADER_CAP_PREFERRED_IR: - if (lscreen->use_tgsi) - return PIPE_SHADER_IR_TGSI; - else - return PIPE_SHADER_IR_NIR; + return PIPE_SHADER_IR_NIR; case PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS: /* At this time, the draw module and llvmpipe driver only * support vertex shader texture lookups when LLVM is enabled in @@ -1128,7 +1107,6 @@ llvmpipe_create_screen(struct sw_winsys *winsys) 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_get_cpu_caps()->nr_cpus > 1 ? util_get_cpu_caps()->nr_cpus : 0; screen->num_threads = debug_get_num_option("LP_NUM_THREADS", diff --git a/src/gallium/drivers/llvmpipe/lp_screen.h b/src/gallium/drivers/llvmpipe/lp_screen.h index 0480dfa..5b4753e 100644 --- a/src/gallium/drivers/llvmpipe/lp_screen.h +++ b/src/gallium/drivers/llvmpipe/lp_screen.h @@ -62,7 +62,6 @@ struct llvmpipe_screen struct lp_cs_tpool *cs_tpool; mtx_t cs_mutex; - bool use_tgsi; bool allow_cl; mtx_t late_mutex; @@ -102,8 +101,7 @@ llvmpipe_screen(struct pipe_screen *pipe) static inline unsigned lp_get_constant_buffer_stride(struct pipe_screen *_screen) { - struct llvmpipe_screen *screen = llvmpipe_screen(_screen); - return screen->use_tgsi ? (sizeof(float) * 4) : sizeof(float); + return sizeof(float); } -- 2.7.4