diff options
author | Eric Anholt <[email protected]> | 2018-12-26 13:20:25 -0800 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2019-01-02 14:12:29 -0800 |
commit | d2b899c0ec156b90b84c884c0dcd5a1a6feaa677 (patch) | |
tree | 12af087e1342a233930f2e00891d5f97f1a73718 /src/gallium/drivers | |
parent | 080506057310ee3239ae8befe3679b9c2f752607 (diff) |
v3d: Refactor compiler entrypoints.
Before, I had per-stage entryoints with some helpers shared between them.
As I extended for compute shaders and shader-db, it turned out that the
other common code in the middle wanted to be shared too.
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r-- | src/gallium/drivers/v3d/v3d_program.c | 32 |
1 files changed, 6 insertions, 26 deletions
diff --git a/src/gallium/drivers/v3d/v3d_program.c b/src/gallium/drivers/v3d/v3d_program.c index ec9d0339528..e0a77847880 100644 --- a/src/gallium/drivers/v3d/v3d_program.c +++ b/src/gallium/drivers/v3d/v3d_program.c @@ -354,32 +354,12 @@ v3d_get_compiled_shader(struct v3d_context *v3d, struct v3d_key *key) uint64_t *qpu_insts; uint32_t shader_size; - switch (s->info.stage) { - case MESA_SHADER_VERTEX: - shader->prog_data.vs = rzalloc(shader, struct v3d_vs_prog_data); - - qpu_insts = v3d_compile_vs(v3d->screen->compiler, - (struct v3d_vs_key *)key, - shader->prog_data.vs, s, - v3d_shader_debug_output, - v3d, - program_id, variant_id, - &shader_size); - break; - case MESA_SHADER_FRAGMENT: - shader->prog_data.fs = rzalloc(shader, struct v3d_fs_prog_data); - - qpu_insts = v3d_compile_fs(v3d->screen->compiler, - (struct v3d_fs_key *)key, - shader->prog_data.fs, s, - v3d_shader_debug_output, - v3d, - program_id, variant_id, - &shader_size); - break; - default: - unreachable("bad stage"); - } + qpu_insts = v3d_compile(v3d->screen->compiler, key, + &shader->prog_data.base, s, + v3d_shader_debug_output, + v3d, + program_id, variant_id, &shader_size); + ralloc_steal(shader, shader->prog_data.base); v3d_set_shader_uniform_dirty_flags(shader); |