v3dv/pipeline: when looking for a variant, check first current variant
authorAlejandro Piñeiro <apinheiro@igalia.com>
Fri, 24 Jul 2020 22:11:51 +0000 (00:11 +0200)
committerMarge Bot <eric+marge@anholt.net>
Tue, 13 Oct 2020 21:21:32 +0000 (21:21 +0000)
commita87d2c7806271b610a544e77e76658ed91cf66f9
tree17db5f807e298b1cb107c44854ba2c72c960ecfb
parent62c32d6ca0944f3639dc8a261a354c8d4a44f1af
v3dv/pipeline: when looking for a variant, check first current variant

So far, when checking for a variant fulfilling a specific v3d key, we
were checking the caches, and if that failed, we compiled a new
variant, and update the current variant.

But we could check first if the current variant fullfils that. This
was not really problematic so far, as checking on the caches was fast,
but now that we could be without any kind of shader cache using
V3DV_ENABLE_PIPELINE_CACHE, it is far better to check first current
variant.

Without this vkQuake3 at 720p drops to 1fps when disabling the cache.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6766>
src/broadcom/vulkan/v3dv_pipeline.c
src/broadcom/vulkan/v3dv_pipeline_cache.c
src/broadcom/vulkan/v3dv_private.h