From 04124988e8b4a9cdfc5995388ebfaad0005b4b31 Mon Sep 17 00:00:00 2001 From: Tom Englund Date: Sun, 11 May 2025 18:36:20 +0200 Subject: 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. --- src/Compositor.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'src/Compositor.cpp') diff --git a/src/Compositor.cpp b/src/Compositor.cpp index ece6691a..973cb26b 100644 --- a/src/Compositor.cpp +++ b/src/Compositor.cpp @@ -1487,7 +1487,6 @@ void CCompositor::cleanupFadingOut(const MONITORID& monid) { Debug::log(LOG, "Cleanup: destroyed a layersurface"); - glFlush(); // to free mem NOW. return; } } -- cgit v1.2.3