From 0a8072f66e85ea0049466096f9df86022bcb9b65 Mon Sep 17 00:00:00 2001 From: Erik Faye-Lund Date: Thu, 16 Apr 2026 13:06:30 +0200 Subject: [PATCH] llvmpipe: drop support for tgsi_tex_txf_lz cap MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit LLVMpipe is the only driver that actually has supported the instructions that this cap reports about. But TGSI is a dying IR, and this helps very little; the compiler back-end will optimize this away anways. So let's drop it to reduce complexity. Acked-by: Konstantin Seurer Reviewed-by: Marek Olšák Part-of: --- src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c | 14 ++++---------- src/gallium/drivers/llvmpipe/lp_screen.c | 1 - 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c index 97fac427bb7..c93ff83ccb4 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c @@ -2042,8 +2042,7 @@ lp_build_lod_property( * constant coords maybe). * There's at least hope for sample opcodes as well as size queries. */ - if (inst->Instruction.Opcode == TGSI_OPCODE_TEX_LZ || - reg->Register.File == TGSI_FILE_CONSTANT || + if (reg->Register.File == TGSI_FILE_CONSTANT || reg->Register.File == TGSI_FILE_IMMEDIATE) { lod_property = LP_SAMPLER_LOD_SCALAR; } @@ -2166,10 +2165,8 @@ emit_tex( struct lp_build_tgsi_soa_context *bld, /* Note lod and especially projected are illegal in a LOT of cases */ if (modifier == LP_BLD_TEX_MODIFIER_LOD_BIAS || modifier == LP_BLD_TEX_MODIFIER_EXPLICIT_LOD) { - if (inst->Instruction.Opcode == TGSI_OPCODE_TEX_LZ) { - lod = bld->bld_base.base.zero; - } else if (inst->Texture.Texture == TGSI_TEXTURE_SHADOWCUBE || - inst->Texture.Texture == TGSI_TEXTURE_CUBE_ARRAY) { + if (inst->Texture.Texture == TGSI_TEXTURE_SHADOWCUBE || + inst->Texture.Texture == TGSI_TEXTURE_CUBE_ARRAY) { /* note that shadow cube array with bias/explicit lod does not exist */ lod = lp_build_emit_fetch(&bld->bld_base, inst, 1, 0); } @@ -2527,8 +2524,7 @@ emit_fetch_texels( struct lp_build_tgsi_soa_context *bld, /* always have lod except for buffers and msaa targets ? */ if (target != TGSI_TEXTURE_BUFFER && target != TGSI_TEXTURE_2D_MSAA && - target != TGSI_TEXTURE_2D_ARRAY_MSAA && - inst->Instruction.Opcode != TGSI_OPCODE_TXF_LZ) { + target != TGSI_TEXTURE_2D_ARRAY_MSAA) { sample_key |= LP_SAMPLER_LOD_EXPLICIT << LP_SAMPLER_LOD_CONTROL_SHIFT; explicit_lod = lp_build_emit_fetch(&bld->bld_base, inst, 0, 3); lod_property = lp_build_lod_property(&bld->bld_base, inst, 0); @@ -4558,11 +4554,9 @@ lp_build_tgsi_soa(struct gallivm_state *gallivm, bld.bld_base.op_actions[TGSI_OPCODE_TXB].emit = txb_emit; bld.bld_base.op_actions[TGSI_OPCODE_TXD].emit = txd_emit; bld.bld_base.op_actions[TGSI_OPCODE_TXL].emit = txl_emit; - bld.bld_base.op_actions[TGSI_OPCODE_TEX_LZ].emit = txl_emit; bld.bld_base.op_actions[TGSI_OPCODE_TXP].emit = txp_emit; bld.bld_base.op_actions[TGSI_OPCODE_TXQ].emit = txq_emit; bld.bld_base.op_actions[TGSI_OPCODE_TXF].emit = txf_emit; - bld.bld_base.op_actions[TGSI_OPCODE_TXF_LZ].emit = txf_emit; bld.bld_base.op_actions[TGSI_OPCODE_TEX2].emit = tex2_emit; bld.bld_base.op_actions[TGSI_OPCODE_TXB2].emit = txb2_emit; bld.bld_base.op_actions[TGSI_OPCODE_TXL2].emit = txl2_emit; diff --git a/src/gallium/drivers/llvmpipe/lp_screen.c b/src/gallium/drivers/llvmpipe/lp_screen.c index 2b71e1bfffb..309c3d1f0a6 100644 --- a/src/gallium/drivers/llvmpipe/lp_screen.c +++ b/src/gallium/drivers/llvmpipe/lp_screen.c @@ -293,7 +293,6 @@ llvmpipe_init_screen_caps(struct pipe_screen *screen) caps->max_texture_gather_components = 4; caps->vs_window_space_position = true; caps->fs_fine_derivative = true; - caps->tgsi_tex_txf_lz = true; caps->sampler_view_target = true; caps->fake_sw_msaa = false; caps->texture_query_lod = true;