BsD3D11TimerQuery.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
  2. //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
  3. #pragma once
  4. #include "BsD3D11Prerequisites.h"
  5. #include "BsTimerQuery.h"
  6. namespace BansheeEngine
  7. {
  8. /**
  9. * @copydoc TimerQuery
  10. */
  11. class BS_D3D11_EXPORT D3D11TimerQuery : public TimerQuery
  12. {
  13. public:
  14. D3D11TimerQuery();
  15. ~D3D11TimerQuery();
  16. /**
  17. * @copydoc TimerQuery::begin
  18. */
  19. virtual void begin();
  20. /**
  21. * @copydoc TimerQuery::end
  22. */
  23. virtual void end();
  24. /**
  25. * @copydoc TimerQuery::isReady
  26. */
  27. virtual bool isReady() const;
  28. /**
  29. * @copydoc TimerQuery::getTimeMs
  30. */
  31. virtual float getTimeMs();
  32. private:
  33. /**
  34. * @brief Resolve timing information after the query has finished.
  35. */
  36. void finalize();
  37. bool mFinalized;
  38. bool mQueryEndCalled;
  39. float mTimeDelta;
  40. ID3D11Query* mBeginQuery;
  41. ID3D11Query* mEndQuery;
  42. ID3D11Query* mDisjointQuery;
  43. ID3D11DeviceContext* mContext;
  44. };
  45. }