intel/fs: Allow multiple slots for position

Change brw_compute_vue_map() to also take the number of pos slots.  If
more than one slot is used, the VARYING_SLOT_POS is treated as an
array.

When using Primitive Replication, instead of a single position, the
VUE must contain an array of positions.  Padding might be
necessary (after clip distance) to ensure rest of attributes start
aligned.

v2: Add note about array in the commit message and assert that
    pos_slots >= 1 to make clear 0 is invalid. (Jason)
    Move padding to be after the clip distance.

v3: Apply the correct offset when gathering the sources from outputs.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> [v2]
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Rafael Antognolli <rafael.antognolli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2313>
This commit is contained in:
Caio Marcelo de Oliveira Filho
2018-09-21 16:07:38 -07:00
committed by Marge Bot
parent afa5447312
commit 395de69b1f
13 changed files with 46 additions and 17 deletions
+3 -2
View File
@@ -227,7 +227,8 @@ blorp_compile_vs(struct blorp_context *blorp, void *mem_ctx,
brw_compute_vue_map(compiler->devinfo,
&vs_prog_data->base.vue_map,
nir->info.outputs_written,
nir->info.separate_shader);
nir->info.separate_shader,
1);
struct brw_vs_prog_key vs_key = { 0, };
@@ -285,7 +286,7 @@ blorp_ensure_sf_program(struct blorp_batch *batch,
unsigned program_size;
struct brw_vue_map vue_map;
brw_compute_vue_map(blorp->compiler->devinfo, &vue_map, slots_valid, false);
brw_compute_vue_map(blorp->compiler->devinfo, &vue_map, slots_valid, false, 1);
struct brw_sf_prog_data prog_data_tmp;
program = brw_compile_sf(blorp->compiler, mem_ctx, &key.key,