graphics_renderer_report.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #pragma once
  2. namespace sunrise::client::hooks::graphics::renderer::report {
  3. /** Stage of the presentation stack that produced an outcome. */
  4. enum class Stage : unsigned {
  5. none,
  6. acquire,
  7. target,
  8. init,
  9. frame,
  10. shutdown,
  11. };
  12. /** Why a stage ended the way it did. Ordered by the step that produces it. */
  13. enum class Reason : unsigned {
  14. none,
  15. // acquire
  16. window,
  17. windowThread,
  18. windowClass,
  19. description,
  20. device,
  21. context,
  22. deviceRemoved,
  23. // target
  24. backBuffer,
  25. view,
  26. viewFormat,
  27. // init
  28. layout,
  29. win32Backend,
  30. dx11Backend,
  31. windowInput,
  32. // frame
  33. fontScale,
  34. // shutdown
  35. deviceLost,
  36. rebuildTarget,
  37. surfaceLost,
  38. };
  39. /**
  40. * Writes one outcome the first time its reason comes up. Present calls this every frame.
  41. * Reasons are unique across stages, so one bit per reason is enough.
  42. */
  43. void note(Stage stage, Reason reason) noexcept;
  44. /** Records that the stack is active, so a later failure is written again. */
  45. void note_active() noexcept;
  46. } // namespace sunrise::client::hooks::graphics::renderer::report