Optimize resolveLink.

This changes the program query to resolve the link if required. If the
validation layer is skipped the link is resolved in the gl::Context.
Resolving the link on program query allows us to avoid resolving the
link on most of the gl::Program query APIs.

This improves inlining and particularly affects uniform update. It
fixes a performance regression introduced by the parallel shader
linking extension. Gives a 17% increased score on a uniform benchmark.

Also fixes two missing cases of checking for the extension in our
validation code.

Note that some bugs might still exist when the validation layer is
disabled.

Bug: angleproject:2851
Change-Id: I5d725eede3fa147cedf2ce0129791b3412a97a61
Reviewed-on: https://chromium-review.googlesource.com/1255509
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Yuly Novikov <ynovikov@google.com>
diff --git a/src/libANGLE/Framebuffer.cpp b/src/libANGLE/Framebuffer.cpp
index 0081845..b3765f8 100644
--- a/src/libANGLE/Framebuffer.cpp
+++ b/src/libANGLE/Framebuffer.cpp
@@ -1859,7 +1859,7 @@
 
 bool Framebuffer::formsRenderingFeedbackLoopWith(const State &state) const
 {
-    const Program *program = state.getProgram();
+    const Program *program = state.getLinkedProgram();
 
     // TODO(jmadill): Default framebuffer feedback loops.
     if (mState.mId == 0)