mirror of
https://github.com/switchbrew/libnx.git
synced 2025-07-03 18:12:14 +02:00
gpu takes reference on singletons
This commit is contained in:
parent
7045f37cc9
commit
cb6cfca6c7
@ -74,6 +74,8 @@ enum {
|
||||
LibnxError_TooManyDevOpTabs,
|
||||
LibnxError_AppletFailedToInitialize,
|
||||
LibnxError_ApmFailedToInitialize,
|
||||
LibnxError_NvinfoFailedToInitialize,
|
||||
LibnxError_NvbufFailedToInitialize,
|
||||
};
|
||||
|
||||
/// libnx nvidia error codes
|
||||
|
@ -4,6 +4,12 @@ Result nvgpuCreate(NvGpu* g)
|
||||
{
|
||||
Result rc;
|
||||
|
||||
if (R_FAILED(nvinfoInit()))
|
||||
return MAKERESULT(Module_Libnx, LibnxError_NvinfoFailedToInitialize);
|
||||
|
||||
if (R_FAILED(nvbufInit()))
|
||||
return MAKERESULT(Module_Libnx, LibnxError_NvbufFailedToInitialize);
|
||||
|
||||
rc = nvchannelCreate(&g->gpu_channel, "/dev/nvhost-gpu");
|
||||
|
||||
if (R_SUCCEEDED(rc))
|
||||
@ -29,6 +35,9 @@ Result nvgpuCreate(NvGpu* g)
|
||||
|
||||
void nvgpuClose(NvGpu* g)
|
||||
{
|
||||
nvbufExit();
|
||||
nvinfoExit();
|
||||
|
||||
nvfifoClose(&g->gpfifo);
|
||||
nvasClose(&g->addr_space);
|
||||
nvchannelClose(&g->gpu_channel);
|
||||
|
Loading…
Reference in New Issue
Block a user