Commit a1b4a1f3 by Tim Van Patten Committed by Commit Bot

Capture/Replay: Only get source for linked programs

CaptureMidExecutionSetup() currently assumes that all created programs have also been linked, since mCachedProgramSources is only updated when glLinkProgram() is called. However, a call to glCreateProgram() doesn't necessitate a call to glLinkProgram(). This leads to hitting an assert in FrameCaptureShared::getProgramSources() when iterating all glCreateProgram()'ed programs, but doesn't find that it in the list of linked programs. This fix is to move the program->isLinked() call earlier. Bug: angleproject:5545 Change-Id: I49fdec08de1c2767fe7f6a08fd0a9d53fa865167 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2629789Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Tim Van Patten <timvp@google.com>
parent e357cc6f
...@@ -2825,16 +2825,16 @@ void CaptureMidExecutionSetup(const gl::Context *context, ...@@ -2825,16 +2825,16 @@ void CaptureMidExecutionSetup(const gl::Context *context,
gl::ShaderProgramID id = {programIter.first}; gl::ShaderProgramID id = {programIter.first};
const gl::Program *program = programIter.second; const gl::Program *program = programIter.second;
// Get last compiled shader source.
const ProgramSources &linkedSources =
context->getShareGroup()->getFrameCaptureShared()->getProgramSources(id);
// Unlinked programs don't have an executable. Thus they don't need to be linked. // Unlinked programs don't have an executable. Thus they don't need to be linked.
if (!program->isLinked()) if (!program->isLinked())
{ {
continue; continue;
} }
// Get last linked shader source.
const ProgramSources &linkedSources =
context->getShareGroup()->getFrameCaptureShared()->getProgramSources(id);
cap(CaptureCreateProgram(replayState, true, id.value)); cap(CaptureCreateProgram(replayState, true, id.value));
// Compile with last linked sources. // Compile with last linked sources.
......
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