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.
This commit is contained in:
Victor Brekenfeld 2021-07-10 23:50:57 +02:00
parent 8bd17d71d2
commit 00fb4561b7
1 changed files with 3 additions and 0 deletions

View File

@ -1019,6 +1019,9 @@ impl Renderer for Gles2Renderer {
unsafe { unsafe {
self.gl.Viewport(0, 0, size.w, size.h); 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.Enable(ffi::BLEND);
self.gl.BlendFunc(ffi::ONE, ffi::ONE_MINUS_SRC_ALPHA); self.gl.BlendFunc(ffi::ONE, ffi::ONE_MINUS_SRC_ALPHA);
} }