1 // Copyright 2018 The SwiftShader Authors. All Rights Reserved. 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 #ifndef VK_SEMAPHORE_HPP_ 16 #define VK_SEMAPHORE_HPP_ 17 18 #include "VkObject.hpp" 19 20 namespace vk 21 { 22 23 class Semaphore : public Object<Semaphore, VkSemaphore> 24 { 25 public: Semaphore(const VkSemaphoreCreateInfo * pCreateInfo,void * mem)26 Semaphore(const VkSemaphoreCreateInfo* pCreateInfo, void* mem) {} 27 28 ~Semaphore() = delete; 29 ComputeRequiredAllocationSize(const VkSemaphoreCreateInfo * pCreateInfo)30 static size_t ComputeRequiredAllocationSize(const VkSemaphoreCreateInfo* pCreateInfo) 31 { 32 return 0; 33 } 34 wait()35 void wait() 36 { 37 // Semaphores are noop for now 38 } 39 wait(const VkPipelineStageFlags & flag)40 void wait(const VkPipelineStageFlags& flag) 41 { 42 // VkPipelineStageFlags is the pipeline stage at which the semaphore wait will occur 43 44 // Semaphores are noop for now 45 } 46 signal()47 void signal() 48 { 49 // Semaphores are noop for now 50 } 51 52 private: 53 }; 54 Cast(VkSemaphore object)55static inline Semaphore* Cast(VkSemaphore object) 56 { 57 return reinterpret_cast<Semaphore*>(object); 58 } 59 60 } // namespace vk 61 62 #endif // VK_SEMAPHORE_HPP_ 63