diff options
author | Rodolfo Bogado <rodolfoosvaldobogado@gmail.com> | 2018-11-14 02:09:01 +0100 |
---|---|---|
committer | Rodolfo Bogado <rodolfoosvaldobogado@gmail.com> | 2018-11-17 23:59:33 +0100 |
commit | 8ed7e1af2c8d859ca5e1bd05e199b1f14099c8b4 (patch) | |
tree | f0903ff885f49b0ccecf3d4023fdd47e067bf072 /src/video_core/renderer_opengl | |
parent | add missing MirrorOnceBorder support where supported (diff) | |
download | yuzu-8ed7e1af2c8d859ca5e1bd05e199b1f14099c8b4.tar yuzu-8ed7e1af2c8d859ca5e1bd05e199b1f14099c8b4.tar.gz yuzu-8ed7e1af2c8d859ca5e1bd05e199b1f14099c8b4.tar.bz2 yuzu-8ed7e1af2c8d859ca5e1bd05e199b1f14099c8b4.tar.lz yuzu-8ed7e1af2c8d859ca5e1bd05e199b1f14099c8b4.tar.xz yuzu-8ed7e1af2c8d859ca5e1bd05e199b1f14099c8b4.tar.zst yuzu-8ed7e1af2c8d859ca5e1bd05e199b1f14099c8b4.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer.cpp | 6 | ||||
-rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer.h | 3 | ||||
-rw-r--r-- | src/video_core/renderer_opengl/gl_state.cpp | 7 | ||||
-rw-r--r-- | src/video_core/renderer_opengl/gl_state.h | 4 |
4 files changed, 20 insertions, 0 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index 10d407bd2..98799056c 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp @@ -582,6 +582,7 @@ void RasterizerOpenGL::DrawArrays() { ConfigureFramebuffers(state); SyncColorMask(); + SyncFragmentColorClampState(); SyncDepthTestState(); SyncStencilTestState(); SyncBlendState(); @@ -1032,6 +1033,11 @@ void RasterizerOpenGL::SyncColorMask() { } } +void RasterizerOpenGL::SyncFragmentColorClampState() { + const auto& regs = Core::System::GetInstance().GPU().Maxwell3D().regs; + state.fragment_color_clamp.enabled = regs.frag_color_clamp != 0; +} + void RasterizerOpenGL::SyncBlendState() { const auto& regs = Core::System::GetInstance().GPU().Maxwell3D().regs; diff --git a/src/video_core/renderer_opengl/gl_rasterizer.h b/src/video_core/renderer_opengl/gl_rasterizer.h index 8ef0f6c12..d3fa0b6fc 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.h +++ b/src/video_core/renderer_opengl/gl_rasterizer.h @@ -160,6 +160,9 @@ private: /// Syncs the LogicOp state to match the guest state void SyncLogicOpState(); + /// Syncs the the color clamp state + void SyncFragmentColorClampState(); + /// Syncs the scissor test state to match the guest state void SyncScissorTest(); diff --git a/src/video_core/renderer_opengl/gl_state.cpp b/src/video_core/renderer_opengl/gl_state.cpp index dd6d946e5..6998dd92b 100644 --- a/src/video_core/renderer_opengl/gl_state.cpp +++ b/src/video_core/renderer_opengl/gl_state.cpp @@ -89,6 +89,7 @@ OpenGLState::OpenGLState() { clip_distance = {}; point.size = 1; + fragment_color_clamp.enabled = false; } void OpenGLState::ApplyDefaultState() { @@ -497,6 +498,12 @@ void OpenGLState::Apply() const { if (point.size != cur_state.point.size) { glPointSize(point.size); } + if (GLAD_GL_ARB_color_buffer_float) { + if (fragment_color_clamp.enabled != cur_state.fragment_color_clamp.enabled) { + glClampColor(GL_CLAMP_FRAGMENT_COLOR_ARB, + fragment_color_clamp.enabled ? GL_TRUE : GL_FALSE); + } + } ApplyColorMask(); ApplyViewport(); ApplyStencilTest(); diff --git a/src/video_core/renderer_opengl/gl_state.h b/src/video_core/renderer_opengl/gl_state.h index da487461f..6079f6e0b 100644 --- a/src/video_core/renderer_opengl/gl_state.h +++ b/src/video_core/renderer_opengl/gl_state.h @@ -40,6 +40,10 @@ public: } framebuffer_srgb; struct { + bool enabled; // GL_CLAMP_FRAGMENT_COLOR_ARB + } fragment_color_clamp; + + struct { bool enabled; // viewports arrays are only supported when geometry shaders are enabled. } geometry_shaders; |