From 001a3769a6fdf6c2cd5221d2b06915383e988598 Mon Sep 17 00:00:00 2001 From: Konstantin Seurer Date: Sun, 16 Apr 2023 21:14:44 +0200 Subject: [PATCH] lavapipe: Lower more texture OPs Tries to reduce the number of textures we need to pre-compile. Reviewed-by: Dave Airlie Part-of: --- src/gallium/frontends/lavapipe/lvp_pipeline.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/gallium/frontends/lavapipe/lvp_pipeline.c b/src/gallium/frontends/lavapipe/lvp_pipeline.c index b5646ea3f65..43abccf91d9 100644 --- a/src/gallium/frontends/lavapipe/lvp_pipeline.c +++ b/src/gallium/frontends/lavapipe/lvp_pipeline.c @@ -524,6 +524,14 @@ lvp_shader_lower(struct lvp_device *pdevice, nir_shader *nir, struct lvp_shader }; NIR_PASS_V(nir, nir_fold_16bit_tex_image, &fold_16bit_options); + /* Lower texture OPs llvmpipe supports to reduce the amount of sample + * functions that need to be pre-compiled. + */ + const nir_lower_tex_options tex_options = { + .lower_txd = true, + }; + NIR_PASS(_, nir, nir_lower_tex, &tex_options); + lvp_shader_optimize(nir); if (nir->info.stage != MESA_SHADER_VERTEX)