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/GraphicsEngine | |
| 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/GraphicsEngine')
| -rw-r--r-- | Graphics/GraphicsEngine/CMakeLists.txt | 1 | ||||
| -rw-r--r-- | Graphics/GraphicsEngine/include/RenderDeviceBase.hpp | 27 | ||||
| -rw-r--r-- | Graphics/GraphicsEngine/include/RenderPassBase.hpp | 72 |
3 files changed, 89 insertions, 11 deletions
diff --git a/Graphics/GraphicsEngine/CMakeLists.txt b/Graphics/GraphicsEngine/CMakeLists.txt index c3dd8678..0c522bed 100644 --- a/Graphics/GraphicsEngine/CMakeLists.txt +++ b/Graphics/GraphicsEngine/CMakeLists.txt @@ -17,6 +17,7 @@ set(INCLUDE include/PipelineStateBase.hpp include/QueryBase.hpp include/RenderDeviceBase.hpp + include/RenderPassBase.hpp include/ResourceMappingImpl.hpp include/SamplerBase.hpp include/ShaderBase.hpp diff --git a/Graphics/GraphicsEngine/include/RenderDeviceBase.hpp b/Graphics/GraphicsEngine/include/RenderDeviceBase.hpp index 49e54d12..854e5ec9 100644 --- a/Graphics/GraphicsEngine/include/RenderDeviceBase.hpp +++ b/Graphics/GraphicsEngine/include/RenderDeviceBase.hpp @@ -220,6 +220,9 @@ public: /// Size of the query object (QueryD3D12Impl, QueryVkImpl, etc.), in bytes const size_t QuerySize; + + /// Size of the render pass object (RenderPassD3D12Impl, RenderPassVkImpl, etc.), in bytes + const size_t RenderPassObjSize; }; /// \param pRefCounters - reference counters object that controls the lifetime of this render device @@ -243,17 +246,18 @@ public: m_TexFmtInfoInitFlags (TEX_FORMAT_NUM_FORMATS, false, STD_ALLOCATOR_RAW_MEM(bool, RawMemAllocator, "Allocator for vector<bool>")), m_wpDeferredContexts (NumDeferredContexts, RefCntWeakPtr<IDeviceContext>(), STD_ALLOCATOR_RAW_MEM(RefCntWeakPtr<IDeviceContext>, RawMemAllocator, "Allocator for vector< RefCntWeakPtr<IDeviceContext> >")), m_RawMemAllocator {RawMemAllocator}, - m_TexObjAllocator {RawMemAllocator, ObjectSizes.TextureObjSize, 64 }, - m_TexViewObjAllocator {RawMemAllocator, ObjectSizes.TexViewObjSize, 64 }, - m_BufObjAllocator {RawMemAllocator, ObjectSizes.BufferObjSize, 128 }, - m_BuffViewObjAllocator {RawMemAllocator, ObjectSizes.BuffViewObjSize, 128 }, - m_ShaderObjAllocator {RawMemAllocator, ObjectSizes.ShaderObjSize, 32 }, - m_SamplerObjAllocator {RawMemAllocator, ObjectSizes.SamplerObjSize, 32 }, - m_PSOAllocator {RawMemAllocator, ObjectSizes.PSOSize, 128 }, - m_SRBAllocator {RawMemAllocator, ObjectSizes.SRBSize, 1024}, - m_ResMappingAllocator {RawMemAllocator, sizeof(ResourceMappingImpl), 16 }, - m_FenceAllocator {RawMemAllocator, ObjectSizes.FenceSize, 16 }, - m_QueryAllocator {RawMemAllocator, ObjectSizes.QuerySize, 16 } + m_TexObjAllocator {RawMemAllocator, ObjectSizes.TextureObjSize, 64 }, + m_TexViewObjAllocator {RawMemAllocator, ObjectSizes.TexViewObjSize, 64 }, + m_BufObjAllocator {RawMemAllocator, ObjectSizes.BufferObjSize, 128 }, + m_BuffViewObjAllocator {RawMemAllocator, ObjectSizes.BuffViewObjSize, 128 }, + m_ShaderObjAllocator {RawMemAllocator, ObjectSizes.ShaderObjSize, 32 }, + m_SamplerObjAllocator {RawMemAllocator, ObjectSizes.SamplerObjSize, 32 }, + m_PSOAllocator {RawMemAllocator, ObjectSizes.PSOSize, 128 }, + m_SRBAllocator {RawMemAllocator, ObjectSizes.SRBSize, 1024}, + m_ResMappingAllocator {RawMemAllocator, sizeof(ResourceMappingImpl), 16 }, + m_FenceAllocator {RawMemAllocator, ObjectSizes.FenceSize, 16 }, + m_QueryAllocator {RawMemAllocator, ObjectSizes.QuerySize, 16 }, + m_RenderPassAllocator {RawMemAllocator, ObjectSizes.RenderPassObjSize, 16 } // clang-format on { // Initialize texture format info @@ -426,6 +430,7 @@ protected: FixedBlockMemoryAllocator m_ResMappingAllocator; ///< Allocator for resource mapping objects FixedBlockMemoryAllocator m_FenceAllocator; ///< Allocator for fence objects FixedBlockMemoryAllocator m_QueryAllocator; ///< Allocator for query objects + FixedBlockMemoryAllocator m_RenderPassAllocator; ///< Allocator for render pass objects }; diff --git a/Graphics/GraphicsEngine/include/RenderPassBase.hpp b/Graphics/GraphicsEngine/include/RenderPassBase.hpp new file mode 100644 index 00000000..c10f39a1 --- /dev/null +++ b/Graphics/GraphicsEngine/include/RenderPassBase.hpp @@ -0,0 +1,72 @@ +/* + * 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 +/// Implementation of the Diligent::RenderPassBase template class + +#include "RenderPass.h" +#include "DeviceObjectBase.hpp" +#include "RenderDeviceBase.hpp" + +namespace Diligent +{ + +/// Template class implementing base functionality for the render pass object. + +/// \tparam BaseInterface - base interface that this class will inheret +/// (Diligent::IRenderPassVk). +/// \tparam RenderDeviceImplType - type of the render device implementation +/// (Diligent::RenderDeviceD3D11Impl, Diligent::RenderDeviceD3D12Impl, +/// Diligent::RenderDeviceGLImpl, or Diligent::RenderDeviceVkImpl) +template <class BaseInterface, class RenderDeviceImplType> +class RenderPassBase : public DeviceObjectBase<BaseInterface, RenderDeviceImplType, RenderPassDesc> +{ +public: + using TDeviceObjectBase = DeviceObjectBase<BaseInterface, RenderDeviceImplType, RenderPassDesc>; + + /// \param pRefCounters - reference counters object that controls the lifetime of this render pass. + /// \param pDevice - pointer to the device. + /// \param Desc - Render pass description. + /// \param bIsDeviceInternal - flag indicating if the RenderPass is an internal device object and + /// must not keep a strong reference to the device. + RenderPassBase(IReferenceCounters* pRefCounters, + RenderDeviceImplType* pDevice, + const RenderPassDesc& Desc, + bool bIsDeviceInternal = false) : + TDeviceObjectBase{pRefCounters, pDevice, Desc, bIsDeviceInternal} + {} + + ~RenderPassBase() + { + } + + IMPLEMENT_QUERY_INTERFACE_IN_PLACE(IID_RenderPass, TDeviceObjectBase) +}; + +} // namespace Diligent |
