[Mesa-dev] Re-linking warnings and optimization

Kenneth Graunke kenneth at whitecape.org
Wed May 14 17:28:11 PDT 2014


Hi all,

Here's a series of patches which implements warnings related to re-linking
shader programs:

1. If you draw with a shader that needs re-linking, it gives you a warning.
   Most likely you simply forgot, and will be surprised by the results.
   Occasionally you might have meant to do that.

2. If you call LinkProgram when it doesn't need re-linking, it gives you
   a low severity performance warning, since you asked GL to do pointless
   work.

Then, the patch series relaxes some "need to relink" conditions (if you
bind attributes to the same values).  More could be done here.

With those in place, one unreleased game I was looking at issues piles of
warnings about unnecessary linking, and then later issues piles of draw-time
warnings about the need to re-link.  I really don't know what's going on
there.

Finally, I made LinkProgram bail entirely when unnecessarily.  The game
and Piglit seem fine with this, so I think my tracking is OK.  But, I'm
not sure if we really want to do it.

I'm also not super excited about the extra draw time overhead - especially
checking for shader recompiles.

--Ken



More information about the mesa-dev mailing list