rasterizer_interface.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. // Copyright 2018 yuzu 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 "video_core/engines/fermi_2d.h"
  7. #include "video_core/gpu.h"
  8. #include "video_core/memory_manager.h"
  9. namespace VideoCore {
  10. class RasterizerInterface {
  11. public:
  12. virtual ~RasterizerInterface() {}
  13. /// Draw the current batch of vertex arrays
  14. virtual void DrawArrays() = 0;
  15. /// Clear the current framebuffer
  16. virtual void Clear() = 0;
  17. /// Notify rasterizer that all caches should be flushed to Switch memory
  18. virtual void FlushAll() = 0;
  19. /// Notify rasterizer that any caches of the specified region should be flushed to Switch memory
  20. virtual void FlushRegion(VAddr addr, u64 size) = 0;
  21. /// Notify rasterizer that any caches of the specified region should be invalidated
  22. virtual void InvalidateRegion(VAddr addr, u64 size) = 0;
  23. /// Notify rasterizer that any caches of the specified region should be flushed to Switch memory
  24. /// and invalidated
  25. virtual void FlushAndInvalidateRegion(VAddr addr, u64 size) = 0;
  26. /// Attempt to use a faster method to perform a surface copy
  27. virtual bool AccelerateSurfaceCopy(const Tegra::Engines::Fermi2D::Regs::Surface& src,
  28. const Tegra::Engines::Fermi2D::Regs::Surface& dst) {
  29. return false;
  30. }
  31. /// Attempt to use a faster method to fill a region
  32. virtual bool AccelerateFill(const void* config) {
  33. return false;
  34. }
  35. /// Attempt to use a faster method to display the framebuffer to screen
  36. virtual bool AccelerateDisplay(const Tegra::FramebufferConfig& config, VAddr framebuffer_addr,
  37. u32 pixel_stride) {
  38. return false;
  39. }
  40. virtual bool AccelerateDrawBatch(bool is_indexed) {
  41. return false;
  42. }
  43. /// Increase/decrease the number of object in pages touching the specified region
  44. virtual void UpdatePagesCachedCount(Tegra::GPUVAddr addr, u64 size, int delta) {}
  45. };
  46. } // namespace VideoCore