Module: Mesa Branch: main Commit: 5e76467d5d555bba3c394e5f953e1d5ac08386e4 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=5e76467d5d555bba3c394e5f953e1d5ac08386e4
Author: Alyssa Rosenzweig <[email protected]> Date: Wed Mar 23 12:04:41 2022 -0400 pan/bi: Use nir_tex_instr_has_implicit_derivative Rather tracking it ourselves. Slightly shorter. Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15586> --- src/panfrost/bifrost/bifrost_compile.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/panfrost/bifrost/bifrost_compile.c b/src/panfrost/bifrost/bifrost_compile.c index 4cf2a5a3807..b08f400191e 100644 --- a/src/panfrost/bifrost/bifrost_compile.c +++ b/src/panfrost/bifrost/bifrost_compile.c @@ -2790,8 +2790,6 @@ enum bifrost_tex_dreg { static void bi_emit_texc(bi_builder *b, nir_tex_instr *instr) { - bool computed_lod = false; - struct bifrost_texture_operation desc = { .op = bi_tex_op(instr->op), .offset_or_bias_disable = false, /* TODO */ @@ -2805,7 +2803,6 @@ bi_emit_texc(bi_builder *b, nir_tex_instr *instr) switch (desc.op) { case BIFROST_TEX_OP_TEX: desc.lod_or_fetch = BIFROST_LOD_MODE_COMPUTE; - computed_lod = true; break; case BIFROST_TEX_OP_FETCH: desc.lod_or_fetch = (enum bifrost_lod_mode) @@ -2885,7 +2882,6 @@ bi_emit_texc(bi_builder *b, nir_tex_instr *instr) dregs[BIFROST_TEX_DREG_LOD] = bi_emit_texc_lod_88(b, index, sz == 16); desc.lod_or_fetch = BIFROST_LOD_MODE_BIAS; - computed_lod = true; break; case nir_tex_src_ms_index: @@ -2979,7 +2975,8 @@ bi_emit_texc(bi_builder *b, nir_tex_instr *instr) uint32_t desc_u = 0; memcpy(&desc_u, &desc, sizeof(desc_u)); bi_texc_to(b, sr_count ? idx : bi_dest_index(&instr->dest), bi_null(), - idx, cx, cy, bi_imm_u32(desc_u), !computed_lod, + idx, cx, cy, bi_imm_u32(desc_u), + !nir_tex_instr_has_implicit_derivative(instr), sr_count, 0); /* Explicit copy to facilitate tied operands */
