mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-28 12:30:09 +01:00
radeonsi: add a new helper si_get_vs
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
This commit is contained in:
parent
878bd981bf
commit
140b3c5019
2 changed files with 19 additions and 17 deletions
|
|
@ -491,26 +491,30 @@ 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)
|
||||
static inline struct si_shader_ctx_state *si_get_vs(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;
|
||||
return &sctx->gs_shader;
|
||||
if (sctx->tes_shader.cso)
|
||||
return &sctx->tes_shader;
|
||||
|
||||
return &sctx->vs_shader;
|
||||
}
|
||||
|
||||
static inline struct tgsi_shader_info *si_get_vs_info(struct si_context *sctx)
|
||||
{
|
||||
struct si_shader_ctx_state *vs = si_get_vs(sctx);
|
||||
|
||||
return vs->cso ? &vs->cso->info : NULL;
|
||||
}
|
||||
|
||||
static inline struct si_shader* si_get_vs_state(struct si_context *sctx)
|
||||
{
|
||||
if (sctx->gs_shader.current)
|
||||
if (sctx->gs_shader.cso)
|
||||
return sctx->gs_shader.cso->gs_copy_shader;
|
||||
else if (sctx->tes_shader.current)
|
||||
return sctx->tes_shader.current;
|
||||
else
|
||||
return sctx->vs_shader.current;
|
||||
|
||||
struct si_shader_ctx_state *vs = si_get_vs(sctx);
|
||||
return vs->current ? vs->current : NULL;
|
||||
}
|
||||
|
||||
static inline unsigned
|
||||
|
|
|
|||
|
|
@ -2154,10 +2154,8 @@ static void *si_create_shader_selector(struct pipe_context *ctx,
|
|||
|
||||
static void si_update_streamout_state(struct si_context *sctx)
|
||||
{
|
||||
struct si_shader_selector *shader_with_so =
|
||||
sctx->gs_shader.cso ? sctx->gs_shader.cso :
|
||||
sctx->tes_shader.cso ? sctx->tes_shader.cso :
|
||||
sctx->vs_shader.cso;
|
||||
struct si_shader_selector *shader_with_so = si_get_vs(sctx)->cso;
|
||||
|
||||
if (!shader_with_so)
|
||||
return;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue