mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-06 23:21:57 -07:00
opengl: optimize shaders and reduce unneeded drawcalls (#10364)
* opengl: remove unnecessery glflush calls glflushing forces the driver to break batching and issue commands prematurely and prevents optimisations like command reordering and merging. many glFunctions already internally glflushes and eglsync creation still has a glflush at end render. so lets reduce the overhead of these calls. * opengl: reduce glUseProgram calls apitrace shows cases where the same program gets called multiple times, add a helper function that keeps track of current program and only call it once on same program. reduces slight overhead. * opengl: use more efficient vertex array object use a more modern vertex array object approach with the shaders, makes it a onetime setup on shader creation instead of once per drawcall, also should make the driver not have to revalidate the vertex format on each call.
This commit is contained in:
@@ -2280,9 +2280,6 @@ void CHyprRenderer::endRender(const std::function<void()>& renderingDoneCallback
|
||||
g_pHyprOpenGL->m_renderData.mouseZoomUseMouse = true;
|
||||
}
|
||||
|
||||
// send all queued opengl commands so rendering starts happening immediately
|
||||
glFlush();
|
||||
|
||||
if (m_renderMode == RENDER_MODE_FULL_FAKE)
|
||||
return;
|
||||
|
||||
|
Reference in New Issue
Block a user