mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 08:40:11 +01:00
nir: Handle per-view io in nir_io_add_const_offset_to_base()
This isn't strictly necessary for freedreno, since we aren't using it yet, but I wanted to avoid any problems if we do. If we wanted to handle this "properly", and handle matrix and array per-view variables, we'd probably want to encode the "view stride" (number of views per user location) and base view in the intrinsic, but for now we just don't do any offsetting and assume the indirect offset is the view. Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6514>
This commit is contained in:
parent
bc8a5c0752
commit
51e2b31039
1 changed files with 3 additions and 1 deletions
|
|
@ -2260,7 +2260,9 @@ add_const_offset_to_base_block(nir_block *block, nir_builder *b,
|
|||
((modes & nir_var_shader_out) && is_output(intrin))) {
|
||||
nir_src *offset = nir_get_io_offset_src(intrin);
|
||||
|
||||
if (nir_src_is_const(*offset)) {
|
||||
/* TODO: Better handling of per-view variables here */
|
||||
if (nir_src_is_const(*offset) &&
|
||||
!nir_intrinsic_io_semantics(intrin).per_view) {
|
||||
unsigned off = nir_src_as_uint(*offset);
|
||||
|
||||
nir_intrinsic_set_base(intrin, nir_intrinsic_base(intrin) + off);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue