[Mesa-dev] [PATCH] glsl_to_tgsi: try harder to lower unsupported ir_binop_vector_extract

Marek Olšák maraeo at gmail.com
Mon Apr 16 21:02:58 UTC 2018


From: Marek Olšák <marek.olsak at amd.com>

Cc: 18.0 <mesa-stable at lists.freedesktop.org>
---
 src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
index 01a58d7d2c6..b321112cf88 100644
--- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
@@ -7117,20 +7117,25 @@ st_link_shader(struct gl_context *ctx, struct gl_shader_program *prog)
          /* Repeat it until it stops making changes. */
          bool progress;
          do {
             progress = do_common_optimization(ir, true, true, options,
                                               ctx->Const.NativeIntegers);
             progress |= lower_if_to_cond_assign((gl_shader_stage)i, ir,
                                                 options->MaxIfDepth, if_threshold);
          } while (progress);
       }
 
+      /* Do this again to lower ir_binop_vector_extract introduced
+       * by optimization passes.
+       */
+      do_vec_index_to_cond_assign(ir);
+
       validate_ir_tree(ir);
    }
 
    build_program_resource_list(ctx, prog);
 
    if (use_nir)
       return st_link_nir(ctx, prog);
 
    for (unsigned i = 0; i < MESA_SHADER_STAGES; i++) {
       struct gl_linked_shader *shader = prog->_LinkedShaders[i];
-- 
2.17.0



More information about the mesa-dev mailing list