From bc16f7f3cce7b3a689f45697d9f6fbd970993e32 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Mon, 20 Aug 2018 19:22:43 -0400 Subject: renderer_base: Make creation of the rasterizer, the responsibility of the renderers themselves Given we use a base-class type within the renderer for the rasterizer (RasterizerInterface), we want to allow renderers to perform more complex initialization if they need to do such a thing. This makes it important to reserve type information. Given the OpenGL renderer is quite simple settings-wise, this is just a simple shuffling of the initialization code. For something like Vulkan however this might involve doing something like: // Initialize and call rasterizer-specific function that requires // the full type of the instance created. auto raster = std::make_unique(some, params); raster->CallSomeVulkanRasterizerSpecificFunction(); // Assign to base class variable rasterizer = std::move(raster) --- src/video_core/renderer_opengl/renderer_opengl.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/video_core/renderer_opengl/renderer_opengl.h') diff --git a/src/video_core/renderer_opengl/renderer_opengl.h b/src/video_core/renderer_opengl/renderer_opengl.h index a5eab6997..6f048ed06 100644 --- a/src/video_core/renderer_opengl/renderer_opengl.h +++ b/src/video_core/renderer_opengl/renderer_opengl.h @@ -59,6 +59,8 @@ public: private: void InitOpenGLObjects(); + void CreateRasterizer(); + void ConfigureFramebufferTexture(TextureInfo& texture, const Tegra::FramebufferConfig& framebuffer); void DrawScreen(); -- cgit v1.2.3 From 46ef072cf9e0636f7ba9f1414fdabeb607a88e0f Mon Sep 17 00:00:00 2001 From: Lioncash Date: Mon, 20 Aug 2018 19:34:02 -0400 Subject: rasterizer_interface: Remove ScreenInfo from AccelerateDraw()'s signature This is an OpenGL renderer-specific data type. Given that, this type shouldn't be used within the base interface for the rasterizer. Instead, we can pass this information to the rasterizer via reference. --- src/video_core/renderer_opengl/renderer_opengl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/video_core/renderer_opengl/renderer_opengl.h') diff --git a/src/video_core/renderer_opengl/renderer_opengl.h b/src/video_core/renderer_opengl/renderer_opengl.h index 6f048ed06..7ae103f04 100644 --- a/src/video_core/renderer_opengl/renderer_opengl.h +++ b/src/video_core/renderer_opengl/renderer_opengl.h @@ -68,7 +68,7 @@ private: void UpdateFramerate(); // Loads framebuffer from emulated memory into the display information structure - void LoadFBToScreenInfo(const Tegra::FramebufferConfig& framebuffer, ScreenInfo& screen_info); + void LoadFBToScreenInfo(const Tegra::FramebufferConfig& framebuffer); // Fills active OpenGL texture with the given RGBA color. void LoadColorToActiveGLTexture(u8 color_r, u8 color_g, u8 color_b, u8 color_a, const TextureInfo& texture); -- cgit v1.2.3