Commit f7c2fc7e authored by Alyssa Rosenzweig's avatar Alyssa Rosenzweig 💜 Committed by Marge Bot
Browse files

pan/bi: Add emit tex for builder


Signed-off-by: Alyssa Rosenzweig's avatarAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <mesa/mesa!8135>
parent 26cbf559
...@@ -3581,6 +3581,37 @@ emit_tex(bi_context *ctx, nir_tex_instr *instr) ...@@ -3581,6 +3581,37 @@ emit_tex(bi_context *ctx, nir_tex_instr *instr)
emit_texc(ctx, instr); emit_texc(ctx, instr);
} }
static void
bi_emit_tex(bi_builder *b, nir_tex_instr *instr)
{
switch (instr->op) {
case nir_texop_txs:
bi_load_sysval(b, &instr->instr, 4, 0);
return;
case nir_texop_tex:
case nir_texop_txl:
case nir_texop_txb:
case nir_texop_txf:
case nir_texop_txf_ms:
break;
default:
unreachable("Invalid texture operation");
}
nir_alu_type base = nir_alu_type_get_base_type(instr->dest_type);
unsigned sz = nir_dest_bit_size(instr->dest);
bool is_simple = bi_is_simple_tex(instr);
bool is_2d = instr->sampler_dim == GLSL_SAMPLER_DIM_2D ||
instr->sampler_dim == GLSL_SAMPLER_DIM_EXTERNAL;
bool is_f = base == nir_type_float && (sz == 16 || sz == 32);
if (is_simple && is_2d && is_f && !instr->is_shadow && !instr->is_array)
bi_emit_texs(b, instr);
else
bi_emit_texc(b, instr);
}
static void static void
emit_instr(bi_context *ctx, struct nir_instr *instr) emit_instr(bi_context *ctx, struct nir_instr *instr)
{ {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment