Commit 8f631c82 by Alexis Hetu Committed by Alexis Hétu

Initial implementation of Framebuffer

Basic shell class for Framebuffer Bug b/119621736 Change-Id: Iaf5466d311efe011ea7bbd4a6e3ab2802474f98e Reviewed-on: https://swiftshader-review.googlesource.com/c/22611Tested-by: 's avatarAlexis Hétu <sugoi@google.com> Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com>
parent f62f375c
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include "VkDeviceMemory.hpp" #include "VkDeviceMemory.hpp"
#include "VkEvent.hpp" #include "VkEvent.hpp"
#include "VkFence.hpp" #include "VkFence.hpp"
#include "VkFramebuffer.hpp"
#include "VkImage.hpp" #include "VkImage.hpp"
#include "VkInstance.hpp" #include "VkInstance.hpp"
#include "VkPipeline.hpp" #include "VkPipeline.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 "VkFramebuffer.hpp"
namespace vk
{
Framebuffer::Framebuffer(const VkFramebufferCreateInfo* pCreateInfo, void* mem)
{
}
void Framebuffer::destroy(const VkAllocationCallbacks* pAllocator)
{
}
size_t Framebuffer::ComputeRequiredAllocationSize(const VkFramebufferCreateInfo* 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_FRAMEBUFFER_HPP_
#define VK_FRAMEBUFFER_HPP_
#include "VkObject.hpp"
namespace vk
{
class Framebuffer : public Object<Framebuffer, VkFramebuffer>
{
public:
Framebuffer(const VkFramebufferCreateInfo* pCreateInfo, void* mem);
~Framebuffer() = delete;
void destroy(const VkAllocationCallbacks* pAllocator);
static size_t ComputeRequiredAllocationSize(const VkFramebufferCreateInfo* pCreateInfo);
private:
};
static inline Framebuffer* Cast(VkFramebuffer object)
{
return reinterpret_cast<Framebuffer*>(object);
}
} // namespace vk
#endif // VK_FRAMEBUFFER_HPP_
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include "VkDeviceMemory.hpp" #include "VkDeviceMemory.hpp"
#include "VkEvent.hpp" #include "VkEvent.hpp"
#include "VkFence.hpp" #include "VkFence.hpp"
#include "VkFramebuffer.hpp"
#include "VkGetProcAddress.h" #include "VkGetProcAddress.h"
#include "VkImage.hpp" #include "VkImage.hpp"
#include "VkInstance.hpp" #include "VkInstance.hpp"
...@@ -967,16 +968,19 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateFramebuffer(VkDevice device, const VkFram ...@@ -967,16 +968,19 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateFramebuffer(VkDevice device, const VkFram
TRACE("(VkDevice device = 0x%X, const VkFramebufferCreateInfo* pCreateInfo = 0x%X, const VkAllocationCallbacks* pAllocator = 0x%X, VkFramebuffer* pFramebuffer = 0x%X)", TRACE("(VkDevice device = 0x%X, const VkFramebufferCreateInfo* pCreateInfo = 0x%X, const VkAllocationCallbacks* pAllocator = 0x%X, VkFramebuffer* pFramebuffer = 0x%X)",
device, pCreateInfo, pAllocator, pFramebuffer); device, pCreateInfo, pAllocator, pFramebuffer);
UNIMPLEMENTED(); if(pCreateInfo->pNext || pCreateInfo->flags)
{
UNIMPLEMENTED();
}
return VK_SUCCESS; return vk::Framebuffer::Create(pAllocator, pCreateInfo, pFramebuffer);
} }
VKAPI_ATTR void VKAPI_CALL vkDestroyFramebuffer(VkDevice device, VkFramebuffer framebuffer, const VkAllocationCallbacks* pAllocator) VKAPI_ATTR void VKAPI_CALL vkDestroyFramebuffer(VkDevice device, VkFramebuffer framebuffer, const VkAllocationCallbacks* pAllocator)
{ {
TRACE("(VkDevice device = 0x%X, VkFramebuffer framebuffer = 0x%X, const VkAllocationCallbacks* pAllocator = 0x%X)"); TRACE("(VkDevice device = 0x%X, VkFramebuffer framebuffer = 0x%X, const VkAllocationCallbacks* pAllocator = 0x%X)");
UNIMPLEMENTED(); vk::destroy(framebuffer, pAllocator);
} }
VKAPI_ATTR VkResult VKAPI_CALL vkCreateRenderPass(VkDevice device, const VkRenderPassCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkRenderPass* pRenderPass) VKAPI_ATTR VkResult VKAPI_CALL vkCreateRenderPass(VkDevice device, const VkRenderPassCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkRenderPass* pRenderPass)
......
...@@ -105,6 +105,7 @@ copy "$(OutDir)vk_swiftshader.dll" "$(SolutionDir)out\$(Configuration)_$(Platfor ...@@ -105,6 +105,7 @@ copy "$(OutDir)vk_swiftshader.dll" "$(SolutionDir)out\$(Configuration)_$(Platfor
<ClCompile Include="VkDebug.cpp" /> <ClCompile Include="VkDebug.cpp" />
<ClCompile Include="VkDevice.cpp" /> <ClCompile Include="VkDevice.cpp" />
<ClCompile Include="VkDeviceMemory.cpp" /> <ClCompile Include="VkDeviceMemory.cpp" />
<ClCompile Include="VkFramebuffer.cpp" />
<ClCompile Include="VkGetProcAddress.cpp" /> <ClCompile Include="VkGetProcAddress.cpp" />
<ClCompile Include="VkImage.cpp" /> <ClCompile Include="VkImage.cpp" />
<ClCompile Include="VkInstance.cpp" /> <ClCompile Include="VkInstance.cpp" />
...@@ -196,6 +197,7 @@ copy "$(OutDir)vk_swiftshader.dll" "$(SolutionDir)out\$(Configuration)_$(Platfor ...@@ -196,6 +197,7 @@ copy "$(OutDir)vk_swiftshader.dll" "$(SolutionDir)out\$(Configuration)_$(Platfor
<ClInclude Include="VkDeviceMemory.hpp" /> <ClInclude Include="VkDeviceMemory.hpp" />
<ClInclude Include="VkEvent.hpp" /> <ClInclude Include="VkEvent.hpp" />
<ClInclude Include="VkFence.hpp" /> <ClInclude Include="VkFence.hpp" />
<ClInclude Include="VkFramebuffer.hpp" />
<ClInclude Include="VkGetProcAddress.h" /> <ClInclude Include="VkGetProcAddress.h" />
<ClInclude Include="VkImage.hpp" /> <ClInclude Include="VkImage.hpp" />
<ClInclude Include="VkInstance.hpp" /> <ClInclude Include="VkInstance.hpp" />
......
...@@ -240,6 +240,9 @@ ...@@ -240,6 +240,9 @@
<ClCompile Include="VkQueue.cpp"> <ClCompile Include="VkQueue.cpp">
<Filter>Source Files\Vulkan</Filter> <Filter>Source Files\Vulkan</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="VkFramebuffer.cpp">
<Filter>Source Files\Vulkan</Filter>
</ClCompile>
<ClCompile Include="VkShaderModule.cpp"> <ClCompile Include="VkShaderModule.cpp">
<Filter>Source Files\Vulkan</Filter> <Filter>Source Files\Vulkan</Filter>
</ClCompile> </ClCompile>
...@@ -272,6 +275,9 @@ ...@@ -272,6 +275,9 @@
<ClInclude Include="VkFence.hpp"> <ClInclude Include="VkFence.hpp">
<Filter>Header Files\Vulkan</Filter> <Filter>Header Files\Vulkan</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="VkFramebuffer.hpp">
<Filter>Header Files\Vulkan</Filter>
</ClInclude>
<ClInclude Include="VkGetProcAddress.h"> <ClInclude Include="VkGetProcAddress.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