Commit 2522f509 authored by Boris Brezillon's avatar Boris Brezillon
Browse files

pan/bi: Support centroid and sample interpolations


Signed-off-by: Boris Brezillon's avatarBoris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig's avatarAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <mesa/mesa!7472>
parent ca5a00a7
......@@ -144,6 +144,20 @@ bi_emit_ld_output(bi_context *ctx, nir_intrinsic_instr *instr)
bi_emit(ctx, ins);
}
static enum bifrost_interp_mode
bi_interp_for_intrinsic(nir_intrinsic_op op)
{
switch (op) {
case nir_intrinsic_load_barycentric_centroid:
return BIFROST_INTERP_CENTROID;
case nir_intrinsic_load_barycentric_sample:
return BIFROST_INTERP_SAMPLE;
case nir_intrinsic_load_barycentric_pixel:
default:
return BIFROST_INTERP_CENTER;
}
}
static void
bi_emit_ld_vary(bi_context *ctx, nir_intrinsic_instr *instr)
{
......@@ -154,6 +168,14 @@ bi_emit_ld_vary(bi_context *ctx, nir_intrinsic_instr *instr)
ins.dest_type = nir_type_float | nir_dest_bit_size(instr->dest);
ins.format = ins.dest_type;
if (instr->intrinsic == nir_intrinsic_load_interpolated_input) {
nir_intrinsic_instr *parent = nir_src_as_intrinsic(instr->src[0]);
if (parent) {
ins.load_vary.interp_mode =
bi_interp_for_intrinsic(parent->intrinsic);
}
}
if (nir_src_is_const(*nir_get_io_offset_src(instr))) {
/* Zero it out for direct */
ins.src[1] = BIR_INDEX_ZERO;
......@@ -681,6 +703,8 @@ emit_intrinsic(bi_context *ctx, nir_intrinsic_instr *instr)
switch (instr->intrinsic) {
case nir_intrinsic_load_barycentric_pixel:
case nir_intrinsic_load_barycentric_centroid:
case nir_intrinsic_load_barycentric_sample:
/* stub */
break;
case nir_intrinsic_load_interpolated_input:
......
Supports Markdown
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