1 // Copyright 2019 The ANGLE Project Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 // 5 // SemaphoreVk.h: Defines the class interface for SemaphoreVk, 6 // implementing SemaphoreImpl. 7 8 #ifndef LIBANGLE_RENDERER_VULKAN_SEMAPHOREVK_H_ 9 #define LIBANGLE_RENDERER_VULKAN_SEMAPHOREVK_H_ 10 11 #include "libANGLE/renderer/SemaphoreImpl.h" 12 #include "libANGLE/renderer/vulkan/vk_helpers.h" 13 #include "libANGLE/renderer/vulkan/vk_wrapper.h" 14 15 namespace rx 16 { 17 18 class SemaphoreVk : public SemaphoreImpl 19 { 20 public: 21 SemaphoreVk(); 22 ~SemaphoreVk() override; 23 24 void onDestroy(const gl::Context *context) override; 25 26 angle::Result importFd(gl::Context *context, gl::HandleType handleType, GLint fd) override; 27 28 angle::Result importZirconHandle(gl::Context *context, 29 gl::HandleType handleType, 30 GLuint handle) override; 31 32 angle::Result wait(gl::Context *context, 33 const gl::BufferBarrierVector &bufferBarriers, 34 const gl::TextureBarrierVector &textureBarriers) override; 35 36 angle::Result signal(gl::Context *context, 37 const gl::BufferBarrierVector &bufferBarriers, 38 const gl::TextureBarrierVector &textureBarriers) override; 39 40 private: 41 angle::Result importOpaqueFd(ContextVk *contextVk, GLint fd); 42 angle::Result importZirconEvent(ContextVk *contextVk, GLuint handle); 43 44 vk::Semaphore mSemaphore; 45 }; 46 47 } // namespace rx 48 49 #endif // LIBANGLE_RENDERER_VULKAN_SEMAPHOREVK_H_ 50