diff options
| author | assiduous <assiduous@diligentgraphics.com> | 2020-07-23 22:24:54 +0000 |
|---|---|---|
| committer | assiduous <assiduous@diligentgraphics.com> | 2020-08-02 19:21:32 +0000 |
| commit | a78add37a57b51d80ef2fd21a7a0799ba73dd937 (patch) | |
| tree | 76bf8bf0afdc1bc872cdda0bcbcf3e973bcbdaa9 /Graphics/GraphicsEngine | |
| parent | Switched to using Volk on Windows (https://github.com/DiligentGraphics/Dilige... (diff) | |
| download | DiligentCore-a78add37a57b51d80ef2fd21a7a0799ba73dd937.tar.gz DiligentCore-a78add37a57b51d80ef2fd21a7a0799ba73dd937.zip | |
Added Render pass interface stub
Diffstat (limited to 'Graphics/GraphicsEngine')
| -rw-r--r-- | Graphics/GraphicsEngine/CMakeLists.txt | 1 | ||||
| -rw-r--r-- | Graphics/GraphicsEngine/interface/RenderDevice.h | 13 | ||||
| -rw-r--r-- | Graphics/GraphicsEngine/interface/RenderPass.h | 123 |
3 files changed, 137 insertions, 0 deletions
diff --git a/Graphics/GraphicsEngine/CMakeLists.txt b/Graphics/GraphicsEngine/CMakeLists.txt index 935aeee9..c3dd8678 100644 --- a/Graphics/GraphicsEngine/CMakeLists.txt +++ b/Graphics/GraphicsEngine/CMakeLists.txt @@ -47,6 +47,7 @@ set(INTERFACE interface/Query.h interface/RasterizerState.h interface/RenderDevice.h + interface/RenderPass.h interface/ResourceMapping.h interface/Sampler.h interface/Shader.h diff --git a/Graphics/GraphicsEngine/interface/RenderDevice.h b/Graphics/GraphicsEngine/interface/RenderDevice.h index 23eae467..24c641bc 100644 --- a/Graphics/GraphicsEngine/interface/RenderDevice.h +++ b/Graphics/GraphicsEngine/interface/RenderDevice.h @@ -46,6 +46,7 @@ #include "PipelineState.h" #include "Fence.h" #include "Query.h" +#include "RenderPass.h" #include "DepthStencilState.h" #include "RasterizerState.h" @@ -188,6 +189,18 @@ DILIGENT_BEGIN_INTERFACE(IRenderDevice, IObject) IQuery** ppQuery) PURE; + /// Creates a render pass object + + /// \param [in] Desc - Render pass description, see Diligent::RenderPassDesc for details. + /// \param [out] ppRenderPass - Address of the memory location where the pointer to the + /// render pass interface will be stored. + /// The function calls AddRef(), so that the new object will contain + /// one reference. + VIRTUAL void METHOD(CreateRenderPass)(THIS_ + const RenderPassDesc REF Desc, + IRenderPass** ppRenderPass) PURE; + + /// Gets the device capabilities, see Diligent::DeviceCaps for details VIRTUAL const DeviceCaps REF METHOD(GetDeviceCaps)(THIS) CONST PURE; diff --git a/Graphics/GraphicsEngine/interface/RenderPass.h b/Graphics/GraphicsEngine/interface/RenderPass.h new file mode 100644 index 00000000..2e7c8b63 --- /dev/null +++ b/Graphics/GraphicsEngine/interface/RenderPass.h @@ -0,0 +1,123 @@ +/* + * 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 + +// clang-format off + +/// \file +/// Definition of the Diligent::IRenderPass interface and related data structures + +#include "DeviceObject.h" + +DILIGENT_BEGIN_NAMESPACE(Diligent) + +// {B818DEC7-174D-447A-A8E4-94D21C57B40A} +static const struct INTERFACE_ID IID_RenderPass = + { 0xb818dec7, 0x174d, 0x447a, { 0xa8, 0xe4, 0x94, 0xd2, 0x1c, 0x57, 0xb4, 0xa } }; + + +/// Render pass attachment description. +struct RenderPassAttachmentDesc +{ + int Dummy; +}; +typedef struct RenderPassAttachmentDesc RenderPassAttachmentDesc; + + +/// Render pass subpass decription. +struct SubpassDesc +{ + int Dummy; +}; +typedef struct SubpassDesc SubpassDesc; + + +/// Subpass dependency description +struct SubpassDependencyDesc +{ + int Dummy; +}; +typedef struct SubpassDependencyDesc SubpassDependencyDesc; + +/// Render pass description +struct RenderPassDesc DILIGENT_DERIVE(DeviceObjectAttribs) + + /// The number of attachments. + Uint32 AttachmentCount DEFAULT_INITIALIZER(0); + + /// Pointer to the array of subpass attachments, see Diligent::RenderPassAttachmentDesc. + const RenderPassAttachmentDesc* pAttachments DEFAULT_INITIALIZER(nullptr); + + /// The number of subpasses. + Uint32 SubpassCount DEFAULT_INITIALIZER(0); + + /// Pointer to the array of subpass descriptions, see Diligent::SubpassDesc. + const SubpassDesc* pSubpasses DEFAULT_INITIALIZER(nullptr); + + /// The number of subpass dependencies. + Uint32 DependencyCount DEFAULT_INITIALIZER(0); + + /// The array of subpass dependencies, see Diligent::SubpassDependencyDesc. + const SubpassDependencyDesc* pDependencies DEFAULT_INITIALIZER(nullptr); +}; +typedef struct RenderPassDesc RenderPassDesc; + + +#if DILIGENT_CPP_INTERFACE + +/// Render pass interface + +/// Render pass has no methods. +class IRenderPass : public IDeviceObject +{ +}; + +#else + +struct IRenderPass; + +// C requires that a struct or union has at least one member +//struct IRenderPassMethods +//{ +//}; + +struct IRenderPassVtbl +{ + struct IObjectMethods Object; + struct IDeviceObjectMethods DeviceObject; + //struct IRenderPassMethods RenderPass; +}; + +typedef struct IRenderPass +{ + struct IRenderPassVtbl* pVtbl; +} IRenderPass; + +#endif + +DILIGENT_END_NAMESPACE // namespace Diligent |
