Commit 18a84258 by Alexis Hetu Committed by Alexis Hétu

Placeholder object for VkPipelineCache

While implementing Pipeline Cache is optional, we still need a placeholder object in order to return have a valid handle for this object. b/118386749 Change-Id: I18abb4196fbc99d3f639c1ba14ceb570ac11b365 Reviewed-on: https://swiftshader-review.googlesource.com/c/22729Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com> Tested-by: 's avatarAlexis Hétu <sugoi@google.com>
parent 9c4ecae2
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include "VkImage.hpp" #include "VkImage.hpp"
#include "VkInstance.hpp" #include "VkInstance.hpp"
#include "VkPipeline.hpp" #include "VkPipeline.hpp"
#include "VkPipelineCache.hpp"
#include "VkPipelineLayout.hpp" #include "VkPipelineLayout.hpp"
#include "VkPhysicalDevice.hpp" #include "VkPhysicalDevice.hpp"
#include "VkQueue.hpp" #include "VkQueue.hpp"
......
// Copyright 2018 The SwiftShader Authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef VK_PIPELINE_CACHE_HPP_
#define VK_PIPELINE_CACHE_HPP_
#include "VkObject.hpp"
namespace vk
{
class PipelineCache : public Object<PipelineCache, VkPipelineCache>
{
public:
PipelineCache(const VkPipelineCacheCreateInfo* pCreateInfo, void* mem)
{
}
~PipelineCache() = delete;
static size_t ComputeRequiredAllocationSize(const VkPipelineCacheCreateInfo* pCreateInfo)
{
return 0;
}
private:
};
static inline PipelineCache* Cast(VkPipelineCache object)
{
return reinterpret_cast<PipelineCache*>(object);
}
} // namespace vk
#endif // VK_PIPELINE_CACHE_HPP_
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#include "VkInstance.hpp" #include "VkInstance.hpp"
#include "VkPhysicalDevice.hpp" #include "VkPhysicalDevice.hpp"
#include "VkPipeline.hpp" #include "VkPipeline.hpp"
#include "VkPipelineCache.hpp"
#include "VkPipelineLayout.hpp" #include "VkPipelineLayout.hpp"
#include "VkQueue.hpp" #include "VkQueue.hpp"
#include "VkSampler.hpp" #include "VkSampler.hpp"
...@@ -777,15 +778,23 @@ VKAPI_ATTR void VKAPI_CALL vkDestroyShaderModule(VkDevice device, VkShaderModule ...@@ -777,15 +778,23 @@ VKAPI_ATTR void VKAPI_CALL vkDestroyShaderModule(VkDevice device, VkShaderModule
VKAPI_ATTR VkResult VKAPI_CALL vkCreatePipelineCache(VkDevice device, const VkPipelineCacheCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkPipelineCache* pPipelineCache) VKAPI_ATTR VkResult VKAPI_CALL vkCreatePipelineCache(VkDevice device, const VkPipelineCacheCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkPipelineCache* pPipelineCache)
{ {
TRACE("()"); TRACE("(VkDevice device, const VkPipelineCacheCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkPipelineCache* pPipelineCache)",
UNIMPLEMENTED(); device, pCreateInfo, pAllocator, pPipelineCache);
return VK_SUCCESS;
if(pCreateInfo->pNext || pCreateInfo->flags)
{
UNIMPLEMENTED();
}
return vk::PipelineCache::Create(pAllocator, pCreateInfo, pPipelineCache);
} }
VKAPI_ATTR void VKAPI_CALL vkDestroyPipelineCache(VkDevice device, VkPipelineCache pipelineCache, const VkAllocationCallbacks* pAllocator) VKAPI_ATTR void VKAPI_CALL vkDestroyPipelineCache(VkDevice device, VkPipelineCache pipelineCache, const VkAllocationCallbacks* pAllocator)
{ {
TRACE("()"); TRACE("(VkDevice device, VkPipelineCache pipelineCache, const VkAllocationCallbacks* pAllocator)",
UNIMPLEMENTED(); device, pipelineCache, pAllocator);
vk::destroy(pipelineCache, pAllocator);
} }
VKAPI_ATTR VkResult VKAPI_CALL vkGetPipelineCacheData(VkDevice device, VkPipelineCache pipelineCache, size_t* pDataSize, void* pData) VKAPI_ATTR VkResult VKAPI_CALL vkGetPipelineCacheData(VkDevice device, VkPipelineCache pipelineCache, size_t* pDataSize, void* pData)
......
...@@ -208,6 +208,7 @@ copy "$(OutDir)vk_swiftshader.dll" "$(SolutionDir)out\$(Configuration)_$(Platfor ...@@ -208,6 +208,7 @@ copy "$(OutDir)vk_swiftshader.dll" "$(SolutionDir)out\$(Configuration)_$(Platfor
<ClInclude Include="VkObject.hpp" /> <ClInclude Include="VkObject.hpp" />
<ClInclude Include="VkPhysicalDevice.hpp" /> <ClInclude Include="VkPhysicalDevice.hpp" />
<ClInclude Include="VkPipeline.hpp" /> <ClInclude Include="VkPipeline.hpp" />
<ClInclude Include="VkPipelineCache.hpp" />
<ClInclude Include="VkPipelineLayout.hpp" /> <ClInclude Include="VkPipelineLayout.hpp" />
<ClInclude Include="VkQueue.hpp" /> <ClInclude Include="VkQueue.hpp" />
<ClInclude Include="VkRenderPass.hpp" /> <ClInclude Include="VkRenderPass.hpp" />
......
...@@ -305,6 +305,9 @@ ...@@ -305,6 +305,9 @@
<ClInclude Include="VkPipeline.hpp"> <ClInclude Include="VkPipeline.hpp">
<Filter>Header Files\Vulkan</Filter> <Filter>Header Files\Vulkan</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="VkPipelineCache.hpp">
<Filter>Header Files\Vulkan</Filter>
</ClInclude>
<ClInclude Include="VkPipelineLayout.hpp"> <ClInclude Include="VkPipelineLayout.hpp">
<Filter>Header Files\Vulkan</Filter> <Filter>Header Files\Vulkan</Filter>
</ClInclude> </ClInclude>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment