pan/bi: Add TEXS emit with builder

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8135>
This commit is contained in:
Alyssa Rosenzweig 2020-12-16 13:01:12 -05:00 committed by Marge Bot
parent 311d3d6015
commit 6f048b5f95

View file

@ -2494,6 +2494,20 @@ bi_emit_alu(bi_builder *b, nir_alu_instr *instr)
/* TEXS instructions assume normal 2D f32 operation but are more
* space-efficient and with simpler RA/scheduling requirements*/
static void
bi_emit_texs(bi_builder *b, nir_tex_instr *instr)
{
int coord_idx = nir_tex_instr_src_index(instr, nir_tex_src_coord);
assert(coord_idx >= 0);
bi_index coords = bi_src_index(&instr->src[coord_idx].src);
bi_texs_2d_to(b, nir_dest_bit_size(instr->dest),
bi_dest_index(&instr->dest),
coords, bi_word(coords, 1),
instr->op != nir_texop_tex, /* zero LOD */
instr->sampler_index, instr->texture_index);
}
static void
emit_texs(bi_context *ctx, nir_tex_instr *instr)
{