mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-02-08 05:40:27 +01:00
brw: Use nir_imul_imm in per-vertex/per-primitive offset calculation
This avoids generating some useless math that would need to be cleaned up later, without complicating things too much. Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39250>
This commit is contained in:
parent
24c66d3871
commit
41d7debcfe
1 changed files with 5 additions and 5 deletions
|
|
@ -150,12 +150,12 @@ urb_offset(nir_builder *b,
|
||||||
|
|
||||||
offset = nir_iadd(b, offset, nir_imul_imm(b, index->ssa, stride));
|
offset = nir_iadd(b, offset, nir_imul_imm(b, index->ssa, stride));
|
||||||
} else if (index) {
|
} else if (index) {
|
||||||
nir_def *stride = cb_data->dynamic_tes
|
const unsigned unit = cb_data->vec4_access ? 16 : 4;
|
||||||
? intel_nir_tess_field(b, PER_VERTEX_SLOTS)
|
nir_def *index_offset = cb_data->dynamic_tes
|
||||||
: nir_imm_int(b, cb_data->per_vertex_stride /
|
? nir_imul(b, index->ssa, intel_nir_tess_field(b, PER_VERTEX_SLOTS))
|
||||||
(cb_data->vec4_access ? 16 : 4));
|
: nir_imul_imm(b, index->ssa, cb_data->per_vertex_stride / unit);
|
||||||
|
|
||||||
offset = nir_iadd(b, offset, nir_imul(b, index->ssa, stride));
|
offset = nir_iadd(b, offset, index_offset);
|
||||||
|
|
||||||
/* In the Tessellation evaluation shader, reposition the offset of
|
/* In the Tessellation evaluation shader, reposition the offset of
|
||||||
* builtins when using separate layout.
|
* builtins when using separate layout.
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue