summaryrefslogtreecommitdiff
path: root/src/video_core/gpu.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/video_core/gpu.cpp')
-rw-r--r--src/video_core/gpu.cpp27
1 files changed, 2 insertions, 25 deletions
diff --git a/src/video_core/gpu.cpp b/src/video_core/gpu.cpp
index 1097db08a..e05c9a357 100644
--- a/src/video_core/gpu.cpp
+++ b/src/video_core/gpu.cpp
@@ -83,19 +83,11 @@ struct GPU::Impl {
83 UNIMPLEMENTED(); 83 UNIMPLEMENTED();
84 } 84 }
85 85
86 void CreateHost1xChannel() {
87 if (host1x_channel) {
88 return;
89 }
90 host1x_channel = CreateChannel(0);
91 host1x_channel->memory_manager = std::make_shared<Tegra::MemoryManager>(system);
92 InitChannel(*host1x_channel);
93 }
94
95 /// Binds a renderer to the GPU. 86 /// Binds a renderer to the GPU.
96 void BindRenderer(std::unique_ptr<VideoCore::RendererBase> renderer_) { 87 void BindRenderer(std::unique_ptr<VideoCore::RendererBase> renderer_) {
97 renderer = std::move(renderer_); 88 renderer = std::move(renderer_);
98 rasterizer = renderer->ReadRasterizer(); 89 rasterizer = renderer->ReadRasterizer();
90 host1x.MemoryManager().BindRasterizer(rasterizer);
99 } 91 }
100 92
101 /// Flush all current written commands into the host GPU for execution. 93 /// Flush all current written commands into the host GPU for execution.
@@ -173,12 +165,6 @@ struct GPU::Impl {
173 return *current_channel->kepler_compute; 165 return *current_channel->kepler_compute;
174 } 166 }
175 167
176 /// Returns a reference to the GPU memory manager.
177 [[nodiscard]] Tegra::MemoryManager& MemoryManager() {
178 CreateHost1xChannel();
179 return *host1x_channel->memory_manager;
180 }
181
182 /// Returns a reference to the GPU DMA pusher. 168 /// Returns a reference to the GPU DMA pusher.
183 [[nodiscard]] Tegra::DmaPusher& DmaPusher() { 169 [[nodiscard]] Tegra::DmaPusher& DmaPusher() {
184 ASSERT(current_channel); 170 ASSERT(current_channel);
@@ -299,7 +285,7 @@ struct GPU::Impl {
299 } 285 }
300 286
301 if (!cdma_pushers.contains(id)) { 287 if (!cdma_pushers.contains(id)) {
302 cdma_pushers.insert_or_assign(id, std::make_unique<Tegra::CDmaPusher>(gpu)); 288 cdma_pushers.insert_or_assign(id, std::make_unique<Tegra::CDmaPusher>(host1x));
303 } 289 }
304 290
305 // SubmitCommandBuffer would make the nvdec operations async, this is not currently working 291 // SubmitCommandBuffer would make the nvdec operations async, this is not currently working
@@ -389,7 +375,6 @@ struct GPU::Impl {
389 VideoCore::RasterizerInterface* rasterizer = nullptr; 375 VideoCore::RasterizerInterface* rasterizer = nullptr;
390 const bool use_nvdec; 376 const bool use_nvdec;
391 377
392 std::shared_ptr<Control::ChannelState> host1x_channel;
393 s32 new_channel_id{1}; 378 s32 new_channel_id{1};
394 /// Shader build notifier 379 /// Shader build notifier
395 std::unique_ptr<VideoCore::ShaderNotify> shader_notify; 380 std::unique_ptr<VideoCore::ShaderNotify> shader_notify;
@@ -510,14 +495,6 @@ const Engines::KeplerCompute& GPU::KeplerCompute() const {
510 return impl->KeplerCompute(); 495 return impl->KeplerCompute();
511} 496}
512 497
513Tegra::MemoryManager& GPU::MemoryManager() {
514 return impl->MemoryManager();
515}
516
517const Tegra::MemoryManager& GPU::MemoryManager() const {
518 return impl->MemoryManager();
519}
520
521Tegra::DmaPusher& GPU::DmaPusher() { 498Tegra::DmaPusher& GPU::DmaPusher() {
522 return impl->DmaPusher(); 499 return impl->DmaPusher();
523} 500}