Commit 7b827596 by Geoff Lang

Fix BufferStorage11::getLatestStorage not finding the latest buffer.

If there are only buffers with data revision 0, getLatestStorage will skip over them. Fixed the if statement so that it will always find a buffer if one exists. BUG=angle:644 Change-Id: I24fc426383c9ae18b7ccf2f8937a9daa7a071ebe Reviewed-on: https://chromium-review.googlesource.com/198826Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Tested-by: 's avatarGeoff Lang <geofflang@chromium.org>
parent d3ff9009
...@@ -478,7 +478,7 @@ BufferStorage11::TypedBufferStorage11 *BufferStorage11::getLatestStorage() const ...@@ -478,7 +478,7 @@ BufferStorage11::TypedBufferStorage11 *BufferStorage11::getLatestStorage() const
for (auto it = mTypedBuffers.begin(); it != mTypedBuffers.end(); it++) for (auto it = mTypedBuffers.begin(); it != mTypedBuffers.end(); it++)
{ {
TypedBufferStorage11 *storage = it->second; TypedBufferStorage11 *storage = it->second;
if (storage->getDataRevision() > latestRevision) if (!latestStorage || storage->getDataRevision() > latestRevision)
{ {
latestStorage = storage; latestStorage = storage;
latestRevision = storage->getDataRevision(); latestRevision = storage->getDataRevision();
......
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