anv: Only re-emit non-dynamic state that has changed.
authorRafael Antognolli <rafael.antognolli@intel.com>
Tue, 20 Aug 2019 00:01:10 +0000 (17:01 -0700)
committerRafael Antognolli <rafael.antognolli@intel.com>
Fri, 23 Aug 2019 22:55:18 +0000 (15:55 -0700)
commit2b7ba9f239c09049408d86eb71be18887691dc58
treeb3cb50c39caf8954fd435cc825b5c184e8b8fc1c
parent21a85fd7d8c56aae2f6dd3862900f4d8597eac8e
anv: Only re-emit non-dynamic state that has changed.

On commit f6e7de41d7b, we started emitting 3DSTATE_LINE_STIPPLE as part
of the non-dynamic state. That gets re-emitted every time we bind a new
VkPipeline. But that instruction is non-pipelined, and it caused a perf
regression of about 9-10% on Dota2.

This commit makes anv_dynamic_state_copy() return a mask with only the
state that has changed when copying it. 3DSTATE_LINE_STIPPLE won't be
emitted anymore unless it has changed, fixing the problem above.

v2: Improve commit message and add documentation about skipped checks
(Jason)

Fixes: f6e7de41d7b ("anv: Implement VK_EXT_line_rasterization")
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
src/intel/vulkan/anv_cmd_buffer.c
src/intel/vulkan/anv_private.h