rasterizer_interface.h 2.2 KB

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