iris: Use 3DSTATE_CONSTANT_ALL when possible.
authorRafael Antognolli <rafael.antognolli@intel.com>
Mon, 23 Sep 2019 20:25:01 +0000 (13:25 -0700)
committerRafael Antognolli <rafael.antognolli@intel.com>
Wed, 4 Dec 2019 20:48:25 +0000 (20:48 +0000)
commit06438ea7fa137db821b3c7d256008c26e23012a7
treefe2271c531b3feaf9aa8315bb82d77cef298936c
parent1ba9a18911ae687217ded424211a2ece6bcd1155
iris: Use 3DSTATE_CONSTANT_ALL when possible.

Use this new instruction introduced in Gen12. The instruction itself is
smaller, and it also allows us to emit a single instruction to all
stages that have the same push constant buffers (e.g. when they don't
have constant buffers).

There's one restriction to use this instruction, though: the length
field is only 5 bits long, so we need to check whether we can use it,
and fallback to the old 3DSTATE_CONSTANT_XS if that field is >= 32.

v2 (Suggestions from Caio):
 - use max_length instead of large_buffers.
 - remove UNUSED and use #if GEN_GEN >= 12 instead.
 - inline "buffers" and drop BITSET_RANGE() usage.
 - add assert(n <= max_pointers)
 - move emit to outside of the loop.

Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
src/gallium/drivers/iris/iris_genx_macros.h
src/gallium/drivers/iris/iris_state.c