From 8a7504ff49c357ad86d547a35bdfd3258bea72df Mon Sep 17 00:00:00 2001 From: assiduous Date: Thu, 23 Jul 2020 15:58:46 -0700 Subject: Added render pass object implementation stubs in all backends --- Graphics/GraphicsEngineD3D11/CMakeLists.txt | 2 + .../include/RenderPassD3D11Impl.hpp | 54 ++++++++++++++++++++++ .../src/RenderDeviceD3D11Impl.cpp | 18 ++++---- .../src/RenderPassD3D11Impl.cpp | 47 +++++++++++++++++++ 4 files changed, 113 insertions(+), 8 deletions(-) create mode 100644 Graphics/GraphicsEngineD3D11/include/RenderPassD3D11Impl.hpp create mode 100644 Graphics/GraphicsEngineD3D11/src/RenderPassD3D11Impl.cpp (limited to 'Graphics/GraphicsEngineD3D11') diff --git a/Graphics/GraphicsEngineD3D11/CMakeLists.txt b/Graphics/GraphicsEngineD3D11/CMakeLists.txt index 9ec7e370..30a48152 100644 --- a/Graphics/GraphicsEngineD3D11/CMakeLists.txt +++ b/Graphics/GraphicsEngineD3D11/CMakeLists.txt @@ -17,6 +17,7 @@ set(INCLUDE include/PipelineStateD3D11Impl.hpp include/QueryD3D11Impl.hpp include/RenderDeviceD3D11Impl.hpp + include/RenderPassD3D11Impl.hpp include/SamplerD3D11Impl.hpp include/ShaderD3D11Impl.hpp include/ShaderResourceBindingD3D11Impl.hpp @@ -62,6 +63,7 @@ set(SRC src/PipelineStateD3D11Impl.cpp src/QueryD3D11Impl.cpp src/RenderDeviceD3D11Impl.cpp + src/RenderPassD3D11Impl.cpp src/SamplerD3D11Impl.cpp src/ShaderD3D11Impl.cpp src/ShaderResourceBindingD3D11Impl.cpp diff --git a/Graphics/GraphicsEngineD3D11/include/RenderPassD3D11Impl.hpp b/Graphics/GraphicsEngineD3D11/include/RenderPassD3D11Impl.hpp new file mode 100644 index 00000000..d90d67ac --- /dev/null +++ b/Graphics/GraphicsEngineD3D11/include/RenderPassD3D11Impl.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::RenderPassD3D11Impl class + +#include "RenderDeviceD3D11.h" +#include "RenderPassBase.hpp" +#include "RenderDeviceD3D11Impl.hpp" + +namespace Diligent +{ + +class FixedBlockMemoryAllocator; + +/// Render pass implementation in Direct3D11 backend. +class RenderPassD3D11Impl final : public RenderPassBase +{ +public: + using TRenderPassBase = RenderPassBase; + + RenderPassD3D11Impl(IReferenceCounters* pRefCounters, + RenderDeviceD3D11Impl* pDevice, + const RenderPassDesc& Desc); + ~RenderPassD3D11Impl(); +}; + +} // namespace Diligent diff --git a/Graphics/GraphicsEngineD3D11/src/RenderDeviceD3D11Impl.cpp b/Graphics/GraphicsEngineD3D11/src/RenderDeviceD3D11Impl.cpp index ce0dc402..729eb687 100644 --- a/Graphics/GraphicsEngineD3D11/src/RenderDeviceD3D11Impl.cpp +++ b/Graphics/GraphicsEngineD3D11/src/RenderDeviceD3D11Impl.cpp @@ -40,6 +40,7 @@ #include "ShaderResourceBindingD3D11Impl.hpp" #include "FenceD3D11Impl.hpp" #include "QueryD3D11Impl.hpp" +#include "RenderPassD3D11Impl.hpp" #include "EngineMemory.h" namespace Diligent @@ -97,7 +98,8 @@ RenderDeviceD3D11Impl::RenderDeviceD3D11Impl(IReferenceCounters* pRefCo sizeof(PipelineStateD3D11Impl), sizeof(ShaderResourceBindingD3D11Impl), sizeof(FenceD3D11Impl), - sizeof(QueryD3D11Impl) + sizeof(QueryD3D11Impl), + sizeof(RenderPassD3D11Impl) } }, m_EngineAttribs{EngineAttribs}, @@ -374,13 +376,13 @@ void RenderDeviceD3D11Impl::CreateQuery(const QueryDesc& Desc, IQuery** ppQuery) void RenderDeviceD3D11Impl::CreateRenderPass(const RenderPassDesc& Desc, IRenderPass** ppRenderPass) { - //CreateDeviceObject("RenderPass", Desc, ppRenderPass, - // [&]() // - // { - // RenderPassD3D11Impl* pRenderPassD3D11(NEW_RC_OBJ(m_RenderPassAllocator, "RenderPassD3D11Impl instance", RenderPassD3D11Impl)(this, Desc)); - // pRenderPassD3D11->RenderPassInterface(IID_RenderPass, reinterpret_cast(ppRenderPass)); - // OnCreateDeviceObject(pRenderPassD3D11); - // }); + CreateDeviceObject("RenderPass", Desc, ppRenderPass, + [&]() // + { + RenderPassD3D11Impl* pRenderPassD3D11(NEW_RC_OBJ(m_RenderPassAllocator, "RenderPassD3D11Impl instance", RenderPassD3D11Impl)(this, Desc)); + pRenderPassD3D11->QueryInterface(IID_RenderPass, reinterpret_cast(ppRenderPass)); + OnCreateDeviceObject(pRenderPassD3D11); + }); } void RenderDeviceD3D11Impl::IdleGPU() diff --git a/Graphics/GraphicsEngineD3D11/src/RenderPassD3D11Impl.cpp b/Graphics/GraphicsEngineD3D11/src/RenderPassD3D11Impl.cpp new file mode 100644 index 00000000..d30fd368 --- /dev/null +++ b/Graphics/GraphicsEngineD3D11/src/RenderPassD3D11Impl.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 "RenderPassD3D11Impl.hpp" +#include "EngineMemory.h" + +namespace Diligent +{ + +RenderPassD3D11Impl::RenderPassD3D11Impl(IReferenceCounters* pRefCounters, + RenderDeviceD3D11Impl* pDevice, + const RenderPassDesc& Desc) : + TRenderPassBase{pRefCounters, pDevice, Desc} +{ +} + +RenderPassD3D11Impl::~RenderPassD3D11Impl() +{ +} + +} // namespace Diligent -- cgit v1.2.3