rasterizer_interface.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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. #include "core/hw/gpu.h"
  7. struct ScreenInfo;
  8. namespace Pica {
  9. namespace Shader {
  10. struct OutputVertex;
  11. }
  12. }
  13. namespace VideoCore {
  14. class RasterizerInterface {
  15. public:
  16. virtual ~RasterizerInterface() {}
  17. /// Queues the primitive formed by the given vertices for rendering
  18. virtual void AddTriangle(const Pica::Shader::OutputVertex& v0,
  19. const Pica::Shader::OutputVertex& v1,
  20. const Pica::Shader::OutputVertex& v2) = 0;
  21. /// Draw the current batch of triangles
  22. virtual void DrawTriangles() = 0;
  23. /// Notify rasterizer that the specified PICA register has been changed
  24. virtual void NotifyPicaRegisterChanged(u32 id) = 0;
  25. /// Notify rasterizer that all caches should be flushed to 3DS memory
  26. virtual void FlushAll() = 0;
  27. /// Notify rasterizer that any caches of the specified region should be flushed to 3DS memory
  28. virtual void FlushRegion(PAddr addr, u32 size) = 0;
  29. /// Notify rasterizer that any caches of the specified region should be flushed to 3DS memory
  30. /// and invalidated
  31. virtual void FlushAndInvalidateRegion(PAddr addr, u32 size) = 0;
  32. /// Attempt to use a faster method to perform a display transfer with is_texture_copy = 0
  33. virtual bool AccelerateDisplayTransfer(const GPU::Regs::DisplayTransferConfig& config) {
  34. return false;
  35. }
  36. /// Attempt to use a faster method to perform a display transfer with is_texture_copy = 1
  37. virtual bool AccelerateTextureCopy(const GPU::Regs::DisplayTransferConfig& config) {
  38. return false;
  39. }
  40. /// Attempt to use a faster method to fill a region
  41. virtual bool AccelerateFill(const GPU::Regs::MemoryFillConfig& config) {
  42. return false;
  43. }
  44. /// Attempt to use a faster method to display the framebuffer to screen
  45. virtual bool AccelerateDisplay(const GPU::Regs::FramebufferConfig& config,
  46. PAddr framebuffer_addr, u32 pixel_stride,
  47. ScreenInfo& screen_info) {
  48. return false;
  49. }
  50. };
  51. }