diff options
author | Rodolfo Bogado <rodolfoosvaldobogado@gmail.com> | 2018-10-24 22:09:40 +0200 |
---|---|---|
committer | Rodolfo Bogado <rodolfoosvaldobogado@gmail.com> | 2018-10-28 05:13:55 +0100 |
commit | 0287b2be6d1edeecea26250e5cd8d3067ff614af (patch) | |
tree | 5f7a74be1a36768819c2cd413b1ad05fd8086f90 /src/video_core/renderer_opengl/gl_rasterizer.cpp | |
parent | Merge pull request #1602 from DarkLordZach/key-derivation-isxdigit (diff) | |
download | yuzu-0287b2be6d1edeecea26250e5cd8d3067ff614af.tar yuzu-0287b2be6d1edeecea26250e5cd8d3067ff614af.tar.gz yuzu-0287b2be6d1edeecea26250e5cd8d3067ff614af.tar.bz2 yuzu-0287b2be6d1edeecea26250e5cd8d3067ff614af.tar.lz yuzu-0287b2be6d1edeecea26250e5cd8d3067ff614af.tar.xz yuzu-0287b2be6d1edeecea26250e5cd8d3067ff614af.tar.zst yuzu-0287b2be6d1edeecea26250e5cd8d3067ff614af.zip |
Diffstat (limited to 'src/video_core/renderer_opengl/gl_rasterizer.cpp')
-rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index cd4216c4e..cb180b93c 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp @@ -418,6 +418,7 @@ void RasterizerOpenGL::ConfigureFramebuffers(bool using_color_fb, bool using_dep // Bind the framebuffer surfaces state.draw.draw_framebuffer = framebuffer.handle; state.Apply(); + state.framebuffer_srgb.enabled = regs.framebuffer_srgb != 0; if (using_color_fb) { if (single_color_target) { @@ -429,6 +430,9 @@ void RasterizerOpenGL::ConfigureFramebuffers(bool using_color_fb, bool using_dep // Assume that a surface will be written to if it is used as a framebuffer, even if // the shader doesn't actually write to it. color_surface->MarkAsModified(true, res_cache); + // Workaround for and issue in nvidia drivers + // https://devtalk.nvidia.com/default/topic/776591/opengl/gl_framebuffer_srgb-functions-incorrectly/ + state.framebuffer_srgb.enabled |= color_surface->GetSurfaceParams().srgb_conversion; } glFramebufferTexture2D( @@ -446,6 +450,11 @@ void RasterizerOpenGL::ConfigureFramebuffers(bool using_color_fb, bool using_dep // Assume that a surface will be written to if it is used as a framebuffer, even // if the shader doesn't actually write to it. color_surface->MarkAsModified(true, res_cache); + // Enable sRGB only for supported formats + // Workaround for and issue in nvidia drivers + // https://devtalk.nvidia.com/default/topic/776591/opengl/gl_framebuffer_srgb-functions-incorrectly/ + state.framebuffer_srgb.enabled |= + color_surface->GetSurfaceParams().srgb_conversion; } buffers[index] = GL_COLOR_ATTACHMENT0 + regs.rt_control.GetMap(index); @@ -537,7 +546,9 @@ void RasterizerOpenGL::Clear() { ConfigureFramebuffers(use_color, use_depth || use_stencil, false, regs.clear_buffers.RT.Value()); - + // Copy the sRGB setting to the clear state to avoid problem with + // specific driver implementations + clear_state.framebuffer_srgb.enabled = state.framebuffer_srgb.enabled; clear_state.Apply(); if (use_color) { |