anv: Split command buffer attachment setup in three
authorJason Ekstrand <jason@jlekstrand.net>
Tue, 24 Mar 2020 23:32:01 +0000 (18:32 -0500)
committerMarge Bot <eric+marge@anholt.net>
Tue, 28 Apr 2020 22:45:39 +0000 (22:45 +0000)
commita3d185d091fbacd314d76e702d292a363f3c8b55
treec06e1e9844b0ace0a8543363afc0ba77b610bae7
parentc195d5516128543bf54a5c758119e0e36763d1f0
anv: Split command buffer attachment setup in three

This commit splits genX(cmd_buffer_setup_attachments)() into three
functions: one which sets up cmd_buffer->state.attachments, one which
allocates surface states, and one which fills out the surface states.
While we're here, we make both functions take the framebuffer (if any)
as an argument instead of pulling it from the command buffer so it's
more clear what things are inputs to the functions.  We also make the
render pass and framebuffer parameters const as those are immutable
objects.  The only functional change here should be that we now
vk_zalloc the attachments which should be a bit safer.

Reviewed-by: Rafael Antognolli <rafael.antognolli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4393>
src/intel/vulkan/genX_cmd_buffer.c