radv: Always make sure to write the pipeline binary key.

There's nothing in spec that says that key is only written
if data is also written.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Fixes: be06bfcbed ("radv: add initial support for pipeline binaries")
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31162>
This commit is contained in:
Hans-Kristian Arntzen 2024-09-13 13:31:04 +02:00 committed by Marge Bot
parent 9aa9f7211e
commit f3c6bbdd8d

View file

@ -418,6 +418,9 @@ radv_GetPipelineBinaryDataKHR(VkDevice _device, const VkPipelineBinaryDataInfoKH
VK_FROM_HANDLE(radv_pipeline_binary, pipeline_binary, pInfo->pipelineBinary);
const size_t size = pipeline_binary->size;
memcpy(pPipelineBinaryKey->key, pipeline_binary->key, sizeof(pipeline_binary->key));
pPipelineBinaryKey->keySize = sizeof(pipeline_binary->key);
if (!pPipelineBinaryData) {
*pPipelineBinaryDataSize = size;
return VK_SUCCESS;
@ -431,9 +434,6 @@ radv_GetPipelineBinaryDataKHR(VkDevice _device, const VkPipelineBinaryDataInfoKH
memcpy(pPipelineBinaryData, pipeline_binary->data, size);
*pPipelineBinaryDataSize = size;
memcpy(pPipelineBinaryKey->key, pipeline_binary->key, sizeof(pipeline_binary->key));
pPipelineBinaryKey->keySize = sizeof(pipeline_binary->key);
return VK_SUCCESS;
}