radv: Do not use extra descriptor space for the 3rd plane.
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Wed, 8 May 2019 23:57:28 +0000 (01:57 +0200)
committerBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Sun, 12 May 2019 23:02:44 +0000 (23:02 +0000)
commitf53ebfb4503a1ae054539df1c414b86c3b1966d9
tree0772ab26b76b0db96abf6fe4b2edaae2ac4e2ec3
parentd6dfb2cf5029ae1601eb6792aabd971b1459899f
radv: Do not use extra descriptor space for the 3rd plane.

While ImageFormatProperties returns the number of internal descriptors,
it turns out that applications do not need to actually allocate more
descriptors in the descriptor pool.

So if we make descriptors with more planes larger we have to be
convervative and always allocate space for the larger descriptors
which is a waste given the low usage of this ext.

So let us make use of the fact that 3plane formats all have the
same formats & dimensions for the last two planes. This way we
only need the first half of the descriptor of the 3rd plane and
can share the second half of the second plane.

This allows us to use 16 bytes for the descriptor which nicely
fits into the 16 bytes that are unused right next to the sampler.

Fixes: 5564c38212a "radv: Update descriptor sets for multiple planes."
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
src/amd/vulkan/radv_descriptor_set.c
src/amd/vulkan/radv_descriptor_set.h
src/amd/vulkan/radv_nir_to_llvm.c