diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h index 5e630d19a2e..99ad032caff 100644 --- a/src/compiler/nir/nir.h +++ b/src/compiler/nir/nir.h @@ -3321,6 +3321,16 @@ typedef struct nir_shader_compiler_options { */ bool use_interpolated_input_intrinsics; + + /** + * Whether nir_lower_io() will lower interpolateAt functions to + * load_interpolated_input intrinsics. + * + * Unlike use_interpolated_input_intrinsics this will only lower these + * functions and leave input load intrinsics untouched. + */ + bool lower_interpolate_at; + /* Lowers when 32x32->64 bit multiplication is not supported */ bool lower_mul_2x32_64; diff --git a/src/compiler/nir/nir_lower_io.c b/src/compiler/nir/nir_lower_io.c index a4247fa9ead..9d9e3200f89 100644 --- a/src/compiler/nir/nir_lower_io.c +++ b/src/compiler/nir/nir_lower_io.c @@ -610,7 +610,8 @@ nir_lower_io_block(nir_block *block, case nir_intrinsic_interp_deref_at_offset: case nir_intrinsic_interp_deref_at_vertex: /* We can optionally lower these to load_interpolated_input */ - if (options->use_interpolated_input_intrinsics) + if (options->use_interpolated_input_intrinsics || + options->lower_interpolate_at) break; default: /* We can't lower the io for this nir instrinsic, so skip it */