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/GraphicsEngineD3D12/CMakeLists.txt | 2 + .../include/RenderPassD3D12Impl.hpp | 54 ++++++++++++++++++++++ .../src/RenderDeviceD3D12Impl.cpp | 18 ++++---- .../src/RenderPassD3D12Impl.cpp | 47 +++++++++++++++++++ 4 files changed, 113 insertions(+), 8 deletions(-) create mode 100644 Graphics/GraphicsEngineD3D12/include/RenderPassD3D12Impl.hpp create mode 100644 Graphics/GraphicsEngineD3D12/src/RenderPassD3D12Impl.cpp (limited to 'Graphics/GraphicsEngineD3D12') diff --git a/Graphics/GraphicsEngineD3D12/CMakeLists.txt b/Graphics/GraphicsEngineD3D12/CMakeLists.txt index 6ea2fc22..06c2bfcf 100644 --- a/Graphics/GraphicsEngineD3D12/CMakeLists.txt +++ b/Graphics/GraphicsEngineD3D12/CMakeLists.txt @@ -24,6 +24,7 @@ set(INCLUDE include/QueryD3D12Impl.hpp include/QueryManagerD3D12.hpp include/RenderDeviceD3D12Impl.hpp + include/RenderPassD3D12Impl.hpp include/RootSignature.hpp include/SamplerD3D12Impl.hpp include/ShaderD3D12Impl.hpp @@ -74,6 +75,7 @@ set(SRC src/QueryD3D12Impl.cpp src/QueryManagerD3D12.cpp src/RenderDeviceD3D12Impl.cpp + src/RenderPassD3D12Impl.cpp src/RootSignature.cpp src/SamplerD3D12Impl.cpp src/ShaderD3D12Impl.cpp diff --git a/Graphics/GraphicsEngineD3D12/include/RenderPassD3D12Impl.hpp b/Graphics/GraphicsEngineD3D12/include/RenderPassD3D12Impl.hpp new file mode 100644 index 00000000..501e62df --- /dev/null +++ b/Graphics/GraphicsEngineD3D12/include/RenderPassD3D12Impl.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::RenderPassD3D12Impl class + +#include "RenderDeviceD3D12.h" +#include "RenderPassBase.hpp" +#include "RenderDeviceD3D12Impl.hpp" + +namespace Diligent +{ + +class FixedBlockMemoryAllocator; + +/// Render pass implementation in Direct3D11 backend. +class RenderPassD3D12Impl final : public RenderPassBase +{ +public: + using TRenderPassBase = RenderPassBase; + + RenderPassD3D12Impl(IReferenceCounters* pRefCounters, + RenderDeviceD3D12Impl* pDevice, + const RenderPassDesc& Desc); + ~RenderPassD3D12Impl(); +}; + +} // namespace Diligent diff --git a/Graphics/GraphicsEngineD3D12/src/RenderDeviceD3D12Impl.cpp b/Graphics/GraphicsEngineD3D12/src/RenderDeviceD3D12Impl.cpp index a37f32cf..f1d00587 100644 --- a/Graphics/GraphicsEngineD3D12/src/RenderDeviceD3D12Impl.cpp +++ b/Graphics/GraphicsEngineD3D12/src/RenderDeviceD3D12Impl.cpp @@ -38,6 +38,7 @@ #include "DeviceContextD3D12Impl.hpp" #include "FenceD3D12Impl.hpp" #include "QueryD3D12Impl.hpp" +#include "RenderPassD3D12Impl.hpp" #include "EngineMemory.h" namespace Diligent @@ -109,7 +110,8 @@ RenderDeviceD3D12Impl::RenderDeviceD3D12Impl(IReferenceCounters* pRefCo sizeof(PipelineStateD3D12Impl), sizeof(ShaderResourceBindingD3D12Impl), sizeof(FenceD3D12Impl), - sizeof(QueryD3D12Impl) + sizeof(QueryD3D12Impl), + sizeof(RenderPassD3D12Impl) } }, m_pd3d12Device {pd3d12Device}, @@ -524,13 +526,13 @@ void RenderDeviceD3D12Impl::CreateQuery(const QueryDesc& Desc, IQuery** ppQuery) void RenderDeviceD3D12Impl::CreateRenderPass(const RenderPassDesc& Desc, IRenderPass** ppRenderPass) { - //CreateDeviceObject("RenderPass", Desc, ppRenderPass, - // [&]() // - // { - // RenderPassD3D12Impl* pRenderPassD3D12(NEW_RC_OBJ(m_RenderPassAllocator, "RenderPassD3D12Impl instance", RenderPassD3D12Impl)(this, Desc)); - // pRenderPassD3D12->RenderPassInterface(IID_RenderPass, reinterpret_cast(ppRenderPass)); - // OnCreateDeviceObject(pRenderPassD3D12); - // }); + CreateDeviceObject("RenderPass", Desc, ppRenderPass, + [&]() // + { + RenderPassD3D12Impl* pRenderPassD3D12(NEW_RC_OBJ(m_RenderPassAllocator, "RenderPassD3D12Impl instance", RenderPassD3D12Impl)(this, Desc)); + pRenderPassD3D12->QueryInterface(IID_RenderPass, reinterpret_cast(ppRenderPass)); + OnCreateDeviceObject(pRenderPassD3D12); + }); } DescriptorHeapAllocation RenderDeviceD3D12Impl::AllocateDescriptor(D3D12_DESCRIPTOR_HEAP_TYPE Type, UINT Count /*= 1*/) diff --git a/Graphics/GraphicsEngineD3D12/src/RenderPassD3D12Impl.cpp b/Graphics/GraphicsEngineD3D12/src/RenderPassD3D12Impl.cpp new file mode 100644 index 00000000..88d4fad2 --- /dev/null +++ b/Graphics/GraphicsEngineD3D12/src/RenderPassD3D12Impl.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 "RenderPassD3D12Impl.hpp" +#include "EngineMemory.h" + +namespace Diligent +{ + +RenderPassD3D12Impl::RenderPassD3D12Impl(IReferenceCounters* pRefCounters, + RenderDeviceD3D12Impl* pDevice, + const RenderPassDesc& Desc) : + TRenderPassBase{pRefCounters, pDevice, Desc} +{ +} + +RenderPassD3D12Impl::~RenderPassD3D12Impl() +{ +} + +} // namespace Diligent -- cgit v1.2.3