mirror of
https://github.com/yuzu-emu/yuzu-android
synced 2024-12-28 10:51:21 -08:00
282adfc70b
Changes the GraphicsContext to be managed by the GPU core. This eliminates the need for the frontends to fool around with tricky MakeCurrent/DoneCurrent calls that are dependent on the settings (such as async gpu option). This also refactors out the need to use QWidget::fromWindowContainer as that caused issues with focus and input handling. Now we use a regular QWidget and just access the native windowHandle() directly. Another change is removing the debug tool setting in FrameMailbox. Instead of trying to block the frontend until a new frame is ready, the core will now take over presentation and draw directly to the window if the renderer detects that its hooked by NSight or RenderDoc Lastly, since it was in the way, I removed ScopeAcquireWindowContext and replaced it with a simple subclass in GraphicsContext that achieves the same result
45 lines
1.3 KiB
C++
45 lines
1.3 KiB
C++
// Copyright 2019 yuzu Emulator Project
|
|
// Licensed under GPLv2 or any later version
|
|
// Refer to the license.txt file included.
|
|
|
|
#pragma once
|
|
|
|
#include "video_core/gpu.h"
|
|
#include "video_core/gpu_thread.h"
|
|
|
|
namespace Core::Frontend {
|
|
class GraphicsContext;
|
|
}
|
|
|
|
namespace VideoCore {
|
|
class RendererBase;
|
|
} // namespace VideoCore
|
|
|
|
namespace VideoCommon {
|
|
|
|
/// Implementation of GPU interface that runs the GPU asynchronously
|
|
class GPUAsynch final : public Tegra::GPU {
|
|
public:
|
|
explicit GPUAsynch(Core::System& system, std::unique_ptr<VideoCore::RendererBase>&& renderer,
|
|
std::unique_ptr<Core::Frontend::GraphicsContext>&& context);
|
|
~GPUAsynch() override;
|
|
|
|
void Start() override;
|
|
void PushGPUEntries(Tegra::CommandList&& entries) override;
|
|
void SwapBuffers(const Tegra::FramebufferConfig* framebuffer) override;
|
|
void FlushRegion(CacheAddr addr, u64 size) override;
|
|
void InvalidateRegion(CacheAddr addr, u64 size) override;
|
|
void FlushAndInvalidateRegion(CacheAddr addr, u64 size) override;
|
|
void WaitIdle() const override;
|
|
|
|
protected:
|
|
void TriggerCpuInterrupt(u32 syncpoint_id, u32 value) const override;
|
|
|
|
private:
|
|
GPUThread::ThreadManager gpu_thread;
|
|
std::unique_ptr<Core::Frontend::GraphicsContext> cpu_context;
|
|
std::unique_ptr<Core::Frontend::GraphicsContext> gpu_context;
|
|
};
|
|
|
|
} // namespace VideoCommon
|