diff options
author | Alyssa Rosenzweig <[email protected]> | 2019-07-31 15:19:09 -0700 |
---|---|---|
committer | Alyssa Rosenzweig <[email protected]> | 2019-08-01 16:23:03 -0700 |
commit | c228046b4b48b7cd13220867195181937a688a61 (patch) | |
tree | 5843117935c55229d91be42d525d557f8fe001f4 /src/gallium/drivers/panfrost/pan_assemble.c | |
parent | 428bed3bded5426d621cbbb1c3161c8984f0779d (diff) |
panfrost: Remove CSO dependency from shader_compile
We want this routine to be generic across graphics and compute, so let
the caller deal with the typing.
Signed-off-by: Alyssa Rosenzweig <[email protected]>
Diffstat (limited to 'src/gallium/drivers/panfrost/pan_assemble.c')
-rw-r--r-- | src/gallium/drivers/panfrost/pan_assemble.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/gallium/drivers/panfrost/pan_assemble.c b/src/gallium/drivers/panfrost/pan_assemble.c index 4d69cd136bd..3f3e866f54a 100644 --- a/src/gallium/drivers/panfrost/pan_assemble.c +++ b/src/gallium/drivers/panfrost/pan_assemble.c @@ -35,20 +35,24 @@ #include "tgsi/tgsi_dump.h" void -panfrost_shader_compile(struct panfrost_context *ctx, struct mali_shader_meta *meta, const char *src, int type, struct panfrost_shader_state *state) +panfrost_shader_compile( + struct panfrost_context *ctx, + struct mali_shader_meta *meta, + enum pipe_shader_ir ir_type, + const void *ir, + const char *src, + int type, + struct panfrost_shader_state *state) { uint8_t *dst; nir_shader *s; - struct pipe_shader_state *cso = state->base; - - if (cso->type == PIPE_SHADER_IR_NIR) { - s = nir_shader_clone(NULL, cso->ir.nir); + if (ir_type == PIPE_SHADER_IR_NIR) { + s = nir_shader_clone(NULL, ir); } else { - assert (cso->type == PIPE_SHADER_IR_TGSI); - //tgsi_dump(cso->tokens, 0); - s = tgsi_to_nir(cso->tokens, ctx->base.screen); + assert (ir_type == PIPE_SHADER_IR_TGSI); + s = tgsi_to_nir(ir, ctx->base.screen); } s->info.stage = type == JOB_TYPE_VERTEX ? MESA_SHADER_VERTEX : MESA_SHADER_FRAGMENT; |