aboutsummaryrefslogtreecommitdiff
path: root/src/video_core/renderer_opengl/renderer_opengl.h
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2020-02-27 19:51:55 -0500
committerGitHub <noreply@github.com>2020-02-27 19:51:55 -0500
commit969357af1a26e74eaa5b0cec677d929bca94dc57 (patch)
tree59a8bb28215dfbdc817227e4b0b7ea37e6f5ef70 /src/video_core/renderer_opengl/renderer_opengl.h
parente1efab1f510c47a9f637601db425527c15e0d838 (diff)
parentebbfe735574a74122f4a52eac9631ba19cd8f013 (diff)
Merge pull request #3430 from bunnei/split-presenter
Port citra-emu/citra#4940: "Split Presentation thread from Render thread"
Diffstat (limited to 'src/video_core/renderer_opengl/renderer_opengl.h')
-rw-r--r--src/video_core/renderer_opengl/renderer_opengl.h29
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