8000 gl: leave a pass's framebuffer bound when it ends by benface · Pull Request #672 · not-fl3/miniquad · GitHub
[go: up one dir, main page]

Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion src/graphics/gl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1706,7 +1706,12 @@ impl RenderingBackend for GlContext {
}
}
}
glBindFramebuffer(GL_FRAMEBUFFER, self.default_framebuffer);
// Leave the pass's framebuffer bound; the next pass binds its
// own. Tile-based GPUs, such as Mali, end a framebuffer's
// render pass when another one is bound, writing its tiles out
// to memory and reading them back in the next time it's drawn
// to, so binding the default framebuffer here did that after
// every pass.
self.cache.bind_buffer(GL_ARRAY_BUFFER, 0, None);
self.cache.bind_buffer(GL_ELEMENT_ARRAY_BUFFER, 0, None);

Expand All @@ -1718,6 +1723,11 @@ impl RenderingBackend for GlContext {
}

fn commit_frame(&mut self) {
// Frames end on the default framebuffer, as code reading the
// screen back expects.
unsafe {
glBindFramebuffer(GL_FRAMEBUFFER, self.default_framebuffer);
}
self.cache.clear_buffer_bindings();
self.cache.clear_texture_bindings();
}
Expand Down
Loading
0