From 80de01a5b4a7f57ec7850079fbd38fac76b9d08f Mon Sep 17 00:00:00 2001 From: Liam Date: Wed, 3 Jan 2024 22:46:59 -0500 Subject: video_core: simplify accelerated surface fetch and crop handling between APIs --- src/video_core/renderer_opengl/renderer_opengl.h | 32 ++++++++---------------- 1 file changed, 10 insertions(+), 22 deletions(-) (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 18699610a..cde8c5702 100644 --- a/src/video_core/renderer_opengl/renderer_opengl.h +++ b/src/video_core/renderer_opengl/renderer_opengl.h @@ -50,11 +50,10 @@ struct TextureInfo { }; /// Structure used for storing information about the display target for the Switch screen -struct ScreenInfo { +struct FramebufferTextureInfo { GLuint display_texture{}; - bool was_accelerated = false; - const Common::Rectangle display_texcoords{0.0f, 0.0f, 1.0f, 1.0f}; - TextureInfo texture; + u32 width; + u32 height; }; class RendererOpenGL final : public VideoCore::RendererBase { @@ -81,23 +80,18 @@ private: void AddTelemetryFields(); - void ConfigureFramebufferTexture(TextureInfo& texture, - const Tegra::FramebufferConfig& framebuffer); + void ConfigureFramebufferTexture(const Tegra::FramebufferConfig& framebuffer); /// Draws the emulated screens to the emulator window. - void DrawScreen(const Layout::FramebufferLayout& layout); + void DrawScreen(const Tegra::FramebufferConfig& framebuffer, + const Layout::FramebufferLayout& layout); - void RenderScreenshot(); + void RenderScreenshot(const Tegra::FramebufferConfig& framebuffer); /// Loads framebuffer from emulated memory into the active OpenGL texture. - void LoadFBToScreenInfo(const Tegra::FramebufferConfig& framebuffer); + FramebufferTextureInfo LoadFBToScreenInfo(const Tegra::FramebufferConfig& framebuffer); - /// Fills active OpenGL texture with the given RGB color.Since the color is solid, the texture - /// can be 1x1 but will stretch across whatever it's rendered on. - void LoadColorToActiveGLTexture(u8 color_r, u8 color_g, u8 color_b, u8 color_a, - const TextureInfo& texture); - - void PrepareRendertarget(const Tegra::FramebufferConfig* framebuffer); + FramebufferTextureInfo PrepareRenderTarget(const Tegra::FramebufferConfig& framebuffer); Core::TelemetrySession& telemetry_session; Core::Frontend::EmuWindow& emu_window; @@ -126,7 +120,7 @@ private: GLuint64EXT vertex_buffer_address = 0; /// Display information for Switch screen - ScreenInfo screen_info; + TextureInfo framebuffer_texture; OGLTexture aa_texture; OGLFramebuffer aa_framebuffer; @@ -145,12 +139,6 @@ private: /// OpenGL framebuffer data std::vector gl_framebuffer_data; - - /// Used for transforming the framebuffer orientation - Service::android::BufferTransformFlags framebuffer_transform_flags{}; - Common::Rectangle framebuffer_crop_rect; - u32 framebuffer_width; - u32 framebuffer_height; }; } // namespace OpenGL -- cgit v1.2.3