rasterizer_interface.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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/gpu.h"
  7. struct ScreenInfo;
  8. namespace VideoCore {
  9. class RasterizerInterface {
  10. public:
  11. virtual ~RasterizerInterface() {}
  12. /// Draw the current batch of vertex arrays
  13. virtual void DrawArrays() = 0;
  14. /// Notify rasterizer that the specified Maxwell register has been changed
  15. virtual void NotifyMaxwellRegisterChanged(u32 id) = 0;
  16. /// Notify rasterizer that all caches should be flushed to Switch memory
  17. virtual void FlushAll() = 0;
  18. /// Notify rasterizer that any caches of the specified region should be flushed to Switch memory
  19. virtual void FlushRegion(VAddr addr, u64 size) = 0;
  20. /// Notify rasterizer that any caches of the specified region should be invalidated
  21. virtual void InvalidateRegion(VAddr addr, u64 size) = 0;
  22. /// Notify rasterizer that any caches of the specified region should be flushed to Switch memory
  23. /// and invalidated
  24. virtual void FlushAndInvalidateRegion(VAddr addr, u64 size) = 0;
  25. /// Attempt to use a faster method to perform a display transfer with is_texture_copy = 0
  26. virtual bool AccelerateDisplayTransfer(const void* config) {
  27. return false;
  28. }
  29. /// Attempt to use a faster method to perform a display transfer with is_texture_copy = 1
  30. virtual bool AccelerateTextureCopy(const void* config) {
  31. return false;
  32. }
  33. /// Attempt to use a faster method to fill a region
  34. virtual bool AccelerateFill(const void* config) {
  35. return false;
  36. }
  37. /// Attempt to use a faster method to display the framebuffer to screen
  38. virtual bool AccelerateDisplay(const Tegra::FramebufferConfig& framebuffer,
  39. VAddr framebuffer_addr, u32 pixel_stride,
  40. ScreenInfo& screen_info) {
  41. return false;
  42. }
  43. virtual bool AccelerateDrawBatch(bool is_indexed) {
  44. return false;
  45. }
  46. };
  47. } // namespace VideoCore