Bug 1530576 - WR track vao bindings better r=gw
authorDzmitry Malyshau <dmalyshau@mozilla.com>
Tue, 26 Feb 2019 06:30:44 +0000
changeset 519028 8a0710c2941558afe04ba413536d3f1590096f03
parent 518956 9b8bdd92d93ea62e1508c9f8ae18feaed9e8634c
child 519029 faf6df595f9fb9b4a9a22aeead6c7be64e730049
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgw
bugs1530576
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1530576 - WR track vao bindings better r=gw this change makes sure that bindings are always synced. Differential Revision: https://phabricator.services.mozilla.com/D21159
gfx/wr/webrender/src/device/gl.rs
--- a/gfx/wr/webrender/src/device/gl.rs
+++ b/gfx/wr/webrender/src/device/gl.rs
@@ -2340,28 +2340,24 @@ impl Device {
     fn create_vao_with_vbos(
         &mut self,
         descriptor: &VertexDescriptor,
         main_vbo_id: VBOId,
         instance_vbo_id: VBOId,
         ibo_id: IBOId,
         owns_vertices_and_indices: bool,
     ) -> VAO {
-        debug_assert!(self.inside_frame);
-
         let instance_stride = descriptor.instance_stride() as usize;
         let vao_id = self.gl.gen_vertex_arrays(1)[0];
 
-        self.gl.bind_vertex_array(vao_id);
+        self.bind_vao_impl(vao_id);
 
         descriptor.bind(self.gl(), main_vbo_id, instance_vbo_id);
         ibo_id.bind(self.gl()); // force it to be a part of VAO
 
-        self.gl.bind_vertex_array(0);
-
         VAO {
             id: vao_id,
             ibo_id,
             main_vbo_id,
             instance_vbo_id,
             instance_stride,
             owns_vertices_and_indices,
         }
@@ -2369,32 +2365,30 @@ impl Device {
 
     pub fn create_custom_vao(
         &mut self,
         streams: &[Stream],
     ) -> CustomVAO {
         debug_assert!(self.inside_frame);
 
         let vao_id = self.gl.gen_vertex_arrays(1)[0];
-        self.gl.bind_vertex_array(vao_id);
+        self.bind_vao_impl(vao_id);
 
         let mut attrib_index = 0;
         for stream in streams {
             VertexDescriptor::bind_attributes(
                 stream.attributes,
                 attrib_index,
                 0,
                 self.gl(),
                 stream.vbo,
             );
             attrib_index += stream.attributes.len();
         }
 
-        self.gl.bind_vertex_array(0);
-
         CustomVAO {
             id: vao_id,
         }
     }
 
     pub fn delete_custom_vao(&mut self, mut vao: CustomVAO) {
         self.gl.delete_vertex_arrays(&[vao.id]);
         vao.id = 0;