mirror of https://gitlab.freedesktop.org/mesa/mesa
agx: Implement ld_vary
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Acked-by: Jason Ekstrand <jason@jlekstrand.net> Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10582>
This commit is contained in:
parent
e54fdc0fac
commit
8648b2be0b
|
@ -71,7 +71,29 @@ agx_emit_load_attr(agx_builder *b, nir_intrinsic_instr *instr)
|
|||
static void
|
||||
agx_emit_load_vary(agx_builder *b, nir_intrinsic_instr *instr)
|
||||
{
|
||||
unreachable("stub");
|
||||
unsigned components = instr->num_components;
|
||||
bool smooth = instr->intrinsic == nir_intrinsic_load_interpolated_input;
|
||||
|
||||
assert(components >= 1 && components <= 4);
|
||||
|
||||
if (smooth) {
|
||||
nir_intrinsic_instr *parent = nir_src_as_intrinsic(instr->src[0]);
|
||||
assert(parent);
|
||||
|
||||
/* TODO: Interpolation modes */
|
||||
assert(parent->intrinsic ==
|
||||
nir_intrinsic_load_barycentric_pixel);
|
||||
} else {
|
||||
/* TODO: flat varyings */
|
||||
}
|
||||
|
||||
nir_src *offset = nir_get_io_offset_src(instr);
|
||||
assert(nir_src_is_const(*offset) && "no indirects");
|
||||
unsigned imm_index = (4 * nir_intrinsic_base(instr)) + nir_src_as_uint(*offset);
|
||||
imm_index += 1;
|
||||
|
||||
agx_ld_vary_to(b, agx_dest_index(&instr->dest),
|
||||
agx_immediate(imm_index), components);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
Loading…
Reference in New Issue