aboutsummaryrefslogtreecommitdiff
path: root/src/video_core/renderer_opengl/gl_state.h
diff options
context:
space:
mode:
authorFernando Sahmkow <fsahmkow27@gmail.com>2019-07-13 16:52:32 -0400
committerFernandoS27 <fsahmkow27@gmail.com>2019-07-17 17:29:51 -0400
commita081dea8abd9539ab45e53fbfb0e9c6243b87180 (patch)
treedab378fcaab484aff60eb9d6c7cf74127cd341d4 /src/video_core/renderer_opengl/gl_state.h
parent0d3db58657ce5352d90a70ee8d6c0334d9119366 (diff)
Maxwell3D: Implement State Dirty Flags.
Diffstat (limited to 'src/video_core/renderer_opengl/gl_state.h')
-rw-r--r--src/video_core/renderer_opengl/gl_state.h37
1 files changed, 36 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..3d0f6747f 100644
--- a/src/video_core/renderer_opengl/gl_state.h
+++ b/src/video_core/renderer_opengl/gl_state.h
@@ -196,7 +196,7 @@ public:
}
/// Apply this state as the current OpenGL state
- void Apply() const;
+ void Apply();
void ApplyFramebufferState() const;
void ApplyVertexArrayState() const;
@@ -237,11 +237,46 @@ public:
/// Viewport does not affects glClearBuffer so emulate viewport using scissor test
void EmulateViewportWithScissor();
+ void MarkDirtyBlendState(const bool is_dirty) {
+ dirty.blend_state = is_dirty;
+ }
+
+ void MarkDirtyStencilState(const bool is_dirty) {
+ dirty.stencil_state = is_dirty;
+ }
+
+ void MarkDirtyViewportState(const bool is_dirty) {
+ dirty.viewport_state = is_dirty;
+ }
+
+ void MarkDirtyPolygonOffset(const bool is_dirty) {
+ dirty.polygon_offset = is_dirty;
+ }
+
+ void MarkDirtyColorMask(const bool is_dirty) {
+ dirty.color_mask = is_dirty;
+ }
+
+ void AllDirty() {
+ dirty.blend_state = true;
+ dirty.stencil_state = true;
+ dirty.viewport_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