PipelineQuery.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. /// @memberof PipelineQuery.
  11. class PipelineQueryInitInfo : public GrBaseInitInfo
  12. {
  13. public:
  14. PipelineQueryType m_type = PipelineQueryType::kCount;
  15. using GrBaseInitInfo::GrBaseInitInfo;
  16. };
  17. /// Query of various pipeline statistics.
  18. class PipelineQuery : public GrObject
  19. {
  20. ANKI_GR_OBJECT
  21. public:
  22. static constexpr GrObjectType kClassType = GrObjectType::kPipelineQuery;
  23. /// Get the occlusion query result. It won't block.
  24. PipelineQueryResult getResult(U64& value) const;
  25. protected:
  26. /// Construct.
  27. PipelineQuery(CString name)
  28. : GrObject(kClassType, name)
  29. {
  30. }
  31. /// Destroy.
  32. ~PipelineQuery()
  33. {
  34. }
  35. private:
  36. /// Allocate and initialize a new instance.
  37. [[nodiscard]] static PipelineQuery* newInstance(const PipelineQueryInitInfo& inf);
  38. };
  39. /// @}
  40. } // end namespace anki