diff options
| author | Egor Yusov <egor.yusov@gmail.com> | 2018-12-30 03:43:06 +0000 |
|---|---|---|
| committer | Egor Yusov <egor.yusov@gmail.com> | 2018-12-30 03:43:06 +0000 |
| commit | 01a21a2369afa88b7a3f814428079ddaaae6f171 (patch) | |
| tree | c0b802dc18bd601924412d0c7074a68752f0372f /Tests/TestApp/src/TestApp.cpp | |
| parent | Updated core submodule (diff) | |
| download | DiligentEngine-01a21a2369afa88b7a3f814428079ddaaae6f171.tar.gz DiligentEngine-01a21a2369afa88b7a3f814428079ddaaae6f171.zip | |
Enabled Metal back-end stub
Diffstat (limited to 'Tests/TestApp/src/TestApp.cpp')
| -rw-r--r-- | Tests/TestApp/src/TestApp.cpp | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/Tests/TestApp/src/TestApp.cpp b/Tests/TestApp/src/TestApp.cpp index f0fbb08..ab84095 100644 --- a/Tests/TestApp/src/TestApp.cpp +++ b/Tests/TestApp/src/TestApp.cpp @@ -46,6 +46,10 @@ # include "RenderDeviceFactoryVk.h" #endif +#if METAL_SUPPORTED +# include "RenderDeviceFactoryMtl.h" +#endif + #include "FileSystem.h" #include "MapHelper.h" #include "RenderScriptTest.h" @@ -292,7 +296,7 @@ void TestApp::InitializeDiligentEngine( Features.imageCubeArray = true; Features.textureCompressionBC = true; Features.vertexPipelineStoresAndAtomics = true; - Features.fragmentStoresAndAtomics = true; + Features.fragmentStoresAndAtomics = true; ppContexts.resize(1 + NumDeferredCtx); auto *pFactoryVk = GetEngineFactoryVk(); @@ -303,6 +307,22 @@ void TestApp::InitializeDiligentEngine( } break; #endif + +#if METAL_SUPPORTED + case DeviceType::Metal: + { + EngineMtlAttribs MtlAttribs; + + ppContexts.resize(1 + NumDeferredCtx); + auto *pFactoryMtl = GetEngineFactoryMtl(); + pFactoryMtl->CreateDeviceAndContextsMtl(MtlAttribs, &m_pDevice, ppContexts.data(), NumDeferredCtx); + + if (!m_pSwapChain && NativeWindowHandle != nullptr) + pFactoryMtl->CreateSwapChainMtl(m_pDevice, ppContexts[0], SCDesc, NativeWindowHandle, &m_pSwapChain); + } + break; +#endif + default: LOG_ERROR_AND_THROW("Unknown device type"); break; |
