diff options
author | Marek Olšák <[email protected]> | 2016-02-11 16:40:54 +0100 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2016-02-11 16:56:28 +0100 |
commit | 0f235c960c8a564ff8817835716e8f377b2f5f16 (patch) | |
tree | d6ceae865c6fa5b5ba8c40b3c757a19e05ad6f64 /src/mesa/state_tracker/st_program.c | |
parent | 100796c15c3a1467d03abc424e6f1494da02f376 (diff) |
st/mesa: use correct pipe functions to create tess shaders
Broken by one of my cleanups. Spotted by luck.
Radeonsi doesn't care, because all shader create callbacks go to the same
function.
Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/mesa/state_tracker/st_program.c')
-rw-r--r-- | src/mesa/state_tracker/st_program.c | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/src/mesa/state_tracker/st_program.c b/src/mesa/state_tracker/st_program.c index 624586e6d67..5bd626f8610 100644 --- a/src/mesa/state_tracker/st_program.c +++ b/src/mesa/state_tracker/st_program.c @@ -1271,6 +1271,7 @@ st_translate_geometry_program(struct st_context *st, */ struct st_basic_variant * st_get_basic_variant(struct st_context *st, + unsigned pipe_shader, struct pipe_shader_state *tgsi, struct st_basic_variant **variants) { @@ -1293,7 +1294,22 @@ st_get_basic_variant(struct st_context *st, v = CALLOC_STRUCT(st_basic_variant); if (v) { /* fill in new variant */ - v->driver_shader = pipe->create_gs_state(pipe, tgsi); + switch (pipe_shader) { + case PIPE_SHADER_TESS_CTRL: + v->driver_shader = pipe->create_tcs_state(pipe, tgsi); + break; + case PIPE_SHADER_TESS_EVAL: + v->driver_shader = pipe->create_tes_state(pipe, tgsi); + break; + case PIPE_SHADER_GEOMETRY: + v->driver_shader = pipe->create_gs_state(pipe, tgsi); + break; + default: + assert(!"unhandled shader type"); + free(v); + return NULL; + } + v->key = key; /* insert into list */ @@ -1587,19 +1603,19 @@ st_precompile_shader_variant(struct st_context *st, case GL_TESS_CONTROL_PROGRAM_NV: { struct st_tessctrl_program *p = (struct st_tessctrl_program *)prog; - st_get_basic_variant(st, &p->tgsi, &p->variants); + st_get_basic_variant(st, PIPE_SHADER_TESS_CTRL, &p->tgsi, &p->variants); break; } case GL_TESS_EVALUATION_PROGRAM_NV: { struct st_tesseval_program *p = (struct st_tesseval_program *)prog; - st_get_basic_variant(st, &p->tgsi, &p->variants); + st_get_basic_variant(st, PIPE_SHADER_TESS_EVAL, &p->tgsi, &p->variants); break; } case GL_GEOMETRY_PROGRAM_NV: { struct st_geometry_program *p = (struct st_geometry_program *)prog; - st_get_basic_variant(st, &p->tgsi, &p->variants); + st_get_basic_variant(st, PIPE_SHADER_GEOMETRY, &p->tgsi, &p->variants); break; } |