1// 2// Copyright 2019 The ANGLE Project Authors. All rights reserved. 3// Use of this source code is governed by a BSD-style license that can be 4// found in the LICENSE file. 5// 6// mtl_common.mm: 7// Implementation of mtl::Context, the MTLDevice container & error handler class. 8// 9 10#include "libANGLE/renderer/metal/mtl_common.h" 11 12#include <dispatch/dispatch.h> 13 14#include <cstring> 15 16#include "libANGLE/angletypes.h" 17#include "libANGLE/renderer/metal/DisplayMtl.h" 18 19namespace rx 20{ 21namespace mtl 22{ 23 24Context::Context(DisplayMtl *display) : mDisplay(display) {} 25 26id<MTLDevice> Context::getMetalDevice() const 27{ 28 return mDisplay->getMetalDevice(); 29} 30 31mtl::CommandQueue &Context::cmdQueue() 32{ 33 return mDisplay->cmdQueue(); 34} 35 36} // namespace mtl 37} // namespace rx