anv: Enable VK_VALVE_mutable_descriptor_type
authorRohan Garg <rohan.garg@intel.com>
Fri, 14 Jan 2022 14:02:17 +0000 (15:02 +0100)
committerMarge Bot <emma+marge@anholt.net>
Mon, 24 Jan 2022 12:24:53 +0000 (12:24 +0000)
commit63e91148b7fe777b6ad7bfdb6b02d167c151dd55
tree114e5ccc28f6bd83743e29bb69b220718cddf32a
parente1376b59ef48d6f7149b3b67baafd87bbd4c40c3
anv: Enable VK_VALVE_mutable_descriptor_type

This change introduces the anv_descriptor_size_for_mutable_type and
anv_descriptor_data_for_mutable_type helpers to compute the size and
data flags respectively for mutable descriptor types.

In order to make handling these types easier we now store a precomputed
descriptor stride for all types and use in the in appropriate places.

We also need to adjust the compiler to take into account this descriptor
stride. To that extent, we now pack the stride into the upper 16 bits
alongside the index and the dynamic offset index and use it later to
compute the correct offset.

Closes: #4250
Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14633>
src/intel/vulkan/anv_descriptor_set.c
src/intel/vulkan/anv_device.c
src/intel/vulkan/anv_nir_apply_pipeline_layout.c
src/intel/vulkan/anv_private.h