mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 09:08:10 +02:00
radv: fix generating the global key for pipeline binaries
The global key wasn't considering GPU family, Git revision etc and it
was mostly invariant.
Fixes: be06bfcbed ("radv: add initial support for pipeline binaries")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/11995
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31576>
This commit is contained in:
parent
47a78614ea
commit
1641db461f
1 changed files with 10 additions and 3 deletions
|
|
@ -75,16 +75,23 @@ radv_GetPipelineKeyKHR(VkDevice _device, const VkPipelineCreateInfoKHR *pPipelin
|
|||
VkPipelineBinaryKeyKHR *pPipelineKey)
|
||||
{
|
||||
VK_FROM_HANDLE(radv_device, device, _device);
|
||||
const struct radv_physical_device *pdev = radv_device_physical(device);
|
||||
VkResult result;
|
||||
|
||||
memset(pPipelineKey->key, 0, sizeof(pPipelineKey->key));
|
||||
|
||||
/* Return the global key that applies to all pipelines. */
|
||||
if (!pPipelineCreateInfo) {
|
||||
static_assert(sizeof(device->cache_hash) <= sizeof(pPipelineKey->key), "mismatch pipeline binary key size");
|
||||
struct mesa_blake3 ctx;
|
||||
|
||||
memcpy(pPipelineKey->key, device->cache_hash, sizeof(device->cache_hash));
|
||||
pPipelineKey->keySize = sizeof(device->cache_hash);
|
||||
static_assert(sizeof(blake3_hash) <= sizeof(pPipelineKey->key), "mismatch pipeline binary key size");
|
||||
|
||||
_mesa_blake3_init(&ctx);
|
||||
_mesa_blake3_update(&ctx, pdev->cache_uuid, sizeof(pdev->cache_uuid));
|
||||
_mesa_blake3_update(&ctx, device->cache_hash, sizeof(device->cache_hash));
|
||||
_mesa_blake3_final(&ctx, pPipelineKey->key);
|
||||
|
||||
pPipelineKey->keySize = sizeof(blake3_hash);
|
||||
|
||||
return VK_SUCCESS;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue