Capture/Replay: Ignore delete of non-genned buffers

Instead of asserting that the app is calling glDeleteBuffers
on buffers we've seen created, ignore buffer names that we
haven't seen. This is allowed by the spec:

  Buffer objects are deleted by calling
    void DeleteBuffers(sizei n, const uint *buffers);
  Unused names in buffers are silently ignored, as is the value zero.

Test: SAKURA School Simulator MEC
Bug: b/188488065
Bug: angleproject:5987
Change-Id: Id4704e544f644dbe3edf6efdf70b5c3ef9ccaba7
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2902442
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Tim Van Patten <timvp@google.com>
Commit-Queue: Cody Northrop <cnorthrop@google.com>
This commit is contained in:
Cody Northrop 2021-05-17 23:05:16 -06:00 коммит произвёл Commit Bot
Родитель 47e008c242
Коммит 40f11af89e
1 изменённых файлов: 9 добавлений и 6 удалений

Просмотреть файл

@ -4939,13 +4939,16 @@ void ResourceTracker::setDeletedBuffer(gl::BufferID id)
return;
}
// Ensure this buffer was in our starting set
// It's possible this could fire if the app deletes buffers that were never generated
ASSERT(mStartingBuffers.empty() || (mStartingBuffers.find(id) != mStartingBuffers.end()));
if (mStartingBuffers.find(id) != mStartingBuffers.end())
{
// The app is deleting a buffer we started with, we need to regen on loop
mBuffersToRegen.insert(id);
mBuffersToRestore.insert(id);
}
// In this case, the app is deleting a buffer we started with, we need to regen on loop
mBuffersToRegen.insert(id);
mBuffersToRestore.insert(id);
// If none of the above is true, the app is deleting a buffer that was never genned.
// This is allowed by the spec for DeleteBuffers:
// Unused names in buffers are silently ignored, as is the value zero.
}
void ResourceTracker::setDeletedFenceSync(GLsync sync)