mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-21 20:42:44 +02:00
gpu takes reference on singletons
This commit is contained in:
parent
f62f6e8b54
commit
87d29bdeb3
@ -76,6 +76,8 @@ enum {
|
||||
LibnxError_DomainMessageTooManyObjectIds,
|
||||
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