From 10cdc0ad9f897121c54a3239ebcf17d6d5399f49 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Thu, 3 Aug 2023 13:33:54 -0400 Subject: [PATCH] nir: Add load_coefficients_agx intrinsic For lowering interpolation. Signed-off-by: Alyssa Rosenzweig Part-of: --- src/compiler/nir/nir_intrinsics.py | 9 +++++++++ src/compiler/nir/nir_print.c | 1 + 2 files changed, 10 insertions(+) diff --git a/src/compiler/nir/nir_intrinsics.py b/src/compiler/nir/nir_intrinsics.py index 980cb61..47c9662 100644 --- a/src/compiler/nir/nir_intrinsics.py +++ b/src/compiler/nir/nir_intrinsics.py @@ -1655,6 +1655,15 @@ store("tlb_sample_color_v3d", [1], [BASE, COMPONENT, SRC_TYPE], []) # the target framebuffer intrinsic("load_fb_layers_v3d", dest_comp=1, flags=[CAN_ELIMINATE, CAN_REORDER]) +# Load the coefficient register corresponding to a given fragment shader input. +# Coefficient registers are vec3s that are dotted with to interpolate +# the input, where x and y are relative to the 32x32 supertile. +intrinsic("load_coefficients_agx", + bit_sizes = [32], + dest_comp = 3, + indices=[COMPONENT, IO_SEMANTICS, INTERP_MODE], + flags=[CAN_ELIMINATE, CAN_REORDER]) + # Load/store a pixel in local memory. This operation is formatted, with # conversion between the specified format and the implied register format of the # source/destination (for store/loads respectively). This mostly matters for diff --git a/src/compiler/nir/nir_print.c b/src/compiler/nir/nir_print.c index a50da9e..1fb5e49 100644 --- a/src/compiler/nir/nir_print.c +++ b/src/compiler/nir/nir_print.c @@ -1200,6 +1200,7 @@ print_intrinsic_instr(nir_intrinsic_instr *instr, print_state *state) case nir_intrinsic_load_interpolated_input: case nir_intrinsic_load_per_vertex_input: case nir_intrinsic_load_input_vertex: + case nir_intrinsic_load_coefficients_agx: mode = nir_var_shader_in; break; -- 2.7.4