From 00fb4561b78cffa0d22f7fd153449a9a94d6d8f4 Mon Sep 17 00:00:00 2001 From: Victor Brekenfeld Date: Sat, 10 Jul 2021 23:50:57 +0200 Subject: [PATCH] gles2: Enable scissor test for optimization. Skips unnecessary drawcalls outside of the viewable area. This may happen with textures rendered over the edges of our screen. --- src/backend/renderer/gles2/mod.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/backend/renderer/gles2/mod.rs b/src/backend/renderer/gles2/mod.rs index 510e9b1..0bb8769 100644 --- a/src/backend/renderer/gles2/mod.rs +++ b/src/backend/renderer/gles2/mod.rs @@ -1019,6 +1019,9 @@ impl Renderer for Gles2Renderer { unsafe { self.gl.Viewport(0, 0, size.w, size.h); + self.gl.Scissor(0, 0, size.w, size.h); + self.gl.Enable(ffi::SCISSOR_TEST); + self.gl.Enable(ffi::BLEND); self.gl.BlendFunc(ffi::ONE, ffi::ONE_MINUS_SRC_ALPHA); }