summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_opengl/gl_state.h
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2019-07-21 06:59:52 +0200
committerGitHub <noreply@github.com>2019-07-21 06:59:52 +0200
commit27e10e0442dfd347387c6eaf148b27f5cc38bcaf (patch)
treec078fc3f0e62e55fc92a0c8b582666deece0a968 /src/video_core/renderer_opengl/gl_state.h
parentUpdate README.md (diff)
parentMaxwell3D: Reorganize and address feedback (diff)
downloadyuzu-27e10e0442dfd347387c6eaf148b27f5cc38bcaf.tar
yuzu-27e10e0442dfd347387c6eaf148b27f5cc38bcaf.tar.gz
yuzu-27e10e0442dfd347387c6eaf148b27f5cc38bcaf.tar.bz2
yuzu-27e10e0442dfd347387c6eaf148b27f5cc38bcaf.tar.lz
yuzu-27e10e0442dfd347387c6eaf148b27f5cc38bcaf.tar.xz
yuzu-27e10e0442dfd347387c6eaf148b27f5cc38bcaf.tar.zst
yuzu-27e10e0442dfd347387c6eaf148b27f5cc38bcaf.zip
Diffstat (limited to 'src/video_core/renderer_opengl/gl_state.h')
-rw-r--r--src/video_core/renderer_opengl/gl_state.h33
1 files changed, 32 insertions, 1 deletions
diff --git a/src/video_core/renderer_opengl/gl_state.h b/src/video_core/renderer_opengl/gl_state.h
index b0140495d..fdf9a8a12 100644
--- a/src/video_core/renderer_opengl/gl_state.h
+++ b/src/video_core/renderer_opengl/gl_state.h
@@ -195,8 +195,9 @@ public:
s_rgb_used = false;
}
+ void SetDefaultViewports();
/// Apply this state as the current OpenGL state
- void Apply() const;
+ void Apply();
void ApplyFramebufferState() const;
void ApplyVertexArrayState() const;
@@ -237,11 +238,41 @@ public:
/// Viewport does not affects glClearBuffer so emulate viewport using scissor test
void EmulateViewportWithScissor();
+ void MarkDirtyBlendState() {
+ dirty.blend_state = true;
+ }
+
+ void MarkDirtyStencilState() {
+ dirty.stencil_state = true;
+ }
+
+ void MarkDirtyPolygonOffset() {
+ dirty.polygon_offset = true;
+ }
+
+ void MarkDirtyColorMask() {
+ dirty.color_mask = true;
+ }
+
+ void AllDirty() {
+ dirty.blend_state = true;
+ dirty.stencil_state = true;
+ dirty.polygon_offset = true;
+ dirty.color_mask = true;
+ }
+
private:
static OpenGLState cur_state;
// Workaround for sRGB problems caused by QT not supporting srgb output
static bool s_rgb_used;
+ struct {
+ bool blend_state;
+ bool stencil_state;
+ bool viewport_state;
+ bool polygon_offset;
+ bool color_mask;
+ } dirty{};
};
} // namespace OpenGL