|
@@ -6,14 +6,12 @@
|
|
|
#include "core/core.h"
|
|
#include "core/core.h"
|
|
|
#include "core/core_timing.h"
|
|
#include "core/core_timing.h"
|
|
|
#include "core/memory.h"
|
|
#include "core/memory.h"
|
|
|
-#include "core/settings.h"
|
|
|
|
|
#include "video_core/engines/fermi_2d.h"
|
|
#include "video_core/engines/fermi_2d.h"
|
|
|
#include "video_core/engines/kepler_compute.h"
|
|
#include "video_core/engines/kepler_compute.h"
|
|
|
#include "video_core/engines/kepler_memory.h"
|
|
#include "video_core/engines/kepler_memory.h"
|
|
|
#include "video_core/engines/maxwell_3d.h"
|
|
#include "video_core/engines/maxwell_3d.h"
|
|
|
#include "video_core/engines/maxwell_dma.h"
|
|
#include "video_core/engines/maxwell_dma.h"
|
|
|
#include "video_core/gpu.h"
|
|
#include "video_core/gpu.h"
|
|
|
-#include "video_core/gpu_thread.h"
|
|
|
|
|
#include "video_core/renderer_base.h"
|
|
#include "video_core/renderer_base.h"
|
|
|
|
|
|
|
|
namespace Tegra {
|
|
namespace Tegra {
|
|
@@ -39,10 +37,6 @@ GPU::GPU(Core::System& system, VideoCore::RendererBase& renderer) : renderer{ren
|
|
|
kepler_compute = std::make_unique<Engines::KeplerCompute>(*memory_manager);
|
|
kepler_compute = std::make_unique<Engines::KeplerCompute>(*memory_manager);
|
|
|
maxwell_dma = std::make_unique<Engines::MaxwellDMA>(system, rasterizer, *memory_manager);
|
|
maxwell_dma = std::make_unique<Engines::MaxwellDMA>(system, rasterizer, *memory_manager);
|
|
|
kepler_memory = std::make_unique<Engines::KeplerMemory>(system, rasterizer, *memory_manager);
|
|
kepler_memory = std::make_unique<Engines::KeplerMemory>(system, rasterizer, *memory_manager);
|
|
|
-
|
|
|
|
|
- if (Settings::values.use_asynchronous_gpu_emulation) {
|
|
|
|
|
- gpu_thread = std::make_unique<VideoCommon::GPUThread::ThreadManager>(renderer, *dma_pusher);
|
|
|
|
|
- }
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
GPU::~GPU() = default;
|
|
GPU::~GPU() = default;
|
|
@@ -71,48 +65,6 @@ const DmaPusher& GPU::DmaPusher() const {
|
|
|
return *dma_pusher;
|
|
return *dma_pusher;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-void GPU::PushGPUEntries(Tegra::CommandList&& entries) {
|
|
|
|
|
- if (Settings::values.use_asynchronous_gpu_emulation) {
|
|
|
|
|
- gpu_thread->SubmitList(std::move(entries));
|
|
|
|
|
- } else {
|
|
|
|
|
- dma_pusher->Push(std::move(entries));
|
|
|
|
|
- dma_pusher->DispatchCalls();
|
|
|
|
|
- }
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-void GPU::SwapBuffers(
|
|
|
|
|
- std::optional<std::reference_wrapper<const Tegra::FramebufferConfig>> framebuffer) {
|
|
|
|
|
- if (Settings::values.use_asynchronous_gpu_emulation) {
|
|
|
|
|
- gpu_thread->SwapBuffers(std::move(framebuffer));
|
|
|
|
|
- } else {
|
|
|
|
|
- renderer.SwapBuffers(std::move(framebuffer));
|
|
|
|
|
- }
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-void GPU::FlushRegion(VAddr addr, u64 size) {
|
|
|
|
|
- if (Settings::values.use_asynchronous_gpu_emulation) {
|
|
|
|
|
- gpu_thread->FlushRegion(addr, size);
|
|
|
|
|
- } else {
|
|
|
|
|
- renderer.Rasterizer().FlushRegion(addr, size);
|
|
|
|
|
- }
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-void GPU::InvalidateRegion(VAddr addr, u64 size) {
|
|
|
|
|
- if (Settings::values.use_asynchronous_gpu_emulation) {
|
|
|
|
|
- gpu_thread->InvalidateRegion(addr, size);
|
|
|
|
|
- } else {
|
|
|
|
|
- renderer.Rasterizer().InvalidateRegion(addr, size);
|
|
|
|
|
- }
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-void GPU::FlushAndInvalidateRegion(VAddr addr, u64 size) {
|
|
|
|
|
- if (Settings::values.use_asynchronous_gpu_emulation) {
|
|
|
|
|
- gpu_thread->FlushAndInvalidateRegion(addr, size);
|
|
|
|
|
- } else {
|
|
|
|
|
- renderer.Rasterizer().FlushAndInvalidateRegion(addr, size);
|
|
|
|
|
- }
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
u32 RenderTargetBytesPerPixel(RenderTargetFormat format) {
|
|
u32 RenderTargetBytesPerPixel(RenderTargetFormat format) {
|
|
|
ASSERT(format != RenderTargetFormat::NONE);
|
|
ASSERT(format != RenderTargetFormat::NONE);
|
|
|
|
|
|