Browse Source
video_core: Eliminate the g_renderer global variable
video_core: Eliminate the g_renderer global variable
We move the initialization of the renderer to the core class, while keeping the creation of it and any other specifics in video_core. This way we can ensure that the renderer is initialized and doesn't give unfettered access to the renderer. This also makes dependencies on types more explicit. For example, the GPU class doesn't need to depend on the existence of a renderer, it only needs to care about whether or not it has a rasterizer, but since it was accessing the global variable, it was also making the renderer a part of its dependency chain. By adjusting the interface, we can get rid of this dependency.nce_cpp
19 changed files with 100 additions and 74 deletions
-
9src/core/core.cpp
-
22src/core/core.h
-
6src/core/hle/service/nvdrv/devices/nvdisp_disp0.cpp
-
11src/core/hle/service/nvdrv/devices/nvhost_as_gpu.cpp
-
6src/core/hle/service/nvflinger/nvflinger.cpp
-
18src/core/memory.cpp
-
6src/core/settings.cpp
-
10src/video_core/engines/maxwell_3d.cpp
-
8src/video_core/engines/maxwell_3d.h
-
5src/video_core/gpu.cpp
-
6src/video_core/gpu.h
-
4src/video_core/renderer_base.cpp
-
8src/video_core/renderer_base.h
-
2src/video_core/renderer_opengl/renderer_opengl.cpp
-
2src/video_core/renderer_opengl/renderer_opengl.h
-
25src/video_core/video_core.cpp
-
20src/video_core/video_core.h
-
4src/yuzu/main.cpp
-
2src/yuzu_cmd/yuzu.cpp
Write
Preview
Loading…
Cancel
Save
Reference in new issue