diff options
author | Marek Olšák <[email protected]> | 2019-11-27 22:47:56 -0500 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2019-12-09 21:09:28 -0500 |
commit | a3de63fbb3d63ed792fd7dd969ad940d5bf17338 (patch) | |
tree | 6f05b3c67a2af2b26c6ab1b54fa6e69afa41e446 /src | |
parent | a90f4453fedc414e7f31003b131abc90196effaa (diff) |
st/mesa: don't generate VS TGSI if NIR is enabled
it's no longer needed
Reviewed-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/state_tracker/st_program.c | 36 |
1 files changed, 14 insertions, 22 deletions
diff --git a/src/mesa/state_tracker/st_program.c b/src/mesa/state_tracker/st_program.c index 81d6e16fefa..1beba6317b6 100644 --- a/src/mesa/state_tracker/st_program.c +++ b/src/mesa/state_tracker/st_program.c @@ -450,7 +450,20 @@ st_translate_vertex_program(struct st_context *st, if (stp->Base.Parameters->NumParameters) stp->affected_states |= ST_NEW_VS_CONSTANTS; - /* No samplers are allowed in ARB_vp. */ + /* Translate to NIR if preferred. */ + if (st->pipe->screen->get_shader_param(st->pipe->screen, + PIPE_SHADER_VERTEX, + PIPE_SHADER_CAP_PREFERRED_IR)) { + assert(!stp->glsl_to_tgsi); + + if (stp->Base.nir) + ralloc_free(stp->Base.nir); + + stp->state.type = PIPE_SHADER_IR_NIR; + stp->Base.nir = st_translate_prog_to_nir(st, &stp->Base, + MESA_SHADER_VERTEX); + return true; + } } /* Get semantic names and indices. */ @@ -541,27 +554,6 @@ st_translate_vertex_program(struct st_context *st, st_store_ir_in_disk_cache(st, &stp->Base, false); } - /* Translate to NIR. - * - * This must be done after the translation to TGSI is done, because - * we'll pass the NIR shader to the driver and the TGSI version to - * the draw module for the select/feedback/rasterpos code. - */ - if (st->pipe->screen->get_shader_param(st->pipe->screen, - PIPE_SHADER_VERTEX, - PIPE_SHADER_CAP_PREFERRED_IR)) { - assert(!stp->glsl_to_tgsi); - - nir_shader *nir = - st_translate_prog_to_nir(st, &stp->Base, MESA_SHADER_VERTEX); - - if (stp->Base.nir) - ralloc_free(stp->Base.nir); - stp->state.type = PIPE_SHADER_IR_NIR; - stp->Base.nir = nir; - return true; - } - return stp->state.tokens != NULL; } |