ngl: apply fewer uniforms
Two commits here:
- First is relatively cheap check to avoid comparing when two uniforms are known to be the same
- Second further compares uniforms (like early prototypes) to avoid changing state while building batches
Combined, they should reduce number of glUniform*
calls.
Not really much of a performance difference though, trading some function calls into GL for some memcmp's.
It should make apitrace output less chatty though.
Tested on xorg/nvidia and macos without much difference, so im fine with it if we want lighter traces.