diff options
author | Marek Olšák <marek.olsak@amd.com> | 2020-09-01 12:19:32 -0400 |
---|---|---|
committer | Marge Bot <eric+marge@anholt.net> | 2020-09-02 20:05:05 +0000 |
commit | 95415a54c007a909f0fb9d1b2567beecbd73d403 (patch) | |
tree | b01c6f847b944e5f06dafde30cc930f5d5739c95 /src/mesa | |
parent | 8c43edf9f917a801a18940bb570a295b7eed7f90 (diff) |
st/mesa: fix lowered IO - don't call st_nir_assign_vs_in_locations twice
If IO is lowered, the second call is a no-op, which breaks:
spec@!opengl 1.1@gl-1.1-color-material-unused-normal-array
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6540>
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/state_tracker/st_program.c | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/src/mesa/state_tracker/st_program.c b/src/mesa/state_tracker/st_program.c index f052655efce..f9348fd08e8 100644 --- a/src/mesa/state_tracker/st_program.c +++ b/src/mesa/state_tracker/st_program.c @@ -367,6 +367,9 @@ st_finalize_nir_before_variants(struct nir_shader *nir) NIR_PASS_V(nir, nir_lower_io_arrays_to_elements_no_indirects, true); } + /* st_nir_assign_vs_in_locations requires correct shader info. */ + nir_shader_gather_info(nir, nir_shader_get_entrypoint(nir)); + st_nir_assign_vs_in_locations(nir); } @@ -528,20 +531,6 @@ st_translate_vertex_program(struct st_context *st, stp->state.type = PIPE_SHADER_IR_NIR; stp->Base.nir = st_translate_prog_to_nir(st, &stp->Base, MESA_SHADER_VERTEX); - - /* We must update stp->Base.info after translation and before - * st_prepare_vertex_program is called, because inputs_read - * may become outdated after NIR optimization passes. - * - * For ffvp/ARB_vp inputs_read is populated based - * on declared attributes without taking their usage into - * consideration. When creating shader variants we expect - * that their inputs_read would match the base ones for - * input mapping to work properly. - */ - nir_shader_gather_info(stp->Base.nir, - nir_shader_get_entrypoint(stp->Base.nir)); - st_nir_assign_vs_in_locations(stp->Base.nir); stp->Base.info = stp->Base.nir->info; /* For st_draw_feedback, we need to generate TGSI too if draw doesn't |