From f7f95310f0ac3a89419c866caf962c17ea1d599d Mon Sep 17 00:00:00 2001 From: Emil Velikov Date: Thu, 15 Mar 2018 12:12:58 +0000 Subject: tgsi: move tgsi_processor_to_shader_stage() to a header MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This way we can utilise it with later patches. Signed-off-by: Emil Velikov Reviewed-by: Brian Paul Reviewed-by: Marek Olšák --- src/gallium/auxiliary/tgsi/tgsi_from_mesa.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/gallium/auxiliary/tgsi') diff --git a/src/gallium/auxiliary/tgsi/tgsi_from_mesa.h b/src/gallium/auxiliary/tgsi/tgsi_from_mesa.h index bfaa48d7fa3..b4d540baabc 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_from_mesa.h +++ b/src/gallium/auxiliary/tgsi/tgsi_from_mesa.h @@ -68,4 +68,19 @@ pipe_shader_type_from_mesa(gl_shader_stage stage) } } +static inline gl_shader_stage +tgsi_processor_to_shader_stage(unsigned processor) +{ + switch (processor) { + case PIPE_SHADER_FRAGMENT: return MESA_SHADER_FRAGMENT; + case PIPE_SHADER_VERTEX: return MESA_SHADER_VERTEX; + case PIPE_SHADER_GEOMETRY: return MESA_SHADER_GEOMETRY; + case PIPE_SHADER_TESS_CTRL: return MESA_SHADER_TESS_CTRL; + case PIPE_SHADER_TESS_EVAL: return MESA_SHADER_TESS_EVAL; + case PIPE_SHADER_COMPUTE: return MESA_SHADER_COMPUTE; + default: + unreachable("invalid TGSI processor"); + } +} + #endif /* TGSI_FROM_MESA_H */ -- cgit v1.2.3