diff options
| author | tfarley <tfarleygithub@gmail.com> | 2016-04-16 18:57:57 -0400 |
|---|---|---|
| committer | tfarley <tfarleygithub@gmail.com> | 2016-04-21 17:27:56 -0400 |
| commit | 22f3a7e94ce0e325a8c3dfeb0814c4b82a42649d (patch) | |
| tree | fb0dc58288063f755eda7bc0f8cfb7e9573e397d /src/video_core/renderer_opengl/gl_state.h | |
| parent | e46d086189908ce9b9d7d68e3e4453396e48c7cc (diff) | |
HWRasterizer: Texture forwarding
Diffstat (limited to 'src/video_core/renderer_opengl/gl_state.h')
| -rw-r--r-- | src/video_core/renderer_opengl/gl_state.h | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/src/video_core/renderer_opengl/gl_state.h b/src/video_core/renderer_opengl/gl_state.h index e848058d7..0f72e9004 100644 --- a/src/video_core/renderer_opengl/gl_state.h +++ b/src/video_core/renderer_opengl/gl_state.h @@ -5,6 +5,7 @@ #pragma once #include <glad/glad.h> +#include <memory> class OpenGLState { public: @@ -63,15 +64,15 @@ public: struct { GLuint texture_1d; // GL_TEXTURE_BINDING_1D - } lighting_lut[6]; + } lighting_luts[6]; struct { - GLuint framebuffer; // GL_DRAW_FRAMEBUFFER_BINDING + GLuint read_framebuffer; // GL_READ_FRAMEBUFFER_BINDING + GLuint draw_framebuffer; // GL_DRAW_FRAMEBUFFER_BINDING GLuint vertex_array; // GL_VERTEX_ARRAY_BINDING GLuint vertex_buffer; // GL_ARRAY_BUFFER_BINDING GLuint uniform_buffer; // GL_UNIFORM_BUFFER_BINDING GLuint shader_program; // GL_CURRENT_PROGRAM - bool shader_dirty; } draw; OpenGLState(); @@ -82,14 +83,18 @@ public: } /// Apply this state as the current OpenGL state - void Apply(); - - static void ResetTexture(GLuint id); - static void ResetSampler(GLuint id); - static void ResetProgram(GLuint id); - static void ResetBuffer(GLuint id); - static void ResetVertexArray(GLuint id); - static void ResetFramebuffer(GLuint id); + void Apply() const; + + /// Check the status of the current OpenGL read or draw framebuffer configuration + static GLenum CheckFBStatus(GLenum target); + + /// 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); private: static OpenGLState cur_state; |
