Skip to content
Snippets Groups Projects
Commit 48712b8c authored by Yiwei Zhang's avatar Yiwei Zhang Committed by Marge Bot
Browse files

venus: subtract appended header size in vn_CreatePipelineCache


Use header->header_size to offset cache data as well in case the header
struct extends on a newer driver but the cache data was appended with
an old header.

Fixes: 723f0bf7 ("venus: initial support for module and pipelines")

Signed-off-by: default avatarYiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: default avatarChia-I Wu <olvaffe@gmail.com>
Part-of: <mesa/mesa!14463>
parent 3792fbfc
No related branches found
No related tags found
No related merge requests found
...@@ -140,9 +140,12 @@ vn_CreatePipelineCache(VkDevice device, ...@@ -140,9 +140,12 @@ vn_CreatePipelineCache(VkDevice device,
VkPipelineCacheCreateInfo local_create_info; VkPipelineCacheCreateInfo local_create_info;
if (pCreateInfo->initialDataSize) { if (pCreateInfo->initialDataSize) {
const struct vk_pipeline_cache_header *header =
pCreateInfo->pInitialData;
local_create_info = *pCreateInfo; local_create_info = *pCreateInfo;
local_create_info.pInitialData += local_create_info.initialDataSize -= header->header_size;
sizeof(struct vk_pipeline_cache_header); local_create_info.pInitialData += header->header_size;
pCreateInfo = &local_create_info; pCreateInfo = &local_create_info;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment