diff options
author | bunnei <bunneidev@gmail.com> | 2018-03-21 02:37:43 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-21 02:37:43 +0100 |
commit | 0b3ab30762ed09be88e945d27a83bdfe9e77b49c (patch) | |
tree | 2ce527d9139a25fc1c728a7f4dd2f3baf2df13d1 /src/video_core/renderer_opengl/gl_state.h | |
parent | Merge pull request #256 from mailwl/fatal (diff) | |
parent | renderer_gl: Port boilerplate rasterizer code over from Citra. (diff) | |
download | yuzu-0b3ab30762ed09be88e945d27a83bdfe9e77b49c.tar yuzu-0b3ab30762ed09be88e945d27a83bdfe9e77b49c.tar.gz yuzu-0b3ab30762ed09be88e945d27a83bdfe9e77b49c.tar.bz2 yuzu-0b3ab30762ed09be88e945d27a83bdfe9e77b49c.tar.lz yuzu-0b3ab30762ed09be88e945d27a83bdfe9e77b49c.tar.xz yuzu-0b3ab30762ed09be88e945d27a83bdfe9e77b49c.tar.zst yuzu-0b3ab30762ed09be88e945d27a83bdfe9e77b49c.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/renderer_opengl/gl_state.h | 33 |
1 files changed, 25 insertions, 8 deletions
diff --git a/src/video_core/renderer_opengl/gl_state.h b/src/video_core/renderer_opengl/gl_state.h index 437fe34c4..940575dfa 100644 --- a/src/video_core/renderer_opengl/gl_state.h +++ b/src/video_core/renderer_opengl/gl_state.h @@ -122,27 +122,44 @@ public: GLuint vertex_buffer; // GL_ARRAY_BUFFER_BINDING GLuint uniform_buffer; // GL_UNIFORM_BUFFER_BINDING GLuint shader_program; // GL_CURRENT_PROGRAM + GLuint program_pipeline; // GL_PROGRAM_PIPELINE_BINDING } draw; + struct { + bool enabled; // GL_SCISSOR_TEST + GLint x; + GLint y; + GLsizei width; + GLsizei height; + } scissor; + + struct { + GLint x; + GLint y; + GLsizei width; + GLsizei height; + } viewport; + std::array<bool, 2> clip_distance; // GL_CLIP_DISTANCE OpenGLState(); /// Get the currently active OpenGL state - static const OpenGLState& GetCurState() { + static OpenGLState GetCurState() { return cur_state; } /// Apply this state as the current OpenGL state void Apply() const; - /// Resets and unbinds any references to the given resource in the current OpenGL state - static void ResetTexture(GLuint handle); - static void ResetSampler(GLuint handle); - static void ResetProgram(GLuint handle); - static void ResetBuffer(GLuint handle); - static void ResetVertexArray(GLuint handle); - static void ResetFramebuffer(GLuint handle); + /// Resets any references to the given resource + OpenGLState& ResetTexture(GLuint handle); + OpenGLState& ResetSampler(GLuint handle); + OpenGLState& ResetProgram(GLuint handle); + OpenGLState& ResetPipeline(GLuint handle); + OpenGLState& ResetBuffer(GLuint handle); + OpenGLState& ResetVertexArray(GLuint handle); + OpenGLState& ResetFramebuffer(GLuint handle); private: static OpenGLState cur_state; |