SIGN IN SIGN UP

gl: reduce redundant per-draw setup

GL tasks repeat resource queries and state changes on each draw, even
when the requested state is already active. Images and gradients pay
the highest cost because they bind more resources.

Benchmarks show image performance nearly doubles. Linear gradients
improve by about 2.1x and radial gradients by about 1.7x, while pixel
output and simple-geometry performance remain unchanged.

Reuse renderer-owned state and immutable program lookups so each draw
issues only the changes it needs. Invalidate mutable assumptions at
sync boundaries and preserve the existing cleanup behavior.

Callers sharing a GL context must rebind their own state after sync().

issue: #4555
J
Jay Shen committed
bc71d1076bf571e4b9c5dcd7e3d70eecd9defd62
Parent: b32227b
Committed by Hermet Park <hermetpark@gmail.com> on 8/20/2026, 12:51:13 AM