diff options
author | Gert Wollny <gert.wollny@collabora.com> | 2022-07-28 22:50:23 +0200 |
---|---|---|
committer | Marge Bot <emma+marge@anholt.net> | 2022-08-01 08:34:12 +0000 |
commit | f9703ac34dc12629e9b6fbdda7adc6c297151729 (patch) | |
tree | e59004a8f0df9f92bde997c836b455756509f871 /src/gallium/drivers/virgl/virgl_screen.c | |
parent | 5780ea90c4d96fa7e23c6ef6b0477842136799d8 (diff) |
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: d6db4d2e08100b12fe6ac539f419768b3b412643
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>
Diffstat (limited to 'src/gallium/drivers/virgl/virgl_screen.c')
-rw-r--r-- | src/gallium/drivers/virgl/virgl_screen.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gallium/drivers/virgl/virgl_screen.c b/src/gallium/drivers/virgl/virgl_screen.c index 4a9443aa296..3c113f83df4 100644 --- a/src/gallium/drivers/virgl/virgl_screen.c +++ b/src/gallium/drivers/virgl/virgl_screen.c @@ -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]; |