diff options
| author | bunnei <bunneidev@gmail.com> | 2018-03-20 21:37:43 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-03-20 21:37:43 -0400 |
| commit | 0b3ab30762ed09be88e945d27a83bdfe9e77b49c (patch) | |
| tree | 2ce527d9139a25fc1c728a7f4dd2f3baf2df13d1 /src/video_core/renderer_opengl/gl_state.h | |
| parent | 8c8de2efe995363eacaaaf3c4d916808194f69e9 (diff) | |
| parent | 6e3222363c6c8024b446329a9760608abe5ec49e (diff) | |
Merge pull request #254 from bunnei/port-citra-renderer
Port Citra OpenGL rasterizer code
Diffstat (limited to 'src/video_core/renderer_opengl/gl_state.h')
| -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; |
