From e35e0307cb6c226ef87d307c1ac910f4169536c1 Mon Sep 17 00:00:00 2001 From: Karol Herbst Date: Mon, 15 Jun 2020 15:14:58 +0200 Subject: [PATCH] st/mesa: lower images when needed The "st/pbo download FS" builtin shader uses image derefs, so even with PIPE_CAP_NIR_IMAGES_AS_DEREF set to 0 drivers ended up with those. Signed-off-by: Karol Herbst Reviewed-by: Gert Wollny Reviewed-by: Eric Anholt Part-of: --- src/mesa/state_tracker/st_nir_builtins.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/mesa/state_tracker/st_nir_builtins.c b/src/mesa/state_tracker/st_nir_builtins.c index 52e68d3f69c..77ec8725ff7 100644 --- a/src/mesa/state_tracker/st_nir_builtins.c +++ b/src/mesa/state_tracker/st_nir_builtins.c @@ -24,6 +24,7 @@ #include "st_nir.h" #include "compiler/nir/nir_builder.h" +#include "compiler/glsl/gl_nir.h" struct pipe_shader_state * st_nir_finish_builtin_shader(struct st_context *st, @@ -58,6 +59,8 @@ st_nir_finish_builtin_shader(struct st_context *st, st_nir_lower_samplers(screen, nir, NULL, NULL); st_nir_lower_uniforms(st, nir); + if (!screen->get_param(screen, PIPE_CAP_NIR_IMAGES_AS_DEREF)) + NIR_PASS_V(nir, gl_nir_lower_images, false); if (screen->finalize_nir) screen->finalize_nir(screen, nir, true); -- 2.30.2