Mesa (master): gallium/ureg: Set the next shader stage from the shader info.
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Wed Sep 2 17:17:23 UTC 2020
Module: Mesa
Branch: master
Commit: 9ed33383a5b1399315cd62f119234ee2332ee76f
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=9ed33383a5b1399315cd62f119234ee2332ee76f
Author: Eric Anholt <eric at anholt.net>
Date: Wed Jan 8 12:59:16 2020 -0800
gallium/ureg: Set the next shader stage from the shader info.
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 <marek.olsak at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6567>
---
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);
More information about the mesa-commit
mailing list