glsl_to_tgsi: lower small branches based on the CAP
authorMarek Olšák <marek.olsak@amd.com>
Fri, 28 Oct 2016 20:37:33 +0000 (22:37 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Tue, 15 Nov 2016 19:23:40 +0000 (20:23 +0100)
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/mesa/state_tracker/st_glsl_to_tgsi.cpp

index 64a68e00aa951679a08b2a61284c1501f46f4a51..7f19839d30e3b25cc9ae9d9f151e2810cb031da7 100644 (file)
@@ -6783,6 +6783,8 @@ st_link_shader(struct gl_context *ctx, struct gl_shader_program *prog)
                                                    PIPE_SHADER_CAP_TGSI_DROUND_SUPPORTED);
       bool have_dfrexp = pscreen->get_shader_param(pscreen, ptarget,
                                                    PIPE_SHADER_CAP_TGSI_DFRACEXP_DLDEXP_SUPPORTED);
+      unsigned if_threshold = pscreen->get_shader_param(pscreen, ptarget,
+                                                        PIPE_SHADER_CAP_LOWER_IF_THRESHOLD);
 
       /* If there are forms of indirect addressing that the driver
        * cannot handle, perform the lowering pass.
@@ -6865,7 +6867,8 @@ st_link_shader(struct gl_context *ctx, struct gl_shader_program *prog)
            || progress;
 
          progress = lower_if_to_cond_assign((gl_shader_stage)i, ir,
-                                            options->MaxIfDepth) || progress;
+                                            options->MaxIfDepth, if_threshold) ||
+                    progress;
 
       } while (progress);