Commit 9c4ecae2 by Alexis Hetu Committed by Alexis Hétu

Initial implementation of CommandPool

Basic shell class for CommandPool Bug b/119827933 Change-Id: Ibbc8ac641b168a15974fd4ff1803b5aff51f48a3 Reviewed-on: https://swiftshader-review.googlesource.com/c/22730Tested-by: 's avatarAlexis Hétu <sugoi@google.com> Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com>
parent 5174c572
// 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.
#include "VkCommandPool.hpp"
namespace vk
{
CommandPool::CommandPool(const VkCommandPoolCreateInfo* pCreateInfo, void* mem)
{
}
void CommandPool::destroy(const VkAllocationCallbacks* pAllocator)
{
}
size_t CommandPool::ComputeRequiredAllocationSize(const VkCommandPoolCreateInfo* pCreateInfo)
{
return 0;
}
} // namespace vk
// 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_COMMAND_POOL_HPP_
#define VK_COMMAND_POOL_HPP_
#include "VkObject.hpp"
namespace vk
{
class CommandPool : public Object<CommandPool, VkCommandPool>
{
public:
CommandPool(const VkCommandPoolCreateInfo* pCreateInfo, void* mem);
~CommandPool() = delete;
void destroy(const VkAllocationCallbacks* pAllocator);
static size_t ComputeRequiredAllocationSize(const VkCommandPoolCreateInfo* pCreateInfo);
private:
};
static inline CommandPool* Cast(VkCommandPool object)
{
return reinterpret_cast<CommandPool*>(object);
}
} // namespace vk
#endif // VK_COMMAND_POOL_HPP_
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#include "VkBuffer.hpp" #include "VkBuffer.hpp"
#include "VkBufferView.hpp" #include "VkBufferView.hpp"
#include "VkCommandBuffer.hpp" #include "VkCommandBuffer.hpp"
#include "VkCommandPool.hpp"
#include "VkDevice.hpp" #include "VkDevice.hpp"
#include "VkDeviceMemory.hpp" #include "VkDeviceMemory.hpp"
#include "VkEvent.hpp" #include "VkEvent.hpp"
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#include "VkBuffer.hpp" #include "VkBuffer.hpp"
#include "VkBufferView.hpp" #include "VkBufferView.hpp"
#include "VkCommandBuffer.hpp" #include "VkCommandBuffer.hpp"
#include "VkCommandPool.hpp"
#include "VkConfig.h" #include "VkConfig.h"
#include "VkDebug.hpp" #include "VkDebug.hpp"
#include "VkDestroy.h" #include "VkDestroy.h"
...@@ -1020,9 +1021,12 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateCommandPool(VkDevice device, const VkComm ...@@ -1020,9 +1021,12 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateCommandPool(VkDevice device, const VkComm
TRACE("(VkDevice device = 0x%X, const VkCommandPoolCreateInfo* pCreateInfo = 0x%X, const VkAllocationCallbacks* pAllocator = 0x%X, VkCommandPool* pCommandPool = 0x%X)", TRACE("(VkDevice device = 0x%X, const VkCommandPoolCreateInfo* pCreateInfo = 0x%X, const VkAllocationCallbacks* pAllocator = 0x%X, VkCommandPool* pCommandPool = 0x%X)",
device, pCreateInfo, pAllocator, pCommandPool); device, pCreateInfo, pAllocator, pCommandPool);
UNIMPLEMENTED(); if(pCreateInfo->pNext)
{
UNIMPLEMENTED();
}
return VK_SUCCESS; return vk::CommandPool::Create(pAllocator, pCreateInfo, pCommandPool);
} }
VKAPI_ATTR void VKAPI_CALL vkDestroyCommandPool(VkDevice device, VkCommandPool commandPool, const VkAllocationCallbacks* pAllocator) VKAPI_ATTR void VKAPI_CALL vkDestroyCommandPool(VkDevice device, VkCommandPool commandPool, const VkAllocationCallbacks* pAllocator)
...@@ -1030,7 +1034,7 @@ VKAPI_ATTR void VKAPI_CALL vkDestroyCommandPool(VkDevice device, VkCommandPool c ...@@ -1030,7 +1034,7 @@ VKAPI_ATTR void VKAPI_CALL vkDestroyCommandPool(VkDevice device, VkCommandPool c
TRACE("(VkDevice device = 0x%X, VkCommandPool commandPool = 0x%X, const VkAllocationCallbacks* pAllocator = 0x%X)", TRACE("(VkDevice device = 0x%X, VkCommandPool commandPool = 0x%X, const VkAllocationCallbacks* pAllocator = 0x%X)",
device, commandPool, pAllocator); device, commandPool, pAllocator);
UNIMPLEMENTED(); vk::destroy(commandPool, pAllocator);
} }
VKAPI_ATTR VkResult VKAPI_CALL vkResetCommandPool(VkDevice device, VkCommandPool commandPool, VkCommandPoolResetFlags flags) VKAPI_ATTR VkResult VKAPI_CALL vkResetCommandPool(VkDevice device, VkCommandPool commandPool, VkCommandPoolResetFlags flags)
......
...@@ -102,6 +102,7 @@ copy "$(OutDir)vk_swiftshader.dll" "$(SolutionDir)out\$(Configuration)_$(Platfor ...@@ -102,6 +102,7 @@ copy "$(OutDir)vk_swiftshader.dll" "$(SolutionDir)out\$(Configuration)_$(Platfor
<ClCompile Include="main.cpp" /> <ClCompile Include="main.cpp" />
<ClCompile Include="VkBuffer.cpp" /> <ClCompile Include="VkBuffer.cpp" />
<ClCompile Include="VkCommandBuffer.cpp" /> <ClCompile Include="VkCommandBuffer.cpp" />
<ClCompile Include="VkCommandPool.cpp" />
<ClCompile Include="VkDebug.cpp" /> <ClCompile Include="VkDebug.cpp" />
<ClCompile Include="VkDevice.cpp" /> <ClCompile Include="VkDevice.cpp" />
<ClCompile Include="VkDeviceMemory.cpp" /> <ClCompile Include="VkDeviceMemory.cpp" />
...@@ -191,6 +192,7 @@ copy "$(OutDir)vk_swiftshader.dll" "$(SolutionDir)out\$(Configuration)_$(Platfor ...@@ -191,6 +192,7 @@ copy "$(OutDir)vk_swiftshader.dll" "$(SolutionDir)out\$(Configuration)_$(Platfor
<ClInclude Include="VkBuffer.hpp" /> <ClInclude Include="VkBuffer.hpp" />
<ClInclude Include="VkBufferView.hpp" /> <ClInclude Include="VkBufferView.hpp" />
<ClInclude Include="VkCommandBuffer.hpp" /> <ClInclude Include="VkCommandBuffer.hpp" />
<ClInclude Include="VkCommandPool.hpp" />
<ClInclude Include="VkConfig.h" /> <ClInclude Include="VkConfig.h" />
<ClInclude Include="VkDebug.hpp" /> <ClInclude Include="VkDebug.hpp" />
<ClInclude Include="VkDestroy.h" /> <ClInclude Include="VkDestroy.h" />
......
...@@ -204,6 +204,9 @@ ...@@ -204,6 +204,9 @@
<ClCompile Include="VkCommandBuffer.cpp"> <ClCompile Include="VkCommandBuffer.cpp">
<Filter>Source Files\Vulkan</Filter> <Filter>Source Files\Vulkan</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="VkCommandPool.cpp">
<Filter>Source Files\Vulkan</Filter>
</ClCompile>
<ClCompile Include="VkDebug.cpp"> <ClCompile Include="VkDebug.cpp">
<Filter>Source Files\Vulkan</Filter> <Filter>Source Files\Vulkan</Filter>
</ClCompile> </ClCompile>
...@@ -263,6 +266,9 @@ ...@@ -263,6 +266,9 @@
<ClInclude Include="VkCommandBuffer.hpp"> <ClInclude Include="VkCommandBuffer.hpp">
<Filter>Header Files\Vulkan</Filter> <Filter>Header Files\Vulkan</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="VkCommandPool.hpp">
<Filter>Header Files\Vulkan</Filter>
</ClInclude>
<ClInclude Include="VkConfig.h"> <ClInclude Include="VkConfig.h">
<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