On 05/14/2014 06:28 PM, Kenneth Graunke wrote:
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.
Reviewed-by: Brian Paul <bri...@vmware.com>
The series looks good to me. I think it's great to have extra sanity
checking like this to help find bugs or inefficient API usage.
As far as draw-time overhead, I wonder if some of this should be
predicated on whether we're using a debug context (a context created
with the GLX_CONTEXT_DEBUG_BIT_ARB flag). We could also have an env var
to force GLX_CONTEXT_DEBUG_BIT_ARB to true for testing purposes.
-Brian
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev