From 9ed33383a5b1399315cd62f119234ee2332ee76f Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 8 Jan 2020 12:59:16 -0800 Subject: [PATCH] gallium/ureg: Set the next shader stage from the shader info. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Saves a loop over the linked shaders in glsl_to_tgsi which the GLSL linker has already done for us. Reviewed-by: Marek Olšák Part-of: --- src/gallium/auxiliary/tgsi/tgsi_ureg.c | 2 ++ src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 19 ------------------- 2 files changed, 2 insertions(+), 19 deletions(-) diff --git a/src/gallium/auxiliary/tgsi/tgsi_ureg.c b/src/gallium/auxiliary/tgsi/tgsi_ureg.c index d05dd248ce4..4a6b89a9af5 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_ureg.c +++ b/src/gallium/auxiliary/tgsi/tgsi_ureg.c @@ -31,6 +31,7 @@ #include "pipe/p_state.h" #include "tgsi/tgsi_ureg.h" #include "tgsi/tgsi_build.h" +#include "tgsi/tgsi_from_mesa.h" #include "tgsi/tgsi_info.h" #include "tgsi/tgsi_dump.h" #include "tgsi/tgsi_sanity.h" @@ -2373,6 +2374,7 @@ ureg_setup_shader_info(struct ureg_program *ureg, switch (info->stage) { case MESA_SHADER_VERTEX: ureg_setup_clipdist_info(ureg, info); + ureg_set_next_shader_processor(ureg, pipe_shader_type_from_mesa(info->next_stage)); break; case MESA_SHADER_TESS_CTRL: ureg_setup_tess_ctrl_shader(ureg, info); diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp index 3a72377f540..3dc685e71f7 100644 --- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp +++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp @@ -6986,25 +6986,6 @@ st_translate_program( foreach_in_list(glsl_to_tgsi_instruction, inst, &program->instructions) compile_tgsi_instruction(t, inst); - /* Set the next shader stage hint for VS and TES. */ - switch (procType) { - case PIPE_SHADER_VERTEX: - case PIPE_SHADER_TESS_EVAL: - if (program->shader_program->SeparateShader) - break; - - for (i = program->shader->Stage+1; i <= MESA_SHADER_FRAGMENT; i++) { - if (program->shader_program->_LinkedShaders[i]) { - ureg_set_next_shader_processor( - ureg, pipe_shader_type_from_mesa((gl_shader_stage)i)); - break; - } - } - break; - default: - ; /* nothing - silence compiler warning */ - } - out: if (t) { free(t->arrays); -- 2.30.2