Fence.h 882 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. // Copyright (C) 2009-present, Panagiotis Christopoulos Charitos and contributors.
  2. // All rights reserved.
  3. // Code licensed under the BSD License.
  4. // http://www.anki3d.org/LICENSE
  5. #pragma once
  6. #include <AnKi/Gr/GrObject.h>
  7. namespace anki {
  8. /// @addtogroup graphics
  9. /// @{
  10. /// GPU fence.
  11. class Fence : public GrObject
  12. {
  13. ANKI_GR_OBJECT
  14. public:
  15. static constexpr GrObjectType kClassType = GrObjectType::kFence;
  16. /// Wait for the fence.
  17. /// @param seconds The time to wait in seconds. If it's zero then just return the status.
  18. /// @return True if is signaled (signaled == GPU work is done).
  19. Bool clientWait(Second seconds);
  20. protected:
  21. /// Construct.
  22. Fence(CString name)
  23. : GrObject(kClassType, name)
  24. {
  25. }
  26. /// Destroy.
  27. ~Fence()
  28. {
  29. }
  30. private:
  31. /// Allocate and initialize a new instance.
  32. [[nodiscard]] static Fence* newInstance();
  33. };
  34. /// @}
  35. } // end namespace anki