From 3388f27d8439e75a0f4e64fd12f0433ccb2b3698 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Sun, 2 Oct 2016 17:40:49 +0200 Subject: radeonsi: clean up lucky #include dependencies MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Nicolai Hähnle Reviewed-by: Edward O'Callaghan --- src/gallium/drivers/radeonsi/si_pipe.h | 37 ++++++++++++++++++++++++++++++---- 1 file changed, 33 insertions(+), 4 deletions(-) (limited to 'src/gallium/drivers/radeonsi/si_pipe.h') diff --git a/src/gallium/drivers/radeonsi/si_pipe.h b/src/gallium/drivers/radeonsi/si_pipe.h index 55e4ca7e294..558e1858563 100644 --- a/src/gallium/drivers/radeonsi/si_pipe.h +++ b/src/gallium/drivers/radeonsi/si_pipe.h @@ -26,10 +26,7 @@ #ifndef SI_PIPE_H #define SI_PIPE_H -#include "si_state.h" -#include "util/u_queue.h" - -#include +#include "si_shader.h" #ifdef PIPE_ARCH_BIG_ENDIAN #define SI_BIG_ENDIAN 1 @@ -444,4 +441,36 @@ si_mark_atom_dirty(struct si_context *sctx, si_set_atom_dirty(sctx, atom, true); } +static inline struct tgsi_shader_info *si_get_vs_info(struct si_context *sctx) +{ + if (sctx->gs_shader.cso) + return &sctx->gs_shader.cso->info; + else if (sctx->tes_shader.cso) + return &sctx->tes_shader.cso->info; + else if (sctx->vs_shader.cso) + return &sctx->vs_shader.cso->info; + else + return NULL; +} + +static inline struct si_shader* si_get_vs_state(struct si_context *sctx) +{ + if (sctx->gs_shader.current) + return sctx->gs_shader.current->gs_copy_shader; + else if (sctx->tes_shader.current) + return sctx->tes_shader.current; + else + return sctx->vs_shader.current; +} + +static inline bool si_vs_exports_prim_id(struct si_shader *shader) +{ + if (shader->selector->type == PIPE_SHADER_VERTEX) + return shader->key.vs.epilog.export_prim_id; + else if (shader->selector->type == PIPE_SHADER_TESS_EVAL) + return shader->key.tes.epilog.export_prim_id; + else + return false; +} + #endif -- cgit v1.2.3