diff options
| author | assiduous <assiduous@diligentgraphics.com> | 2020-07-23 22:58:46 +0000 |
|---|---|---|
| committer | assiduous <assiduous@diligentgraphics.com> | 2020-08-02 19:21:33 +0000 |
| commit | 8a7504ff49c357ad86d547a35bdfd3258bea72df (patch) | |
| tree | bb60a5848ac4046b66dfa3197423a60bec185613 /Graphics/GraphicsEngineVulkan | |
| parent | Added Render pass interface stub (diff) | |
| download | DiligentCore-8a7504ff49c357ad86d547a35bdfd3258bea72df.tar.gz DiligentCore-8a7504ff49c357ad86d547a35bdfd3258bea72df.zip | |
Added render pass object implementation stubs in all backends
Diffstat (limited to 'Graphics/GraphicsEngineVulkan')
4 files changed, 115 insertions, 10 deletions
diff --git a/Graphics/GraphicsEngineVulkan/CMakeLists.txt b/Graphics/GraphicsEngineVulkan/CMakeLists.txt index 28cf8b0f..1696283c 100644 --- a/Graphics/GraphicsEngineVulkan/CMakeLists.txt +++ b/Graphics/GraphicsEngineVulkan/CMakeLists.txt @@ -20,6 +20,7 @@ set(INCLUDE include/QueryManagerVk.hpp include/QueryVkImpl.hpp include/RenderDeviceVkImpl.hpp + include/RenderPassVkImpl.hpp include/RenderPassCache.hpp include/SamplerVkImpl.hpp include/ShaderVkImpl.hpp @@ -86,6 +87,7 @@ set(SRC src/QueryManagerVk.cpp src/QueryVkImpl.cpp src/RenderDeviceVkImpl.cpp + src/RenderPassVkImpl.cpp src/RenderPassCache.cpp src/SamplerVkImpl.cpp src/ShaderVkImpl.cpp diff --git a/Graphics/GraphicsEngineVulkan/include/RenderPassVkImpl.hpp b/Graphics/GraphicsEngineVulkan/include/RenderPassVkImpl.hpp new file mode 100644 index 00000000..bc50624f --- /dev/null +++ b/Graphics/GraphicsEngineVulkan/include/RenderPassVkImpl.hpp @@ -0,0 +1,54 @@ +/* + * Copyright 2019-2020 Diligent Graphics LLC + * Copyright 2015-2019 Egor Yusov + * + * 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. + * + * In no event and under no legal theory, whether in tort (including negligence), + * contract, or otherwise, unless required by applicable law (such as deliberate + * and grossly negligent acts) or agreed to in writing, shall any Contributor be + * liable for any damages, including any direct, indirect, special, incidental, + * or consequential damages of any character arising as a result of this License or + * out of the use or inability to use the software (including but not limited to damages + * for loss of goodwill, work stoppage, computer failure or malfunction, or any and + * all other commercial damages or losses), even if such Contributor has been advised + * of the possibility of such damages. + */ + +#pragma once + +/// \file +/// Declaration of Diligent::RenderPassVkImpl class + +#include "RenderDeviceVk.h" +#include "RenderPassBase.hpp" +#include "RenderDeviceVkImpl.hpp" + +namespace Diligent +{ + +class FixedBlockMemoryAllocator; + +/// Render pass implementation in Direct3D11 backend. +class RenderPassVkImpl final : public RenderPassBase<IRenderPass, RenderDeviceVkImpl> +{ +public: + using TRenderPassBase = RenderPassBase<IRenderPass, RenderDeviceVkImpl>; + + RenderPassVkImpl(IReferenceCounters* pRefCounters, + RenderDeviceVkImpl* pDevice, + const RenderPassDesc& Desc); + ~RenderPassVkImpl(); +}; + +} // namespace Diligent diff --git a/Graphics/GraphicsEngineVulkan/src/RenderDeviceVkImpl.cpp b/Graphics/GraphicsEngineVulkan/src/RenderDeviceVkImpl.cpp index 0f59e64c..012cb58f 100644 --- a/Graphics/GraphicsEngineVulkan/src/RenderDeviceVkImpl.cpp +++ b/Graphics/GraphicsEngineVulkan/src/RenderDeviceVkImpl.cpp @@ -37,6 +37,7 @@ #include "DeviceContextVkImpl.hpp" #include "FenceVkImpl.hpp" #include "QueryVkImpl.hpp" +#include "RenderPassVkImpl.hpp" #include "EngineMemory.h" namespace Diligent @@ -71,7 +72,8 @@ RenderDeviceVkImpl::RenderDeviceVkImpl(IReferenceCounters* sizeof(PipelineStateVkImpl), sizeof(ShaderResourceBindingVkImpl), sizeof(FenceVkImpl), - sizeof(QueryVkImpl) + sizeof(QueryVkImpl), + sizeof(RenderPassVkImpl) } }, m_VulkanInstance {Instance }, @@ -620,15 +622,15 @@ void RenderDeviceVkImpl::CreateQuery(const QueryDesc& Desc, IQuery** ppQuery) void RenderDeviceVkImpl::CreateRenderPass(const RenderPassDesc& Desc, IRenderPass** ppRenderPass) { - //CreateDeviceObject( - // "RenderPass", Desc, ppRenderPass, - // [&]() // - // { - // RenderPassVkImpl* pRenderPassVk(NEW_RC_OBJ(m_RenderPassAllocator, "RenderPassVkImpl instance", RenderPassVkImpl)(this, Desc)); - // pRenderPassVk->RenderPassInterface(IID_RenderPass, reinterpret_cast<IObject**>(ppRenderPass)); - // OnCreateDeviceObject(pRenderPassVk); - // } // - //); + CreateDeviceObject( + "RenderPass", Desc, ppRenderPass, + [&]() // + { + RenderPassVkImpl* pRenderPassVk(NEW_RC_OBJ(m_RenderPassAllocator, "RenderPassVkImpl instance", RenderPassVkImpl)(this, Desc)); + pRenderPassVk->QueryInterface(IID_RenderPass, reinterpret_cast<IObject**>(ppRenderPass)); + OnCreateDeviceObject(pRenderPassVk); + } // + ); } } // namespace Diligent diff --git a/Graphics/GraphicsEngineVulkan/src/RenderPassVkImpl.cpp b/Graphics/GraphicsEngineVulkan/src/RenderPassVkImpl.cpp new file mode 100644 index 00000000..7ea5b8b9 --- /dev/null +++ b/Graphics/GraphicsEngineVulkan/src/RenderPassVkImpl.cpp @@ -0,0 +1,47 @@ +/* + * Copyright 2019-2020 Diligent Graphics LLC + * Copyright 2015-2019 Egor Yusov + * + * 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. + * + * In no event and under no legal theory, whether in tort (including negligence), + * contract, or otherwise, unless required by applicable law (such as deliberate + * and grossly negligent acts) or agreed to in writing, shall any Contributor be + * liable for any damages, including any direct, indirect, special, incidental, + * or consequential damages of any character arising as a result of this License or + * out of the use or inability to use the software (including but not limited to damages + * for loss of goodwill, work stoppage, computer failure or malfunction, or any and + * all other commercial damages or losses), even if such Contributor has been advised + * of the possibility of such damages. + */ + +#include "pch.h" + +#include "RenderPassVkImpl.hpp" +#include "EngineMemory.h" + +namespace Diligent +{ + +RenderPassVkImpl::RenderPassVkImpl(IReferenceCounters* pRefCounters, + RenderDeviceVkImpl* pDevice, + const RenderPassDesc& Desc) : + TRenderPassBase{pRefCounters, pDevice, Desc} +{ +} + +RenderPassVkImpl::~RenderPassVkImpl() +{ +} + +} // namespace Diligent |
