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:
parent
8bd17d71d2
commit
00fb4561b7
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue