aboutsummaryrefslogtreecommitdiff
path: root/src/video_core/renderer_opengl/gl_state.h
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2018-03-19 17:05:15 -0400
committerbunnei <bunneidev@gmail.com>2018-03-19 23:13:49 -0400
commit6a0902e56dfdada3f105da9c49442cef2c857cae (patch)
tree0c04e969bde3c9adb6c157dc55116b9f05b5f7c4 /src/video_core/renderer_opengl/gl_state.h
parenta90ab1dec7b4b4cefc73115310dec57363114a05 (diff)
gl_state: Sync latest version with Citra.
Diffstat (limited to 'src/video_core/renderer_opengl/gl_state.h')
-rw-r--r--src/video_core/renderer_opengl/gl_state.h33
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;