mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2025-10-20 19:57:50 +00:00
nvdrv: Get rid of global std::weak_ptr
Rather than use global state, we can simply pass the instance into the NVFlinger instance directly.
This commit is contained in:
parent
78f6dc04ef
commit
e8824d065b
5 changed files with 22 additions and 11 deletions
|
@ -16,6 +16,10 @@ namespace CoreTiming {
|
|||
struct EventType;
|
||||
}
|
||||
|
||||
namespace Service::Nvidia {
|
||||
class Module;
|
||||
}
|
||||
|
||||
namespace Service::NVFlinger {
|
||||
|
||||
class BufferQueue;
|
||||
|
@ -44,6 +48,9 @@ public:
|
|||
NVFlinger();
|
||||
~NVFlinger();
|
||||
|
||||
/// Sets the NVDrv module instance to use to send buffers to the GPU.
|
||||
void SetNVDrvInstance(std::shared_ptr<Nvidia::Module> instance);
|
||||
|
||||
/// Opens the specified display and returns the id.
|
||||
u64 OpenDisplay(std::string_view name);
|
||||
|
||||
|
@ -70,6 +77,8 @@ private:
|
|||
/// Returns the layer identified by the specified id in the desired display.
|
||||
Layer& GetLayer(u64 display_id, u64 layer_id);
|
||||
|
||||
std::shared_ptr<Nvidia::Module> nvdrv;
|
||||
|
||||
std::vector<Display> displays;
|
||||
std::vector<std::shared_ptr<BufferQueue>> buffer_queues;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue