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 // SempahoreGL.h: Defines the rx::SempahoreGL class, an implementation of SemaphoreImpl. 7 8 #ifndef LIBANGLE_RENDERER_GL_SEMAPHOREGL_H_ 9 #define LIBANGLE_RENDERER_GL_SEMAPHOREGL_H_ 10 11 #include "libANGLE/angletypes.h" 12 #include "libANGLE/renderer/SemaphoreImpl.h" 13 14 namespace rx 15 { 16 class SemaphoreGL : public SemaphoreImpl 17 { 18 public: 19 SemaphoreGL(GLuint semaphoreID); 20 ~SemaphoreGL() override; 21 22 void onDestroy(const gl::Context *context) override; 23 24 angle::Result importFd(gl::Context *context, gl::HandleType handleType, GLint fd) override; 25 26 angle::Result importZirconHandle(gl::Context *context, 27 gl::HandleType handleType, 28 GLuint handle) override; 29 30 angle::Result wait(gl::Context *context, 31 const gl::BufferBarrierVector &bufferBarriers, 32 const gl::TextureBarrierVector &textureBarriers) override; 33 34 angle::Result signal(gl::Context *context, 35 const gl::BufferBarrierVector &bufferBarriers, 36 const gl::TextureBarrierVector &textureBarriers) override; 37 38 GLuint getSemaphoreID() const; 39 40 private: 41 GLuint mSemaphoreID; 42 }; 43 } // namespace rx 44 45 #endif // LIBANGLE_RENDERER_GL_SEMAPHOREGL_H_ 46