radv: add a dynamic vertex format cache.
authorDave Airlie <airlied@redhat.com>
Mon, 11 Apr 2022 05:37:01 +0000 (15:37 +1000)
committerMarge Bot <emma+marge@anholt.net>
Wed, 13 Jul 2022 01:10:09 +0000 (01:10 +0000)
commit105279e98962c6c31cb61acc6ec3b86e6bc57b33
tree25200d834f4d935927f6e345ae6c60b72de4e57b
parentaf1ecbeb0a42cd25bd4e9a8deecab5476bd3e595
radv: add a dynamic vertex format cache.

With dynamic vertex bindings the vertex format lookups are a lot
more frequent (vs being baked in the pipeline). Add a simple lookup
cache using a dynamic array to keep track of the hw values, and
avoid repeated translation.

This also reduces the memset to just the bitfields since all
the others will be overwritten.

Seen in perf traces gputest gimark with zink on radv.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15846>
src/amd/vulkan/radv_cmd_buffer.c
src/amd/vulkan/radv_private.h