Commit 12515425 by Jamie Madill Committed by Commit Bot

Remove context from linking state.

This Context could already be deleted from another thread. Better to use save/load with the current thread. Bug: angleproject:2464 Change-Id: Id7879a53bdfb7d1c86b09bb3e779a87afdefa873 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1756086Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Reviewed-by: 's avatarTobin Ehlis <tobine@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
parent 791e19e7
......@@ -737,7 +737,6 @@ size_t CountUniqueBlocks(const std::vector<InterfaceBlock> &blocks)
// Saves the linking context for later use in resolveLink().
struct Program::LinkingState
{
const Context *context;
std::unique_ptr<ProgramLinkedResources> resources;
egl::BlobCache::Key programHash;
std::unique_ptr<rx::LinkEvent> linkEvent;
......@@ -1488,7 +1487,6 @@ angle::Result Program::link(const Context *context)
updateLinkedShaderStages();
mLinkingState.reset(new LinkingState());
mLinkingState->context = context;
mLinkingState->linkingFromBinary = false;
mLinkingState->programHash = programHash;
mLinkingState->linkEvent = mProgram->link(context, *resources, mInfoLog);
......@@ -1541,12 +1539,12 @@ void Program::resolveLinkImpl(const Context *context)
setUniformValuesFromBindingQualifiers();
// Save to the program cache.
auto *cache = linkingState->context->getMemoryProgramCache();
if (cache && (mState.mLinkedTransformFeedbackVaryings.empty() ||
!linkingState->context->getFrontendFeatures()
.disableProgramCachingForTransformFeedback.enabled))
MemoryProgramCache *cache = context->getMemoryProgramCache();
if (cache &&
(mState.mLinkedTransformFeedbackVaryings.empty() ||
!context->getFrontendFeatures().disableProgramCachingForTransformFeedback.enabled))
{
cache->putProgram(linkingState->programHash, linkingState->context, this);
cache->putProgram(linkingState->programHash, context, this);
}
}
......@@ -1703,7 +1701,6 @@ angle::Result Program::loadBinary(const Context *context,
}
mLinkingState.reset(new LinkingState());
mLinkingState->context = context;
mLinkingState->linkingFromBinary = true;
mLinkingState->linkEvent = mProgram->load(context, &stream, mInfoLog);
mLinkResolved = false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment