Commit f62f375c by Alexis Hetu Committed by Alexis Hétu

Initial implementation of Image

Basic shell class for Image Bug b/119620767 Change-Id: I75d37dd8c1a9b98264fe6dae68cd4753d6942103 Reviewed-on: https://swiftshader-review.googlesource.com/c/22610Tested-by: 's avatarAlexis Hétu <sugoi@google.com> Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com>
parent 259ad3d7
......@@ -19,6 +19,7 @@
#include "VkDeviceMemory.hpp"
#include "VkEvent.hpp"
#include "VkFence.hpp"
#include "VkImage.hpp"
#include "VkInstance.hpp"
#include "VkPipeline.hpp"
#include "VkPipelineLayout.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.
#include "VkImage.hpp"
namespace vk
{
Image::Image(const VkImageCreateInfo* pCreateInfo, void* mem)
{
}
void Image::destroy(const VkAllocationCallbacks* pAllocator)
{
}
size_t Image::ComputeRequiredAllocationSize(const VkImageCreateInfo* pCreateInfo)
{
return 0;
}
} // namespace vk
\ No newline at end of file
// 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_IMAGE_HPP_
#define VK_IMAGE_HPP_
#include "VkObject.hpp"
namespace vk
{
class Image : public Object<Image, VkImage>
{
public:
Image(const VkImageCreateInfo* pCreateInfo, void* mem);
~Image() = delete;
void destroy(const VkAllocationCallbacks* pAllocator);
static size_t ComputeRequiredAllocationSize(const VkImageCreateInfo* pCreateInfo);
private:
};
static inline Image* Cast(VkImage object)
{
return reinterpret_cast<Image*>(object);
}
} // namespace vk
#endif // VK_IMAGE_HPP_
\ No newline at end of file
......@@ -23,6 +23,7 @@
#include "VkEvent.hpp"
#include "VkFence.hpp"
#include "VkGetProcAddress.h"
#include "VkImage.hpp"
#include "VkInstance.hpp"
#include "VkPhysicalDevice.hpp"
#include "VkPipeline.hpp"
......@@ -711,9 +712,12 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateImage(VkDevice device, const VkImageCreat
TRACE("(VkDevice device = 0x%X, const VkImageCreateInfo* pCreateInfo = 0x%X, const VkAllocationCallbacks* pAllocator = 0x%X, VkImage* pImage = 0x%X)",
device, pCreateInfo, pAllocator, pImage);
UNIMPLEMENTED();
if(pCreateInfo->pNext)
{
UNIMPLEMENTED();
}
return VK_SUCCESS;
return vk::Image::Create(pAllocator, pCreateInfo, pImage);
}
VKAPI_ATTR void VKAPI_CALL vkDestroyImage(VkDevice device, VkImage image, const VkAllocationCallbacks* pAllocator)
......@@ -721,7 +725,7 @@ VKAPI_ATTR void VKAPI_CALL vkDestroyImage(VkDevice device, VkImage image, const
TRACE("(VkDevice device = 0x%X, VkImage image = 0x%X, const VkAllocationCallbacks* pAllocator = 0x%X)",
device, image, pAllocator);
UNIMPLEMENTED();
vk::destroy(image, pAllocator);
}
VKAPI_ATTR void VKAPI_CALL vkGetImageSubresourceLayout(VkDevice device, VkImage image, const VkImageSubresource* pSubresource, VkSubresourceLayout* pLayout)
......
......@@ -106,6 +106,7 @@ copy "$(OutDir)vk_swiftshader.dll" "$(SolutionDir)out\$(Configuration)_$(Platfor
<ClCompile Include="VkDevice.cpp" />
<ClCompile Include="VkDeviceMemory.cpp" />
<ClCompile Include="VkGetProcAddress.cpp" />
<ClCompile Include="VkImage.cpp" />
<ClCompile Include="VkInstance.cpp" />
<ClCompile Include="VkMemory.cpp" />
<ClCompile Include="VkPhysicalDevice.cpp" />
......@@ -196,6 +197,7 @@ copy "$(OutDir)vk_swiftshader.dll" "$(SolutionDir)out\$(Configuration)_$(Platfor
<ClInclude Include="VkEvent.hpp" />
<ClInclude Include="VkFence.hpp" />
<ClInclude Include="VkGetProcAddress.h" />
<ClInclude Include="VkImage.hpp" />
<ClInclude Include="VkInstance.hpp" />
<ClInclude Include="VkMemory.h" />
<ClInclude Include="VkObject.hpp" />
......
......@@ -231,6 +231,9 @@
<ClCompile Include="VkPipelineLayout.cpp">
<Filter>Source Files\Vulkan</Filter>
</ClCompile>
<ClCompile Include="VkImage.cpp">
<Filter>Source Files\Vulkan</Filter>
</ClCompile>
<ClCompile Include="VkPromotedExtensions.cpp">
<Filter>Source Files\Vulkan</Filter>
</ClCompile>
......@@ -272,6 +275,9 @@
<ClInclude Include="VkGetProcAddress.h">
<Filter>Header Files\Vulkan</Filter>
</ClInclude>
<ClInclude Include="VkImage.hpp">
<Filter>Header Files\Vulkan</Filter>
</ClInclude>
<ClInclude Include="VkInstance.hpp">
<Filter>Header Files\Vulkan</Filter>
</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