Bug 1507918 - Update webrender to commit 596984d1b49f47af65ccfaedd9684b2a90a564e2 (WR PR #3318). r=kats
authorWR Updater Bot <graphics-team@mozilla.staktrace.com>
Fri, 16 Nov 2018 21:14:15 +0000
changeset 503284 2c799d14b34675e8188dc85c98886f85679f8b8c
parent 503283 8fb8a2697446df001916e99c8631e65269cf89a6
child 503285 b006cee2f7bd408d6185828a31546545b21721de
push id10290
push userffxbld-merge
push dateMon, 03 Dec 2018 16:23:23 +0000
treeherdermozilla-beta@700bed2445e6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskats
bugs1507918
milestone65.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 1507918 - Update webrender to commit 596984d1b49f47af65ccfaedd9684b2a90a564e2 (WR PR #3318). r=kats Differential Revision: https://phabricator.services.mozilla.com/D12175
gfx/webrender/src/device/gl.rs
gfx/webrender_bindings/revision.txt
--- a/gfx/webrender/src/device/gl.rs
+++ b/gfx/webrender/src/device/gl.rs
@@ -1019,16 +1019,21 @@ impl Device {
                 if supports_texture_storage {
                     TexStorageUsage::Always
                 } else {
                     TexStorageUsage::Never
                 },
             )
         };
 
+        // Explicitly set some global states to the values we expect.
+        gl.disable(gl::FRAMEBUFFER_SRGB);
+        gl.disable(gl::MULTISAMPLE);
+        gl.disable(gl::POLYGON_SMOOTH);
+
         Device {
             gl,
             resource_override_path,
             // This is initialized to 1 by default, but it is reset
             // at the beginning of each frame in `Renderer::bind_frame_data`.
             device_pixel_ratio: 1.0,
             upload_method,
             inside_frame: false,
@@ -1151,20 +1156,30 @@ impl Device {
         } else {
             if !log.is_empty() {
                 warn!("Warnings detected on shader: {}\n{}", name, log);
             }
             Ok(id)
         }
     }
 
+    // If an assertion is hit in this function, something outside of WebRender is likely
+    // messing with the GL context's global state.
+    pub fn check_gl_state(&self) {
+        debug_assert!(self.gl.is_enabled(gl::FRAMEBUFFER_SRGB) == 0);
+        debug_assert!(self.gl.is_enabled(gl::MULTISAMPLE) == 0);
+        debug_assert!(self.gl.is_enabled(gl::POLYGON_SMOOTH) == 0);
+    }
+
     pub fn begin_frame(&mut self) -> GpuFrameId {
         debug_assert!(!self.inside_frame);
         self.inside_frame = true;
 
+        self.check_gl_state();
+
         // Retrieve the currently set FBO.
         let mut default_read_fbo = [0];
         unsafe {
             self.gl.get_integer_v(gl::READ_FRAMEBUFFER_BINDING, &mut default_read_fbo);
         }
         self.default_read_fbo = FBOId(default_read_fbo[0] as gl::GLuint);
         let mut default_draw_fbo = [0];
         unsafe {
--- a/gfx/webrender_bindings/revision.txt
+++ b/gfx/webrender_bindings/revision.txt
@@ -1,1 +1,1 @@
-91910a3ce033239fe36ef096223be333ea5df6d7
+596984d1b49f47af65ccfaedd9684b2a90a564e2