hwrasterizer_base.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. // Copyright 2015 Citra Emulator Project
  2. // Licensed under GPLv2 or any later version
  3. // Refer to the license.txt file included.
  4. #pragma once
  5. #include "common/common_types.h"
  6. namespace Pica {
  7. namespace VertexShader {
  8. struct OutputVertex;
  9. }
  10. }
  11. class HWRasterizer {
  12. public:
  13. virtual ~HWRasterizer() {
  14. }
  15. /// Initialize API-specific GPU objects
  16. virtual void InitObjects() = 0;
  17. /// Reset the rasterizer, such as flushing all caches and updating all state
  18. virtual void Reset() = 0;
  19. /// Queues the primitive formed by the given vertices for rendering
  20. virtual void AddTriangle(const Pica::VertexShader::OutputVertex& v0,
  21. const Pica::VertexShader::OutputVertex& v1,
  22. const Pica::VertexShader::OutputVertex& v2) = 0;
  23. /// Draw the current batch of triangles
  24. virtual void DrawTriangles() = 0;
  25. /// Commit the rasterizer's framebuffer contents immediately to the current 3DS memory framebuffer
  26. virtual void CommitFramebuffer() = 0;
  27. /// Notify rasterizer that the specified PICA register has been changed
  28. virtual void NotifyPicaRegisterChanged(u32 id) = 0;
  29. /// Notify rasterizer that the specified 3DS memory region will be read from after this notification
  30. virtual void NotifyPreRead(PAddr addr, u32 size) = 0;
  31. /// Notify rasterizer that a 3DS memory region has been changed
  32. virtual void NotifyFlush(PAddr addr, u32 size) = 0;
  33. };