diff options
author | bunnei <bunneidev@gmail.com> | 2018-03-19 22:05:15 +0100 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2018-03-20 04:13:49 +0100 |
commit | 6a0902e56dfdada3f105da9c49442cef2c857cae (patch) | |
tree | 0c04e969bde3c9adb6c157dc55116b9f05b5f7c4 /src/video_core/renderer_opengl/gl_state.h | |
parent | Merge pull request #252 from N00byKing/3064 (diff) | |
download | yuzu-6a0902e56dfdada3f105da9c49442cef2c857cae.tar yuzu-6a0902e56dfdada3f105da9c49442cef2c857cae.tar.gz yuzu-6a0902e56dfdada3f105da9c49442cef2c857cae.tar.bz2 yuzu-6a0902e56dfdada3f105da9c49442cef2c857cae.tar.lz yuzu-6a0902e56dfdada3f105da9c49442cef2c857cae.tar.xz yuzu-6a0902e56dfdada3f105da9c49442cef2c857cae.tar.zst yuzu-6a0902e56dfdada3f105da9c49442cef2c857cae.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; |