From 11275ce2ee655ac1333b7e5b00db42c9cbb21e03 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 21 Sep 2022 15:40:48 -0600 Subject: [PATCH] llvmpipe: improve some if/switch code in llvmpipe_get_shader_param() Move the PIPE_SHADER_CAP_PREFERRED_IR case into the switch statement. Signed-off-by: Brian Paul Part-of: --- src/gallium/drivers/llvmpipe/lp_screen.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/gallium/drivers/llvmpipe/lp_screen.c b/src/gallium/drivers/llvmpipe/lp_screen.c index 636c13ecc512..1c446b9ac915 100644 --- a/src/gallium/drivers/llvmpipe/lp_screen.c +++ b/src/gallium/drivers/llvmpipe/lp_screen.c @@ -405,13 +405,12 @@ llvmpipe_get_shader_param(struct pipe_screen *screen, FALLTHROUGH; case PIPE_SHADER_VERTEX: case PIPE_SHADER_GEOMETRY: - if (param == PIPE_SHADER_CAP_PREFERRED_IR) { + switch (param) { + case PIPE_SHADER_CAP_PREFERRED_IR: if (lscreen->use_tgsi) return PIPE_SHADER_IR_TGSI; else return PIPE_SHADER_IR_NIR; - } - switch (param) { 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