gpu_synch.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. namespace Core::Frontend {
  7. class GraphicsContext;
  8. }
  9. namespace VideoCore {
  10. class RendererBase;
  11. } // namespace VideoCore
  12. namespace VideoCommon {
  13. /// Implementation of GPU interface that runs the GPU synchronously
  14. class GPUSynch final : public Tegra::GPU {
  15. public:
  16. explicit GPUSynch(Core::System& system_, bool use_nvdec_);
  17. ~GPUSynch() override;
  18. void Start() override;
  19. void ObtainContext() override;
  20. void ReleaseContext() override;
  21. void PushGPUEntries(Tegra::CommandList&& entries) override;
  22. void PushCommandBuffer(Tegra::ChCommandHeaderList& entries) override;
  23. void SwapBuffers(const Tegra::FramebufferConfig* framebuffer) override;
  24. void FlushRegion(VAddr addr, u64 size) override;
  25. void InvalidateRegion(VAddr addr, u64 size) override;
  26. void FlushAndInvalidateRegion(VAddr addr, u64 size) override;
  27. void WaitIdle() const override {}
  28. protected:
  29. void TriggerCpuInterrupt([[maybe_unused]] u32 syncpoint_id,
  30. [[maybe_unused]] u32 value) const override {}
  31. };
  32. } // namespace VideoCommon