diff options
author | Fernando Sahmkow <fsahmkow27@gmail.com> | 2019-07-13 22:52:32 +0200 |
---|---|---|
committer | FernandoS27 <fsahmkow27@gmail.com> | 2019-07-17 23:29:51 +0200 |
commit | a081dea8abd9539ab45e53fbfb0e9c6243b87180 (patch) | |
tree | dab378fcaab484aff60eb9d6c7cf74127cd341d4 /src/video_core/renderer_opengl/gl_state.h | |
parent | Maxwell3D: Rework CBData Upload (diff) | |
download | yuzu-a081dea8abd9539ab45e53fbfb0e9c6243b87180.tar yuzu-a081dea8abd9539ab45e53fbfb0e9c6243b87180.tar.gz yuzu-a081dea8abd9539ab45e53fbfb0e9c6243b87180.tar.bz2 yuzu-a081dea8abd9539ab45e53fbfb0e9c6243b87180.tar.lz yuzu-a081dea8abd9539ab45e53fbfb0e9c6243b87180.tar.xz yuzu-a081dea8abd9539ab45e53fbfb0e9c6243b87180.tar.zst yuzu-a081dea8abd9539ab45e53fbfb0e9c6243b87180.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/renderer_opengl/gl_state.h | 37 |
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 |