Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure buffers are unbound at end of frame. #403

Merged
merged 1 commit into from Sep 14, 2016
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Ensure buffers are unbound at end of frame.

This fixes asserts in some software backends on shutdown.
  • Loading branch information
gw3583 committed Sep 14, 2016
commit 7b71cd29fc08f0d940cb4f791d947545b9159feb
@@ -1608,6 +1608,13 @@ impl Device {

gl::bind_texture(gl::TEXTURE_2D, 0);
gl::use_program(0);

for i in 0..self.bound_textures.len() {
gl::active_texture(gl::TEXTURE0 + i as gl::GLuint);
gl::bind_texture(gl::TEXTURE_2D, 0);
}

gl::active_texture(gl::TEXTURE0);
}
}

@@ -604,6 +604,10 @@ impl Renderer {
//self.update_shaders();
self.update_texture_cache();
self.draw_tile_frame(frame, &framebuffer_size);

gl::bind_buffer(gl::UNIFORM_BUFFER, 0);
gl::bind_buffer_base(gl::UNIFORM_BUFFER, UBO_BIND_DATA, 0);
gl::bind_buffer_base(gl::UNIFORM_BUFFER, UBO_BIND_TILES, 0);
});

let current_time = precise_time_ns();
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.