diff options
author | Rob Clark <[email protected]> | 2015-10-17 13:34:24 -0400 |
---|---|---|
committer | Rob Clark <[email protected]> | 2016-05-11 12:20:11 -0400 |
commit | 425dc4c4b3663c619634de9f9f00c7765e7d0320 (patch) | |
tree | 3053cbc43904815fe895d625e554bcf48235aac8 /src/gallium/auxiliary/hud/hud_context.c | |
parent | 4500d17245d0c4bd0b52bf444cf1d90bab932794 (diff) |
gallium: refactor pipe_shader_state to support multiple IR's
The goal is to allow the pipe driver to request something other than
TGSI, but detect whether what is getting is TGSI vs what it requested.
The pipe drivers will always have to support TGSI (and convert that into
whatever it is that they prefer), but in some cases we should be able to
skip the TGSI intermediate step (such as glsl->nir vs glsl->tgsi->nir).
I think pipe_compute_state should get similar treatment. Currently,
afaict, it has one user and one consumer, which has allowed it to be
sloppy wrt. supporting alternative IR's.
Signed-off-by: Rob Clark <[email protected]>
Reviewed-by: Roland Scheidegger <[email protected]>
Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/hud/hud_context.c')
-rw-r--r-- | src/gallium/auxiliary/hud/hud_context.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/gallium/auxiliary/hud/hud_context.c b/src/gallium/auxiliary/hud/hud_context.c index 146c7ccd5e3..7870da5464a 100644 --- a/src/gallium/auxiliary/hud/hud_context.c +++ b/src/gallium/auxiliary/hud/hud_context.c @@ -1202,7 +1202,7 @@ hud_create(struct pipe_context *pipe, struct cso_context *cso) }; struct tgsi_token tokens[1000]; - struct pipe_shader_state state = {tokens}; + struct pipe_shader_state state; if (!tgsi_text_translate(fragment_shader_text, tokens, ARRAY_SIZE(tokens))) { assert(0); @@ -1211,7 +1211,7 @@ hud_create(struct pipe_context *pipe, struct cso_context *cso) FREE(hud); return NULL; } - + pipe_shader_state_from_tgsi(&state, tokens); hud->fs_text = pipe->create_fs_state(pipe, &state); } @@ -1249,8 +1249,7 @@ hud_create(struct pipe_context *pipe, struct cso_context *cso) }; struct tgsi_token tokens[1000]; - struct pipe_shader_state state = {tokens}; - + struct pipe_shader_state state; if (!tgsi_text_translate(vertex_shader_text, tokens, ARRAY_SIZE(tokens))) { assert(0); pipe_resource_reference(&hud->font.texture, NULL); @@ -1258,7 +1257,7 @@ hud_create(struct pipe_context *pipe, struct cso_context *cso) FREE(hud); return NULL; } - + pipe_shader_state_from_tgsi(&state, tokens); hud->vs = pipe->create_vs_state(pipe, &state); } |