summaryrefslogtreecommitdiffstats
path: root/src/video_core
diff options
context:
space:
mode:
authorReinUsesLisp <reinuseslisp@airmail.cc>2019-12-26 05:07:34 +0100
committerReinUsesLisp <reinuseslisp@airmail.cc>2020-02-28 20:58:30 +0100
commit2392b548bee87553b39f50c1159640b0dabc4b13 (patch)
tree5a1a5046be222eee078acc5f3a5e55d34abfaff6 /src/video_core
parentgl_state: Remove multisample tracking (diff)
downloadyuzu-2392b548bee87553b39f50c1159640b0dabc4b13.tar
yuzu-2392b548bee87553b39f50c1159640b0dabc4b13.tar.gz
yuzu-2392b548bee87553b39f50c1159640b0dabc4b13.tar.bz2
yuzu-2392b548bee87553b39f50c1159640b0dabc4b13.tar.lz
yuzu-2392b548bee87553b39f50c1159640b0dabc4b13.tar.xz
yuzu-2392b548bee87553b39f50c1159640b0dabc4b13.tar.zst
yuzu-2392b548bee87553b39f50c1159640b0dabc4b13.zip
Diffstat (limited to '')
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer.cpp10
-rw-r--r--src/video_core/renderer_opengl/gl_state.cpp8
-rw-r--r--src/video_core/renderer_opengl/gl_state.h5
3 files changed, 6 insertions, 17 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp
index dc2d60156..d7971f86f 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer.cpp
+++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp
@@ -415,6 +415,11 @@ void RasterizerOpenGL::Clear() {
clear_state.color_mask[0].green_enabled = regs.clear_buffers.G ? GL_TRUE : GL_FALSE;
clear_state.color_mask[0].blue_enabled = regs.clear_buffers.B ? GL_TRUE : GL_FALSE;
clear_state.color_mask[0].alpha_enabled = regs.clear_buffers.A ? GL_TRUE : GL_FALSE;
+
+ // TODO: Signal state tracker about these changes
+ SyncFramebufferSRGB();
+ // TODO(Rodrigo): Determine if clamping is used on clears
+ SyncFragmentColorClampState();
}
if (regs.clear_buffers.Z) {
ASSERT_MSG(regs.zeta_enable != 0, "Tried to clear Z but buffer is not enabled!");
@@ -454,9 +459,6 @@ void RasterizerOpenGL::Clear() {
}
}
- // TODO: Signal state tracker about these changes
- SyncFramebufferSRGB();
-
if (!use_color && !use_depth && !use_stencil) {
// No color surface nor depth/stencil surface are enabled
return;
@@ -1089,7 +1091,7 @@ void RasterizerOpenGL::SyncMultiSampleState() {
void RasterizerOpenGL::SyncFragmentColorClampState() {
const auto& regs = system.GPU().Maxwell3D().regs;
- state.fragment_color_clamp.enabled = regs.frag_color_clamp != 0;
+ glClampColor(GL_CLAMP_FRAGMENT_COLOR, regs.frag_color_clamp ? GL_TRUE : GL_FALSE);
}
void RasterizerOpenGL::SyncBlendState() {
diff --git a/src/video_core/renderer_opengl/gl_state.cpp b/src/video_core/renderer_opengl/gl_state.cpp
index b726adfc7..f8325d6e7 100644
--- a/src/video_core/renderer_opengl/gl_state.cpp
+++ b/src/video_core/renderer_opengl/gl_state.cpp
@@ -117,13 +117,6 @@ void OpenGLState::ApplyClipDistances() {
}
}
-void OpenGLState::ApplyFragmentColorClamp() {
- if (UpdateValue(cur_state.fragment_color_clamp.enabled, fragment_color_clamp.enabled)) {
- glClampColor(GL_CLAMP_FRAGMENT_COLOR_ARB,
- fragment_color_clamp.enabled ? GL_TRUE : GL_FALSE);
- }
-}
-
void OpenGLState::ApplyRasterizerDiscard() {
Enable(GL_RASTERIZER_DISCARD, cur_state.rasterizer_discard, rasterizer_discard);
}
@@ -317,7 +310,6 @@ void OpenGLState::Apply() {
ApplyShaderProgram();
ApplyProgramPipeline();
ApplyClipDistances();
- ApplyFragmentColorClamp();
ApplyRasterizerDiscard();
ApplyColorMask();
ApplyViewport();
diff --git a/src/video_core/renderer_opengl/gl_state.h b/src/video_core/renderer_opengl/gl_state.h
index 5a8a728f2..89eb30dfc 100644
--- a/src/video_core/renderer_opengl/gl_state.h
+++ b/src/video_core/renderer_opengl/gl_state.h
@@ -13,10 +13,6 @@ namespace OpenGL {
class OpenGLState {
public:
- struct {
- bool enabled = false; // GL_CLAMP_FRAGMENT_COLOR_ARB
- } fragment_color_clamp;
-
bool rasterizer_discard = false; // GL_RASTERIZER_DISCARD
struct ColorMask {
@@ -110,7 +106,6 @@ public:
void ApplyShaderProgram();
void ApplyProgramPipeline();
void ApplyClipDistances();
- void ApplyFragmentColorClamp();
void ApplyRasterizerDiscard();
void ApplyColorMask();
void ApplyStencilTest();