Path: blob/21.2-virgl/src/panfrost/vulkan/panvk_pipeline_cache.c
4560 views
/*1* Copyright © 2021 Collabora Ltd.2*3* Derived from tu_pipeline_cache.c which is:4* Copyright © 2015 Intel Corporation5*6* Permission is hereby granted, free of charge, to any person obtaining a7* copy of this software and associated documentation files (the "Software"),8* to deal in the Software without restriction, including without limitation9* the rights to use, copy, modify, merge, publish, distribute, sublicense,10* and/or sell copies of the Software, and to permit persons to whom the11* Software is furnished to do so, subject to the following conditions:12*13* The above copyright notice and this permission notice (including the next14* paragraph) shall be included in all copies or substantial portions of the15* Software.16*17* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR18* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,19* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL20* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER21* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING22* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER23* DEALINGS IN THE SOFTWARE.24*/2526#include "panvk_private.h"2728#include "util/debug.h"29#include "util/disk_cache.h"30#include "util/mesa-sha1.h"31#include "util/u_atomic.h"3233VkResult34panvk_CreatePipelineCache(VkDevice _device,35const VkPipelineCacheCreateInfo *pCreateInfo,36const VkAllocationCallbacks *pAllocator,37VkPipelineCache *pPipelineCache)38{39VK_FROM_HANDLE(panvk_device, device, _device);40struct panvk_pipeline_cache *cache;4142cache = vk_object_alloc(&device->vk, pAllocator, sizeof(*cache),43VK_OBJECT_TYPE_PIPELINE_CACHE);44if (cache == NULL)45return vk_error(device->instance, VK_ERROR_OUT_OF_HOST_MEMORY);4647if (pAllocator)48cache->alloc = *pAllocator;49else50cache->alloc = device->vk.alloc;5152*pPipelineCache = panvk_pipeline_cache_to_handle(cache);53return VK_SUCCESS;54}5556void57panvk_DestroyPipelineCache(VkDevice _device,58VkPipelineCache _cache,59const VkAllocationCallbacks *pAllocator)60{61VK_FROM_HANDLE(panvk_device, device, _device);62VK_FROM_HANDLE(panvk_pipeline_cache, cache, _cache);6364vk_object_free(&device->vk, pAllocator, cache);65}6667VkResult68panvk_GetPipelineCacheData(VkDevice _device,69VkPipelineCache _cache,70size_t *pDataSize,71void *pData)72{73panvk_stub();74return VK_SUCCESS;75}7677VkResult78panvk_MergePipelineCaches(VkDevice _device,79VkPipelineCache destCache,80uint32_t srcCacheCount,81const VkPipelineCache *pSrcCaches)82{83panvk_stub();84return VK_SUCCESS;85}868788