Commit 385fb40f by Jamie Madill Committed by Commit Bot

Capture/Replay: Don't capture deleted shaders.

ANGLE can sometimes hold on to deleted shaders while they're still in use. This would happen when re-capturing captured application. A bunch of shaders would be still around after used in the program linking step because they are still attached to the program. Fix this by not skipping the capture for shader that have been deleted but are still in the resource map. Noticed while capturing the T-Rex replay. Bug: angleproject:5134 Change-Id: I04e3e96b43e445d7b467e6db0325ecd0d821549d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2449162 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarCody Northrop <cnorthrop@google.com> Reviewed-by: 's avatarCourtney Goeltzenleuchter <courtneygo@google.com>
parent 2441399f
......@@ -2883,6 +2883,13 @@ void CaptureMidExecutionSetup(const gl::Context *context,
{
gl::ShaderProgramID id = {shaderIter.first};
gl::Shader *shader = shaderIter.second;
// Skip shaders scheduled for deletion.
if (shader->hasBeenDeleted())
{
continue;
}
cap(CaptureCreateShader(replayState, true, shader->getType(), id.value));
std::string shaderSource = shader->getSourceString();
......
......@@ -226,6 +226,7 @@ class Shader final : angle::NonCopyable, public LabeledObject
}
unsigned int getMaxComputeSharedMemory() const { return mMaxComputeSharedMemory; }
bool hasBeenDeleted() const { return mDeleteStatus; }
private:
struct CompilingState;
......
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