virgl: honor host caps in shader cash sha evaluation

This is needed because when we switch between GLES and GL on the host,
we have to lower atomics to ssbo, and with that the shaders  can't be
pulled from the cache anymore. Likewise when we move the disk image with
a shader cache to a different host, other features might change that
will need lowering. To avoid using stale shaders in this case, merge the
caps into into the shader cache sha.

Fixes: d6db4d2e08
    virgl: Add simple disk cache

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17798>
This commit is contained in:
Gert Wollny
2022-07-28 22:50:23 +02:00
committed by Marge Bot
parent 5780ea90c4
commit f9703ac34d

View File

@@ -956,6 +956,10 @@ static void virgl_disk_cache_create(struct virgl_screen *screen)
uint32_t shader_debug_flags = virgl_debug & VIRGL_DEBUG_USE_TGSI;
_mesa_sha1_update(&sha1_ctx, &shader_debug_flags, sizeof(shader_debug_flags));
/* When we switch the host the caps might change and then we might have to
* apply different lowering. */
_mesa_sha1_update(&sha1_ctx, &screen->caps, sizeof(screen->caps));
uint8_t sha1[20];
_mesa_sha1_final(&sha1_ctx, sha1);
char timestamp[41];