gpu_asynch.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. // Copyright 2019 yuzu Emulator Project
  2. // Licensed under GPLv2 or any later version
  3. // Refer to the license.txt file included.
  4. #pragma once
  5. #include "video_core/gpu.h"
  6. #include "video_core/gpu_thread.h"
  7. namespace VideoCore {
  8. class RendererBase;
  9. } // namespace VideoCore
  10. namespace VideoCommon {
  11. /// Implementation of GPU interface that runs the GPU asynchronously
  12. class GPUAsynch final : public Tegra::GPU {
  13. public:
  14. explicit GPUAsynch(Core::System& system, VideoCore::RendererBase& renderer);
  15. ~GPUAsynch() override;
  16. void Start() override;
  17. void PushGPUEntries(Tegra::CommandList&& entries) override;
  18. void SwapBuffers(const Tegra::FramebufferConfig* framebuffer) override;
  19. void FlushRegion(CacheAddr addr, u64 size) override;
  20. void InvalidateRegion(CacheAddr addr, u64 size) override;
  21. void FlushAndInvalidateRegion(CacheAddr addr, u64 size) override;
  22. void WaitIdle() const override;
  23. protected:
  24. void TriggerCpuInterrupt(u32 syncpoint_id, u32 value) const override;
  25. private:
  26. GPUThread::ThreadManager gpu_thread;
  27. };
  28. } // namespace VideoCommon