Fence.h 923 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. // Copyright (C) 2009-2021, 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. {
  9. /// @addtogroup graphics
  10. /// @{
  11. /// GPU fence.
  12. class Fence : public GrObject
  13. {
  14. ANKI_GR_OBJECT
  15. public:
  16. static const GrObjectType CLASS_TYPE = GrObjectType::FENCE;
  17. /// Wait for the fence.
  18. /// @param seconds The time to wait in seconds. If it's zero then just return the status.
  19. /// @return True if is signaled (signaled == GPU work is done).
  20. Bool clientWait(Second seconds);
  21. protected:
  22. /// Construct.
  23. Fence(GrManager* manager, CString name)
  24. : GrObject(manager, CLASS_TYPE, name)
  25. {
  26. }
  27. /// Destroy.
  28. ~Fence()
  29. {
  30. }
  31. private:
  32. /// Allocate and initialize a new instance.
  33. static ANKI_USE_RESULT Fence* newInstance(GrManager* manager);
  34. };
  35. /// @}
  36. } // end namespace anki