summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_opengl/gl_state.cpp
diff options
context:
space:
mode:
authorYuri Kunde Schlesner <yuriks@yuriks.net>2015-08-06 04:22:06 +0200
committerYuri Kunde Schlesner <yuriks@yuriks.net>2015-08-06 05:59:37 +0200
commit254582aa35306c7bdebb90b0cd2dda88fe188087 (patch)
tree35cd21873666116fba7a3fac3df1580e8d59b79a /src/video_core/renderer_opengl/gl_state.cpp
parentOpenGL: Remove redundant texture.enable_2d field from OpenGLState (diff)
downloadyuzu-254582aa35306c7bdebb90b0cd2dda88fe188087.tar
yuzu-254582aa35306c7bdebb90b0cd2dda88fe188087.tar.gz
yuzu-254582aa35306c7bdebb90b0cd2dda88fe188087.tar.bz2
yuzu-254582aa35306c7bdebb90b0cd2dda88fe188087.tar.lz
yuzu-254582aa35306c7bdebb90b0cd2dda88fe188087.tar.xz
yuzu-254582aa35306c7bdebb90b0cd2dda88fe188087.tar.zst
yuzu-254582aa35306c7bdebb90b0cd2dda88fe188087.zip
Diffstat (limited to '')
-rw-r--r--src/video_core/renderer_opengl/gl_state.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/video_core/renderer_opengl/gl_state.cpp b/src/video_core/renderer_opengl/gl_state.cpp
index 7ccf474e1..871324014 100644
--- a/src/video_core/renderer_opengl/gl_state.cpp
+++ b/src/video_core/renderer_opengl/gl_state.cpp
@@ -174,3 +174,35 @@ void OpenGLState::Apply() {
cur_state = *this;
}
+
+void OpenGLState::ResetTexture(GLuint id) {
+ for (auto& unit : cur_state.texture_units) {
+ if (unit.texture_2d == id) {
+ unit.texture_2d = 0;
+ }
+ }
+}
+
+void OpenGLState::ResetProgram(GLuint id) {
+ if (cur_state.draw.shader_program == id) {
+ cur_state.draw.shader_program = 0;
+ }
+}
+
+void OpenGLState::ResetBuffer(GLuint id) {
+ if (cur_state.draw.vertex_buffer == id) {
+ cur_state.draw.vertex_buffer = 0;
+ }
+}
+
+void OpenGLState::ResetVertexArray(GLuint id) {
+ if (cur_state.draw.vertex_array == id) {
+ cur_state.draw.vertex_array = 0;
+ }
+}
+
+void OpenGLState::ResetFramebuffer(GLuint id) {
+ if (cur_state.draw.framebuffer == id) {
+ cur_state.draw.framebuffer = 0;
+ }
+}