diff options
author | Timur Kristóf <[email protected]> | 2019-03-04 13:54:10 +0100 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2019-03-05 19:13:27 +0000 |
commit | e582e761b7f49d1c0b100289b62442e6295cefef (patch) | |
tree | 5d3b349d270b1070bb06646770175fb70e490904 /src/gallium/drivers/freedreno/a2xx | |
parent | 6684e039eba9c2e9602b1cc9d5177f69e478ff46 (diff) |
freedreno: Plumb pipe_screen through to irX_tgsi_to_nir.
This patch makes it possible for freedreno to pass a pipe_screen
to tgsi_to_nir. This will be needed when tgsi_to_nir supports reading
pipe capabilities.
Signed-off-by: Timur Kristóf <[email protected]>
Tested-by: Rob Clark <[email protected]>
Reviewed-by: Rob Clark <[email protected]>
Diffstat (limited to 'src/gallium/drivers/freedreno/a2xx')
-rw-r--r-- | src/gallium/drivers/freedreno/a2xx/fd2_program.c | 4 | ||||
-rw-r--r-- | src/gallium/drivers/freedreno/a2xx/ir2.h | 4 | ||||
-rw-r--r-- | src/gallium/drivers/freedreno/a2xx/ir2_nir.c | 5 |
3 files changed, 9 insertions, 4 deletions
diff --git a/src/gallium/drivers/freedreno/a2xx/fd2_program.c b/src/gallium/drivers/freedreno/a2xx/fd2_program.c index 84b54cf56b7..cba87f01afc 100644 --- a/src/gallium/drivers/freedreno/a2xx/fd2_program.c +++ b/src/gallium/drivers/freedreno/a2xx/fd2_program.c @@ -102,7 +102,7 @@ fd2_fp_state_create(struct pipe_context *pctx, (nir_lower_io_options)0); } else { assert(cso->type == PIPE_SHADER_IR_TGSI); - so->nir = ir2_tgsi_to_nir(cso->tokens); + so->nir = ir2_tgsi_to_nir(cso->tokens, pctx->screen); } if (ir2_optimize_nir(so->nir, true)) @@ -142,7 +142,7 @@ fd2_vp_state_create(struct pipe_context *pctx, (nir_lower_io_options)0); } else { assert(cso->type == PIPE_SHADER_IR_TGSI); - so->nir = ir2_tgsi_to_nir(cso->tokens); + so->nir = ir2_tgsi_to_nir(cso->tokens, pctx->screen); } if (ir2_optimize_nir(so->nir, true)) diff --git a/src/gallium/drivers/freedreno/a2xx/ir2.h b/src/gallium/drivers/freedreno/a2xx/ir2.h index f381fdfff16..706dc943a73 100644 --- a/src/gallium/drivers/freedreno/a2xx/ir2.h +++ b/src/gallium/drivers/freedreno/a2xx/ir2.h @@ -28,6 +28,7 @@ #define IR2_H_ #include "compiler/nir/nir.h" +#include "pipe/p_context.h" struct ir2_fetch_info { /* dword offset of the fetch instruction */ @@ -85,7 +86,8 @@ struct tgsi_token; void ir2_compile(struct fd2_shader_stateobj *so, unsigned variant, struct fd2_shader_stateobj *fp); -struct nir_shader *ir2_tgsi_to_nir(const struct tgsi_token *tokens); +struct nir_shader *ir2_tgsi_to_nir(const struct tgsi_token *tokens, + struct pipe_screen *screen); const nir_shader_compiler_options *ir2_get_compiler_options(void); diff --git a/src/gallium/drivers/freedreno/a2xx/ir2_nir.c b/src/gallium/drivers/freedreno/a2xx/ir2_nir.c index 5d92f86befc..ee27b8835a2 100644 --- a/src/gallium/drivers/freedreno/a2xx/ir2_nir.c +++ b/src/gallium/drivers/freedreno/a2xx/ir2_nir.c @@ -43,8 +43,11 @@ static const nir_shader_compiler_options options = { }; struct nir_shader * -ir2_tgsi_to_nir(const struct tgsi_token *tokens) +ir2_tgsi_to_nir(const struct tgsi_token *tokens, + struct pipe_screen *screen) { + /* TODO: pass screen to tgsi_to_nir when it needs that. */ + (void) screen; return tgsi_to_nir(tokens, &options); } |