mesa/st: lower samplers before nir_lower_tex
authorRob Clark <robdclark@chromium.org>
Mon, 13 Jan 2020 19:36:19 +0000 (11:36 -0800)
committerDaniel Stone <daniel@fooishbar.org>
Mon, 13 Jan 2020 23:19:49 +0000 (23:19 +0000)
Fixes incorrect lowering of YUV samplers when there are non-yuv
samplers.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3368>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3368>

src/mesa/state_tracker/st_program.c

index ef10399fa18a675bcbcce18f36a027888414c801..d441ac777abdb15cbf1a5a962b15b51e12d6cac5 100644 (file)
@@ -1227,6 +1227,10 @@ st_create_fp_variant(struct st_context *st,
       if (unlikely(key->external.lower_nv12 || key->external.lower_iyuv ||
                    key->external.lower_xy_uxvx || key->external.lower_yx_xuxv ||
                    key->external.lower_ayuv || key->external.lower_xyuv)) {
+
+         st_nir_lower_samplers(pipe->screen, state.ir.nir,
+                               stfp->shader_program, &stfp->Base);
+
          nir_lower_tex_options options = {0};
          options.lower_y_uv_external = key->external.lower_nv12;
          options.lower_y_u_v_external = key->external.lower_iyuv;