summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngineMetal
diff options
context:
space:
mode:
authorEgor Yusov <egor.yusov@gmail.com>2019-03-06 04:01:30 +0000
committerEgor Yusov <egor.yusov@gmail.com>2019-03-06 04:01:30 +0000
commit261869609fc566e74bc989919d5a204c76421f66 (patch)
tree8a1f52d865f80da47512122f54b0c520390822c8 /Graphics/GraphicsEngineMetal
parentFinal changes to make GL backend compile (diff)
downloadDiligentCore-261869609fc566e74bc989919d5a204c76421f66.tar.gz
DiligentCore-261869609fc566e74bc989919d5a204c76421f66.zip
Fixed Metal backend stub
Diffstat (limited to 'Graphics/GraphicsEngineMetal')
-rw-r--r--Graphics/GraphicsEngineMetal/CMakeLists.txt7
-rw-r--r--Graphics/GraphicsEngineMetal/interface/EngineFactoryMtl.h (renamed from Graphics/GraphicsEngineMetal/interface/RenderDeviceFactoryMtl.h)18
-rw-r--r--Graphics/GraphicsEngineMetal/interface/EngineMtlAttribs.h38
-rw-r--r--Graphics/GraphicsEngineMetal/src/EngineFactoryMtl.mm (renamed from Graphics/GraphicsEngineMetal/src/RenderDeviceFactoryMtl.mm)48
4 files changed, 36 insertions, 75 deletions
diff --git a/Graphics/GraphicsEngineMetal/CMakeLists.txt b/Graphics/GraphicsEngineMetal/CMakeLists.txt
index 6a2bb29d..294d7276 100644
--- a/Graphics/GraphicsEngineMetal/CMakeLists.txt
+++ b/Graphics/GraphicsEngineMetal/CMakeLists.txt
@@ -9,7 +9,7 @@ set(INCLUDE
include/CommandListMtlImpl.h
include/MtlTypeConversions.h
include/DeviceContextMtlImpl.h
- include/FenceMtlImpl.h
+ include/FenceMtlImpl.h
include/PipelineStateMtlImpl.h
include/RenderDeviceMtlImpl.h
include/SamplerMtlImpl.h
@@ -24,11 +24,10 @@ set(INTERFACE
interface/BufferMtl.h
interface/BufferViewMtl.h
interface/DeviceContextMtl.h
- interface/EngineMtlAttribs.h
+ interface/EngineFactoryMtl.h
interface/FenceMtl.h
interface/PipelineStateMtl.h
interface/RenderDeviceMtl.h
- interface/RenderDeviceFactoryMtl.h
interface/SamplerMtl.h
interface/ShaderMtl.h
interface/ShaderResourceBindingMtl.h
@@ -44,10 +43,10 @@ set(SRC
src/CommandListMtlImpl.mm
src/MtlTypeConversions.mm
src/DeviceContextMtlImpl.mm
+ src/EngineFactoryMtl.mm
src/FenceMtlImpl.mm
src/PipelineStateMtlImpl.mm
src/RenderDeviceMtlImpl.mm
- src/RenderDeviceFactoryMtl.mm
src/SamplerMtlImpl.mm
src/ShaderMtlImpl.mm
src/ShaderResourceBindingMtlImpl.mm
diff --git a/Graphics/GraphicsEngineMetal/interface/RenderDeviceFactoryMtl.h b/Graphics/GraphicsEngineMetal/interface/EngineFactoryMtl.h
index e0e9bffc..01888518 100644
--- a/Graphics/GraphicsEngineMetal/interface/RenderDeviceFactoryMtl.h
+++ b/Graphics/GraphicsEngineMetal/interface/EngineFactoryMtl.h
@@ -42,10 +42,10 @@ namespace Diligent
class IEngineFactoryMtl
{
public:
- virtual void CreateDeviceAndContextsMtl( const EngineMtlAttribs& Attribs,
- IRenderDevice** ppDevice,
- IDeviceContext** ppContexts,
- Uint32 NumDeferredContexts ) = 0;
+ virtual void CreateDeviceAndContextsMtl(const EngineMtlCreateInfo& Attribs,
+ IRenderDevice** ppDevice,
+ IDeviceContext** ppContexts,
+ Uint32 NumDeferredContexts ) = 0;
virtual void CreateSwapChainMtl( IRenderDevice* pDevice,
IDeviceContext* pImmediateContext,
@@ -53,11 +53,11 @@ public:
void* pView,
ISwapChain** ppSwapChain ) = 0;
- virtual void AttachToMtlDevice(void* pMtlNativeDevice,
- const EngineMtlAttribs& EngineAttribs,
- IRenderDevice** ppDevice,
- IDeviceContext** ppContexts,
- Uint32 NumDeferredContexts) = 0;
+ virtual void AttachToMtlDevice(void* pMtlNativeDevice,
+ const EngineMtlCreateInfo& EngineAttribs,
+ IRenderDevice** ppDevice,
+ IDeviceContext** ppContexts,
+ Uint32 NumDeferredContexts) = 0;
};
diff --git a/Graphics/GraphicsEngineMetal/interface/EngineMtlAttribs.h b/Graphics/GraphicsEngineMetal/interface/EngineMtlAttribs.h
deleted file mode 100644
index 935716df..00000000
--- a/Graphics/GraphicsEngineMetal/interface/EngineMtlAttribs.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/* 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.
- */
-
-#pragma once
-
-/// \file
-/// Definition of the Engine Mtl attribs
-
-#include "../../GraphicsEngine/interface/GraphicsTypes.h"
-
-namespace Diligent
-{
- /// Attributes of the Metal-based engine implementation
- struct EngineMtlAttribs : public EngineCreationAttribs
- {
-
- };
-}
diff --git a/Graphics/GraphicsEngineMetal/src/RenderDeviceFactoryMtl.mm b/Graphics/GraphicsEngineMetal/src/EngineFactoryMtl.mm
index 900a288b..7516d45e 100644
--- a/Graphics/GraphicsEngineMetal/src/RenderDeviceFactoryMtl.mm
+++ b/Graphics/GraphicsEngineMetal/src/EngineFactoryMtl.mm
@@ -24,7 +24,7 @@
/// \file
/// Routines that initialize Mtl-based engine implementation
-#include "RenderDeviceFactoryMtl.h"
+#include "EngineFactoryMtl.h"
#include "RenderDeviceMtlImpl.h"
#include "DeviceContextMtlImpl.h"
#include "SwapChainMtlImpl.h"
@@ -44,10 +44,10 @@ public:
return &TheFactory;
}
- void CreateDeviceAndContextsMtl( const EngineMtlAttribs& EngineAttribs,
- IRenderDevice** ppDevice,
- IDeviceContext** ppContexts,
- Uint32 NumDeferredContexts )override final;
+ void CreateDeviceAndContextsMtl(const EngineMtlCreateInfo& EngineAttribs,
+ IRenderDevice** ppDevice,
+ IDeviceContext** ppContexts,
+ Uint32 NumDeferredContexts )override final;
void CreateSwapChainMtl( IRenderDevice* pDevice,
IDeviceContext* pImmediateContext,
@@ -55,11 +55,11 @@ public:
void* pView,
ISwapChain** ppSwapChain )override final;
- void AttachToMtlDevice(void* pMtlNativeDevice,
- const EngineMtlAttribs& EngineAttribs,
- IRenderDevice** ppDevice,
- IDeviceContext** ppContexts,
- Uint32 NumDeferredContexts)override final;
+ void AttachToMtlDevice(void* pMtlNativeDevice,
+ const EngineMtlCreateInfo& EngineAttribs,
+ IRenderDevice** ppDevice,
+ IDeviceContext** ppContexts,
+ Uint32 NumDeferredContexts)override final;
};
@@ -76,10 +76,10 @@ public:
/// of deferred contexts is requested, pointers to the
/// contexts are written to ppContexts array starting
/// at position 1
-void EngineFactoryMtlImpl::CreateDeviceAndContextsMtl( const EngineMtlAttribs& EngineAttribs,
- IRenderDevice** ppDevice,
- IDeviceContext** ppContexts,
- Uint32 NumDeferredContexts )
+void EngineFactoryMtlImpl::CreateDeviceAndContextsMtl(const EngineMtlCreateInfo& EngineAttribs,
+ IRenderDevice** ppDevice,
+ IDeviceContext** ppContexts,
+ Uint32 NumDeferredContexts )
{
if (EngineAttribs.DebugMessageCallback != nullptr)
SetDebugMessageCallback(EngineAttribs.DebugMessageCallback);
@@ -111,11 +111,11 @@ void EngineFactoryMtlImpl::CreateDeviceAndContextsMtl( const EngineMtlAttribs&
/// of deferred contexts is requested, pointers to the
/// contexts are written to ppContexts array starting
/// at position 1
-void EngineFactoryMtlImpl::AttachToMtlDevice(void* pMtlNativeDevice,
- const EngineMtlAttribs& EngineAttribs,
- IRenderDevice** ppDevice,
- IDeviceContext** ppContexts,
- Uint32 NumDeferredContexts)
+void EngineFactoryMtlImpl::AttachToMtlDevice(void* pMtlNativeDevice,
+ const EngineMtlCreateInfo& EngineAttribs,
+ IRenderDevice** ppDevice,
+ IDeviceContext** ppContexts,
+ Uint32 NumDeferredContexts)
{
if (EngineAttribs.DebugMessageCallback != nullptr)
SetDebugMessageCallback(EngineAttribs.DebugMessageCallback);
@@ -185,11 +185,11 @@ void EngineFactoryMtlImpl::AttachToMtlDevice(void* pMtlNativ
///
/// \param [out] ppSwapChain - Address of the memory location where pointer to the new
/// swap chain will be written
-void EngineFactoryMtlImpl::CreateSwapChainMtl( IRenderDevice* pDevice,
- IDeviceContext* pImmediateContext,
- const SwapChainDesc& SCDesc,
- void* pView,
- ISwapChain** ppSwapChain )
+void EngineFactoryMtlImpl::CreateSwapChainMtl(IRenderDevice* pDevice,
+ IDeviceContext* pImmediateContext,
+ const SwapChainDesc& SCDesc,
+ void* pView,
+ ISwapChain** ppSwapChain )
{
VERIFY( ppSwapChain, "Null pointer provided" );
if( !ppSwapChain )