diff --git a/src/libANGLE/Program.cpp b/src/libANGLE/Program.cpp index 49a6f848b..922494315 100644 --- a/src/libANGLE/Program.cpp +++ b/src/libANGLE/Program.cpp @@ -1201,6 +1201,13 @@ angle::Result Program::linkImpl(const Context *context) mState.mInfoLog.reset(); + // Validate we have properly attached shaders before checking the cache. + if (!linkValidateShaders(context)) + { + return angle::Result::Continue; + } + linkShaders(); + egl::BlobCache::Key programHash = {0}; MemoryProgramCache *cache = context->getMemoryProgramCache(); @@ -1231,14 +1238,7 @@ angle::Result Program::linkImpl(const Context *context) // Cache load failed, fall through to normal linking. unlink(); - // Validate we have properly attached shaders after checking the cache. Since the input to the - // shaders is part of the cache key, if there was a cache hit, the shaders would have linked - // correctly. - if (!linkValidateShaders(context)) - { - return angle::Result::Continue; - } - + // Re-link shaders after the unlink call. linkShaders(); ProgramMergedVaryings mergedVaryings;