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:

committed by
Marge Bot

parent
afa5447312
commit
395de69b1f
@@ -698,8 +698,18 @@ fs_visitor::emit_urb_writes(const fs_reg &gs_vertex_count)
|
||||
sources[length++] = reg;
|
||||
}
|
||||
} else {
|
||||
for (unsigned i = 0; i < 4; i++)
|
||||
sources[length++] = offset(this->outputs[varying], bld, i);
|
||||
int slot_offset = 0;
|
||||
|
||||
/* When using Primitive Replication, there may be multiple slots
|
||||
* assigned to POS.
|
||||
*/
|
||||
if (varying == VARYING_SLOT_POS)
|
||||
slot_offset = slot - vue_map->varying_to_slot[VARYING_SLOT_POS];
|
||||
|
||||
for (unsigned i = 0; i < 4; i++) {
|
||||
sources[length++] = offset(this->outputs[varying], bld,
|
||||
i + (slot_offset * 4));
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
Reference in New Issue
Block a user