summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_opengl/gl_state.cpp
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2020-02-14 04:49:15 +0100
committerbunnei <bunneidev@gmail.com>2020-02-26 03:22:58 +0100
commitadd2c38b73f948b78f737362edd68e54a2f14b30 (patch)
tree346b7632c506bb17bea9ebaa5e97d6c0a479c1cd /src/video_core/renderer_opengl/gl_state.cpp
parentcore: frontend: emu_window: Add TextureMailbox class. (diff)
downloadyuzu-add2c38b73f948b78f737362edd68e54a2f14b30.tar
yuzu-add2c38b73f948b78f737362edd68e54a2f14b30.tar.gz
yuzu-add2c38b73f948b78f737362edd68e54a2f14b30.tar.bz2
yuzu-add2c38b73f948b78f737362edd68e54a2f14b30.tar.lz
yuzu-add2c38b73f948b78f737362edd68e54a2f14b30.tar.xz
yuzu-add2c38b73f948b78f737362edd68e54a2f14b30.tar.zst
yuzu-add2c38b73f948b78f737362edd68e54a2f14b30.zip
Diffstat (limited to 'src/video_core/renderer_opengl/gl_state.cpp')
-rw-r--r--src/video_core/renderer_opengl/gl_state.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/video_core/renderer_opengl/gl_state.cpp b/src/video_core/renderer_opengl/gl_state.cpp
index ab1f7983c..7d3bc1a1f 100644
--- a/src/video_core/renderer_opengl/gl_state.cpp
+++ b/src/video_core/renderer_opengl/gl_state.cpp
@@ -423,6 +423,13 @@ void OpenGLState::ApplyClipControl() {
}
}
+void OpenGLState::ApplyRenderBuffer() {
+ if (cur_state.renderbuffer != renderbuffer) {
+ cur_state.renderbuffer = renderbuffer;
+ glBindRenderbuffer(GL_RENDERBUFFER, renderbuffer);
+ }
+}
+
void OpenGLState::ApplyTextures() {
const std::size_t size = std::size(textures);
for (std::size_t i = 0; i < size; ++i) {
@@ -478,6 +485,7 @@ void OpenGLState::Apply() {
ApplyPolygonOffset();
ApplyAlphaTest();
ApplyClipControl();
+ ApplyRenderBuffer();
}
void OpenGLState::EmulateViewportWithScissor() {
@@ -551,4 +559,11 @@ OpenGLState& OpenGLState::ResetFramebuffer(GLuint handle) {
return *this;
}
+OpenGLState& OpenGLState::ResetRenderbuffer(GLuint handle) {
+ if (renderbuffer == handle) {
+ renderbuffer = 0;
+ }
+ return *this;
+}
+
} // namespace OpenGL