summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngineMetal
diff options
context:
space:
mode:
authorassiduous <assiduous@diligentgraphics.com>2020-07-23 22:58:46 +0000
committerassiduous <assiduous@diligentgraphics.com>2020-08-02 19:21:33 +0000
commit8a7504ff49c357ad86d547a35bdfd3258bea72df (patch)
treebb60a5848ac4046b66dfa3197423a60bec185613 /Graphics/GraphicsEngineMetal
parentAdded Render pass interface stub (diff)
downloadDiligentCore-8a7504ff49c357ad86d547a35bdfd3258bea72df.tar.gz
DiligentCore-8a7504ff49c357ad86d547a35bdfd3258bea72df.zip
Added render pass object implementation stubs in all backends
Diffstat (limited to 'Graphics/GraphicsEngineMetal')
-rw-r--r--Graphics/GraphicsEngineMetal/include/RenderPassMtlImpl.hpp54
-rw-r--r--Graphics/GraphicsEngineMetal/src/RenderDeviceMtlImpl.mm22
-rw-r--r--Graphics/GraphicsEngineMetal/src/RenderPassMtlImpl.mm41
3 files changed, 107 insertions, 10 deletions
diff --git a/Graphics/GraphicsEngineMetal/include/RenderPassMtlImpl.hpp b/Graphics/GraphicsEngineMetal/include/RenderPassMtlImpl.hpp
new file mode 100644
index 00000000..2c900713
--- /dev/null
+++ b/Graphics/GraphicsEngineMetal/include/RenderPassMtlImpl.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::RenderPassMtlImpl class
+
+#include "RenderDeviceMtl.h"
+#include "RenderPassBase.hpp"
+#include "RenderDeviceMtlImpl.hpp"
+
+namespace Diligent
+{
+
+class FixedBlockMemoryAllocator;
+
+/// Render pass implementation in Direct3D11 backend.
+class RenderPassMtlImpl final : public RenderPassBase<IRenderPass, RenderDeviceMtlImpl>
+{
+public:
+ using TRenderPassBase = RenderPassBase<IRenderPass, RenderDeviceMtlImpl>;
+
+ RenderPassMtlImpl(IReferenceCounters* pRefCounters,
+ RenderDeviceMtlImpl* pDevice,
+ const RenderPassDesc& Desc);
+ ~RenderPassMtlImpl();
+};
+
+} // namespace Diligent
diff --git a/Graphics/GraphicsEngineMetal/src/RenderDeviceMtlImpl.mm b/Graphics/GraphicsEngineMetal/src/RenderDeviceMtlImpl.mm
index b137c0f6..7e7e57c5 100644
--- a/Graphics/GraphicsEngineMetal/src/RenderDeviceMtlImpl.mm
+++ b/Graphics/GraphicsEngineMetal/src/RenderDeviceMtlImpl.mm
@@ -32,6 +32,7 @@
#include "PipelineStateMtlImpl.h"
#include "ShaderResourceBindingMtlImpl.h"
#include "FenceMtlImpl.h"
+#include "RenderPassMtlImpl.h"
#include "EngineMemory.h"
namespace Diligent
@@ -58,7 +59,8 @@ RenderDeviceMtlImpl :: RenderDeviceMtlImpl(IReferenceCounters* pRefCounte
sizeof(SamplerMtlImpl),
sizeof(PipelineStateMtlImpl),
sizeof(ShaderResourceBindingMtlImpl),
- sizeof(FenceMtlImpl)
+ sizeof(FenceMtlImpl),
+ sizeof(RenderPassMtlImpl)
}
},
m_EngineAttribs(EngineAttribs)
@@ -186,15 +188,15 @@ void RenderDeviceMtlImpl::CreateQuery(const QueryDesc& Desc, IQuery** ppQuery)
void RenderDeviceMtlImpl::CreateRenderPass(const RenderPassDesc& Desc, IRenderPass** ppRenderPass)
{
-// CreateDeviceObject( "RenderPass", Desc, ppRenderPass,
-// [&]()
-// {
-// RenderPassMtlImpl* pRenderPassMtl( NEW_RC_OBJ(m_RenderPassAllocator, "RenderPassMtlImpl instance", RenderPassMtlImpl)
-// (this, Desc) );
-// pRenderPassMtl->RenderPassInterface( IID_RenderPass, reinterpret_cast<IObject**>(ppRenderPass) );
-// OnCreateDeviceObject( pRenderPassMtl );
-// }
-// );
+ CreateDeviceObject( "RenderPass", Desc, ppRenderPass,
+ [&]()
+ {
+ RenderPassMtlImpl* pRenderPassMtl( NEW_RC_OBJ(m_RenderPassAllocator, "RenderPassMtlImpl instance", RenderPassMtlImpl)
+ (this, Desc) );
+ pRenderPassMtl->QueryInterface( IID_RenderPass, reinterpret_cast<IObject**>(ppRenderPass) );
+ OnCreateDeviceObject( pRenderPassMtl );
+ }
+ );
}
void RenderDeviceMtlImpl::IdleGPU()
diff --git a/Graphics/GraphicsEngineMetal/src/RenderPassMtlImpl.mm b/Graphics/GraphicsEngineMetal/src/RenderPassMtlImpl.mm
new file mode 100644
index 00000000..c35f9aad
--- /dev/null
+++ b/Graphics/GraphicsEngineMetal/src/RenderPassMtlImpl.mm
@@ -0,0 +1,41 @@
+/* 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
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF ANY PROPRIETARY RIGHTS.
+ *
+ * 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 "RenderPassMtlImpl.h"
+#include "EngineMemory.h"
+
+namespace Diligent
+{
+
+RenderPassMtlImpl :: RenderPassMtlImpl(IReferenceCounters* pRefCounters,
+ RenderDeviceMtlImpl* pDevice,
+ const RenderPassDesc& Desc) :
+ TQueryBase(pRefCounters, pDevice, Desc)
+{
+}
+
+RenderPassMtlImpl :: ~RenderPassMtlImpl()
+{
+}
+
+}