diff options
author | bunnei <bunneidev@gmail.com> | 2020-02-28 01:51:55 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-28 01:51:55 +0100 |
commit | 969357af1a26e74eaa5b0cec677d929bca94dc57 (patch) | |
tree | 59a8bb28215dfbdc817227e4b0b7ea37e6f5ef70 /src/video_core/renderer_opengl/renderer_opengl.h | |
parent | AM/ICommonStateGetter: Stub SetLcdBacklighOffEnabled (#3454) (diff) | |
parent | renderer_opengl: Reduce swap chain size to 3. (diff) | |
download | yuzu-969357af1a26e74eaa5b0cec677d929bca94dc57.tar yuzu-969357af1a26e74eaa5b0cec677d929bca94dc57.tar.gz yuzu-969357af1a26e74eaa5b0cec677d929bca94dc57.tar.bz2 yuzu-969357af1a26e74eaa5b0cec677d929bca94dc57.tar.lz yuzu-969357af1a26e74eaa5b0cec677d929bca94dc57.tar.xz yuzu-969357af1a26e74eaa5b0cec677d929bca94dc57.tar.zst yuzu-969357af1a26e74eaa5b0cec677d929bca94dc57.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/renderer_opengl/renderer_opengl.h | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/src/video_core/renderer_opengl/renderer_opengl.h b/src/video_core/renderer_opengl/renderer_opengl.h index b56328a7f..4107e10a9 100644 --- a/src/video_core/renderer_opengl/renderer_opengl.h +++ b/src/video_core/renderer_opengl/renderer_opengl.h @@ -44,19 +44,23 @@ struct ScreenInfo { TextureInfo texture; }; +struct PresentationTexture { + u32 width = 0; + u32 height = 0; + OGLTexture texture; +}; + +class FrameMailbox; + class RendererOpenGL final : public VideoCore::RendererBase { public: explicit RendererOpenGL(Core::Frontend::EmuWindow& emu_window, Core::System& system); ~RendererOpenGL() override; - /// Swap buffers (render frame) - void SwapBuffers(const Tegra::FramebufferConfig* framebuffer) override; - - /// Initialize the renderer bool Init() override; - - /// Shutdown the renderer void ShutDown() override; + void SwapBuffers(const Tegra::FramebufferConfig* framebuffer) override; + void TryPresent(int timeout_ms) override; private: /// Initializes the OpenGL state and creates persistent objects. @@ -74,10 +78,7 @@ private: void DrawScreenTriangles(const ScreenInfo& screen_info, float x, float y, float w, float h); - /// Updates the framerate. - void UpdateFramerate(); - - void CaptureScreenshot(); + void RenderScreenshot(); /// Loads framebuffer from emulated memory into the active OpenGL texture. void LoadFBToScreenInfo(const Tegra::FramebufferConfig& framebuffer); @@ -87,6 +88,8 @@ private: void LoadColorToActiveGLTexture(u8 color_r, u8 color_g, u8 color_b, u8 color_a, const TextureInfo& texture); + void PrepareRendertarget(const Tegra::FramebufferConfig* framebuffer); + Core::Frontend::EmuWindow& emu_window; Core::System& system; @@ -107,6 +110,12 @@ private: /// Used for transforming the framebuffer orientation Tegra::FramebufferConfig::TransformFlags framebuffer_transform_flags; Common::Rectangle<int> framebuffer_crop_rect; + + /// Represents if the final render frame is sRGB + bool is_srgb{}; + + /// Frame presentation mailbox + std::unique_ptr<FrameMailbox> frame_mailbox; }; } // namespace OpenGL |