|
|
@ -185,16 +185,6 @@ struct GPU::Impl {
|
|
|
|
return *dma_pusher;
|
|
|
|
return *dma_pusher;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// Returns a reference to the GPU CDMA pusher.
|
|
|
|
|
|
|
|
[[nodiscard]] Tegra::CDmaPusher& CDmaPusher() {
|
|
|
|
|
|
|
|
return *cdma_pusher;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// Returns a const reference to the GPU CDMA pusher.
|
|
|
|
|
|
|
|
[[nodiscard]] const Tegra::CDmaPusher& CDmaPusher() const {
|
|
|
|
|
|
|
|
return *cdma_pusher;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// Returns a reference to the underlying renderer.
|
|
|
|
/// Returns a reference to the underlying renderer.
|
|
|
|
[[nodiscard]] VideoCore::RendererBase& Renderer() {
|
|
|
|
[[nodiscard]] VideoCore::RendererBase& Renderer() {
|
|
|
|
return *renderer;
|
|
|
|
return *renderer;
|
|
|
@ -338,25 +328,26 @@ struct GPU::Impl {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// Push GPU command buffer entries to be processed
|
|
|
|
/// Push GPU command buffer entries to be processed
|
|
|
|
void PushCommandBuffer(Tegra::ChCommandHeaderList& entries) {
|
|
|
|
void PushCommandBuffer(u32 id, Tegra::ChCommandHeaderList& entries) {
|
|
|
|
if (!use_nvdec) {
|
|
|
|
if (!use_nvdec) {
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!cdma_pusher) {
|
|
|
|
if (cdma_pushers.find(id) == cdma_pushers.end()) {
|
|
|
|
cdma_pusher = std::make_unique<Tegra::CDmaPusher>(gpu);
|
|
|
|
cdma_pushers[id] = std::make_unique<Tegra::CDmaPusher>(gpu);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// SubmitCommandBuffer would make the nvdec operations async, this is not currently working
|
|
|
|
// SubmitCommandBuffer would make the nvdec operations async, this is not currently working
|
|
|
|
// TODO(ameerj): RE proper async nvdec operation
|
|
|
|
// TODO(ameerj): RE proper async nvdec operation
|
|
|
|
// gpu_thread.SubmitCommandBuffer(std::move(entries));
|
|
|
|
// gpu_thread.SubmitCommandBuffer(std::move(entries));
|
|
|
|
|
|
|
|
cdma_pushers[id]->ProcessEntries(std::move(entries));
|
|
|
|
cdma_pusher->ProcessEntries(std::move(entries));
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// Frees the CDMAPusher instance to free up resources
|
|
|
|
/// Frees the CDMAPusher instance to free up resources
|
|
|
|
void ClearCdmaInstance() {
|
|
|
|
void ClearCdmaInstance(u32 id) {
|
|
|
|
cdma_pusher.reset();
|
|
|
|
if (cdma_pushers.find(id) != cdma_pushers.end()) {
|
|
|
|
|
|
|
|
cdma_pushers.erase(id);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// Swap buffers (render frame)
|
|
|
|
/// Swap buffers (render frame)
|
|
|
@ -659,7 +650,7 @@ struct GPU::Impl {
|
|
|
|
Core::System& system;
|
|
|
|
Core::System& system;
|
|
|
|
std::unique_ptr<Tegra::MemoryManager> memory_manager;
|
|
|
|
std::unique_ptr<Tegra::MemoryManager> memory_manager;
|
|
|
|
std::unique_ptr<Tegra::DmaPusher> dma_pusher;
|
|
|
|
std::unique_ptr<Tegra::DmaPusher> dma_pusher;
|
|
|
|
std::unique_ptr<Tegra::CDmaPusher> cdma_pusher;
|
|
|
|
std::map<u32, std::unique_ptr<Tegra::CDmaPusher>> cdma_pushers;
|
|
|
|
std::unique_ptr<VideoCore::RendererBase> renderer;
|
|
|
|
std::unique_ptr<VideoCore::RendererBase> renderer;
|
|
|
|
VideoCore::RasterizerInterface* rasterizer = nullptr;
|
|
|
|
VideoCore::RasterizerInterface* rasterizer = nullptr;
|
|
|
|
const bool use_nvdec;
|
|
|
|
const bool use_nvdec;
|
|
|
@ -811,14 +802,6 @@ const Tegra::DmaPusher& GPU::DmaPusher() const {
|
|
|
|
return impl->DmaPusher();
|
|
|
|
return impl->DmaPusher();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Tegra::CDmaPusher& GPU::CDmaPusher() {
|
|
|
|
|
|
|
|
return impl->CDmaPusher();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const Tegra::CDmaPusher& GPU::CDmaPusher() const {
|
|
|
|
|
|
|
|
return impl->CDmaPusher();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
VideoCore::RendererBase& GPU::Renderer() {
|
|
|
|
VideoCore::RendererBase& GPU::Renderer() {
|
|
|
|
return impl->Renderer();
|
|
|
|
return impl->Renderer();
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -887,12 +870,12 @@ void GPU::PushGPUEntries(Tegra::CommandList&& entries) {
|
|
|
|
impl->PushGPUEntries(std::move(entries));
|
|
|
|
impl->PushGPUEntries(std::move(entries));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void GPU::PushCommandBuffer(Tegra::ChCommandHeaderList& entries) {
|
|
|
|
void GPU::PushCommandBuffer(u32 id, Tegra::ChCommandHeaderList& entries) {
|
|
|
|
impl->PushCommandBuffer(entries);
|
|
|
|
impl->PushCommandBuffer(id, entries);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void GPU::ClearCdmaInstance() {
|
|
|
|
void GPU::ClearCdmaInstance(u32 id) {
|
|
|
|
impl->ClearCdmaInstance();
|
|
|
|
impl->ClearCdmaInstance(id);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void GPU::SwapBuffers(const Tegra::FramebufferConfig* framebuffer) {
|
|
|
|
void GPU::SwapBuffers(const Tegra::FramebufferConfig* framebuffer) {
|
|
|
|