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/GraphicsEngineOpenGL/CMakeLists.txt | 2 + .../include/RenderPassGLImpl.hpp | 54 ++++++++++++++++++++++ .../src/RenderDeviceGLImpl.cpp | 22 +++++---- .../GraphicsEngineOpenGL/src/RenderPassGLImpl.cpp | 47 +++++++++++++++++++ 4 files changed, 115 insertions(+), 10 deletions(-) create mode 100644 Graphics/GraphicsEngineOpenGL/include/RenderPassGLImpl.hpp create mode 100644 Graphics/GraphicsEngineOpenGL/src/RenderPassGLImpl.cpp (limited to 'Graphics/GraphicsEngineOpenGL') diff --git a/Graphics/GraphicsEngineOpenGL/CMakeLists.txt b/Graphics/GraphicsEngineOpenGL/CMakeLists.txt index 1072d067..52251b68 100644 --- a/Graphics/GraphicsEngineOpenGL/CMakeLists.txt +++ b/Graphics/GraphicsEngineOpenGL/CMakeLists.txt @@ -20,6 +20,7 @@ set(INCLUDE include/PipelineStateGLImpl.hpp include/QueryGLImpl.hpp include/RenderDeviceGLImpl.hpp + include/RenderPassGLImpl.hpp include/SamplerGLImpl.hpp include/ShaderGLImpl.hpp include/ShaderResourceBindingGLImpl.hpp @@ -71,6 +72,7 @@ set(SOURCE src/PipelineStateGLImpl.cpp src/QueryGLImpl.cpp src/RenderDeviceGLImpl.cpp + src/RenderPassGLImpl.cpp src/SamplerGLImpl.cpp src/ShaderGLImpl.cpp src/ShaderResourceBindingGLImpl.cpp diff --git a/Graphics/GraphicsEngineOpenGL/include/RenderPassGLImpl.hpp b/Graphics/GraphicsEngineOpenGL/include/RenderPassGLImpl.hpp new file mode 100644 index 00000000..e5d77333 --- /dev/null +++ b/Graphics/GraphicsEngineOpenGL/include/RenderPassGLImpl.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::RenderPassGLImpl class + +#include "RenderDeviceGL.h" +#include "RenderPassBase.hpp" +#include "RenderDeviceGLImpl.hpp" + +namespace Diligent +{ + +class FixedBlockMemoryAllocator; + +/// Render pass implementation in Direct3D11 backend. +class RenderPassGLImpl final : public RenderPassBase +{ +public: + using TRenderPassBase = RenderPassBase; + + RenderPassGLImpl(IReferenceCounters* pRefCounters, + RenderDeviceGLImpl* pDevice, + const RenderPassDesc& Desc); + ~RenderPassGLImpl(); +}; + +} // namespace Diligent diff --git a/Graphics/GraphicsEngineOpenGL/src/RenderDeviceGLImpl.cpp b/Graphics/GraphicsEngineOpenGL/src/RenderDeviceGLImpl.cpp index f47163d8..bc38d364 100644 --- a/Graphics/GraphicsEngineOpenGL/src/RenderDeviceGLImpl.cpp +++ b/Graphics/GraphicsEngineOpenGL/src/RenderDeviceGLImpl.cpp @@ -46,6 +46,7 @@ #include "ShaderResourceBindingGLImpl.hpp" #include "FenceGLImpl.hpp" #include "QueryGLImpl.hpp" +#include "RenderPassGLImpl.hpp" #include "EngineMemory.h" #include "StringTools.hpp" @@ -75,7 +76,8 @@ RenderDeviceGLImpl::RenderDeviceGLImpl(IReferenceCounters* pRefCounters, sizeof(PipelineStateGLImpl), sizeof(ShaderResourceBindingGLImpl), sizeof(FenceGLImpl), - sizeof(QueryGLImpl) + sizeof(QueryGLImpl), + sizeof(RenderPassGLImpl) } }, // Device caps must be filled in before the constructor of Pipeline Cache is called! @@ -517,15 +519,15 @@ void RenderDeviceGLImpl::CreateQuery(const QueryDesc& Desc, IQuery** ppQuery) void RenderDeviceGLImpl::CreateRenderPass(const RenderPassDesc& Desc, IRenderPass** ppRenderPass) { - //CreateDeviceObject( - // "RenderPass", Desc, ppRenderPass, - // [&]() // - // { - // RenderPassGLImpl* pRenderPassOGL(NEW_RC_OBJ(m_RenderPassAllocator, "RenderPassGLImpl instance", RenderPassGLImpl)(this, Desc)); - // pRenderPassOGL->RenderPassInterface(IID_RenderPass, reinterpret_cast(ppRenderPass)); - // OnCreateDeviceObject(pRenderPassOGL); - // } // - //); + CreateDeviceObject( + "RenderPass", Desc, ppRenderPass, + [&]() // + { + RenderPassGLImpl* pRenderPassOGL(NEW_RC_OBJ(m_RenderPassAllocator, "RenderPassGLImpl instance", RenderPassGLImpl)(this, Desc)); + pRenderPassOGL->QueryInterface(IID_RenderPass, reinterpret_cast(ppRenderPass)); + OnCreateDeviceObject(pRenderPassOGL); + } // + ); } bool RenderDeviceGLImpl::CheckExtension(const Char* ExtensionString) diff --git a/Graphics/GraphicsEngineOpenGL/src/RenderPassGLImpl.cpp b/Graphics/GraphicsEngineOpenGL/src/RenderPassGLImpl.cpp new file mode 100644 index 00000000..2a9d0609 --- /dev/null +++ b/Graphics/GraphicsEngineOpenGL/src/RenderPassGLImpl.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 "RenderPassGLImpl.hpp" +#include "EngineMemory.h" + +namespace Diligent +{ + +RenderPassGLImpl::RenderPassGLImpl(IReferenceCounters* pRefCounters, + RenderDeviceGLImpl* pDevice, + const RenderPassDesc& Desc) : + TRenderPassBase{pRefCounters, pDevice, Desc} +{ +} + +RenderPassGLImpl::~RenderPassGLImpl() +{ +} + +} // namespace Diligent -- cgit v1.2.3