anv/state: Factor out surface state calculation from genX_image_view_init.
authorFrancisco Jerez <currojerez@riseup.net>
Fri, 22 Jan 2016 03:21:34 +0000 (19:21 -0800)
committerJason Ekstrand <jason.ekstrand@intel.com>
Fri, 22 Jan 2016 19:12:09 +0000 (11:12 -0800)
commitd533c3796d0cfcd05ad13ecae9b0740be6fa8833
treed364763e3d44cc148d9da9aacb95c87804b37451
parent16780632c2d970d7a7029f067401aeaed2cd9121
anv/state: Factor out surface state calculation from genX_image_view_init.

Some fields of the surface state template were dependent on the
surface type, which is dependent on the usage of the image view, which
wasn't known until the bottom of the function after the template had
been constructed.  This caused failures in all image load/store CTS
tests using cubemaps.  Refactor the surface state calculation into a
function that is called once for each required usage.
src/vulkan/gen7_state.c
src/vulkan/gen8_state.c