gpu_asynch.cpp 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. // Copyright 2019 yuzu Emulator Project
  2. // Licensed under GPLv2 or any later version
  3. // Refer to the license.txt file included.
  4. #include "core/core.h"
  5. #include "core/hardware_interrupt_manager.h"
  6. #include "video_core/gpu_asynch.h"
  7. #include "video_core/gpu_thread.h"
  8. #include "video_core/renderer_base.h"
  9. namespace VideoCommon {
  10. GPUAsynch::GPUAsynch(Core::System& system, VideoCore::RendererBase& renderer)
  11. : GPU(system, renderer, true), gpu_thread{system} {}
  12. GPUAsynch::~GPUAsynch() = default;
  13. void GPUAsynch::Start() {
  14. gpu_thread.StartThread(renderer, *dma_pusher);
  15. }
  16. void GPUAsynch::PushGPUEntries(Tegra::CommandList&& entries) {
  17. gpu_thread.SubmitList(std::move(entries));
  18. }
  19. void GPUAsynch::SwapBuffers(
  20. std::optional<std::reference_wrapper<const Tegra::FramebufferConfig>> framebuffer) {
  21. gpu_thread.SwapBuffers(std::move(framebuffer));
  22. }
  23. void GPUAsynch::FlushRegion(CacheAddr addr, u64 size) {
  24. gpu_thread.FlushRegion(addr, size);
  25. }
  26. void GPUAsynch::InvalidateRegion(CacheAddr addr, u64 size) {
  27. gpu_thread.InvalidateRegion(addr, size);
  28. }
  29. void GPUAsynch::FlushAndInvalidateRegion(CacheAddr addr, u64 size) {
  30. gpu_thread.FlushAndInvalidateRegion(addr, size);
  31. }
  32. void GPUAsynch::TriggerCpuInterrupt(const u32 syncpoint_id, const u32 value) const {
  33. auto& interrupt_manager = system.InterruptManager();
  34. interrupt_manager.GPUInterruptSyncpt(syncpoint_id, value);
  35. }
  36. } // namespace VideoCommon