summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_opengl/gl_state.h
diff options
context:
space:
mode:
authortfarley <tfarleygithub@gmail.com>2016-04-17 00:57:57 +0200
committertfarley <tfarleygithub@gmail.com>2016-04-21 23:27:56 +0200
commit22f3a7e94ce0e325a8c3dfeb0814c4b82a42649d (patch)
treefb0dc58288063f755eda7bc0f8cfb7e9573e397d /src/video_core/renderer_opengl/gl_state.h
parentConfig: Add scaled resolution option (diff)
downloadyuzu-22f3a7e94ce0e325a8c3dfeb0814c4b82a42649d.tar
yuzu-22f3a7e94ce0e325a8c3dfeb0814c4b82a42649d.tar.gz
yuzu-22f3a7e94ce0e325a8c3dfeb0814c4b82a42649d.tar.bz2
yuzu-22f3a7e94ce0e325a8c3dfeb0814c4b82a42649d.tar.lz
yuzu-22f3a7e94ce0e325a8c3dfeb0814c4b82a42649d.tar.xz
yuzu-22f3a7e94ce0e325a8c3dfeb0814c4b82a42649d.tar.zst
yuzu-22f3a7e94ce0e325a8c3dfeb0814c4b82a42649d.zip
Diffstat (limited to '')
-rw-r--r--src/video_core/renderer_opengl/gl_state.h27
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;