Commit 3b5ffe5c by Jamie Madill Committed by Commit Bot

Fix ASSERT in Buffer11::PackStorage::copyFromStorage.

This ASSERT was being overly restrictive, when the code would work correctly when reading from system memory storage as well as staging. BUG=angleproject:1555 Change-Id: Ib45185d8c127a1fb2ce54db9e96fe41d68d5ff2e Reviewed-on: https://chromium-review.googlesource.com/402269Reviewed-by: 's avatarZhenyao Mo <zmo@chromium.org> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
parent 2a1e8b6b
...@@ -1321,9 +1321,8 @@ gl::ErrorOrResult<CopyResult> Buffer11::PackStorage::copyFromStorage(BufferStora ...@@ -1321,9 +1321,8 @@ gl::ErrorOrResult<CopyResult> Buffer11::PackStorage::copyFromStorage(BufferStora
{ {
ANGLE_TRY(flushQueuedPackCommand()); ANGLE_TRY(flushQueuedPackCommand());
// We copy through a staging buffer when drawing with a pack buffer, or for other cases where we // For all use cases of pack buffers, we must copy through a readable buffer.
// access the pack buffer ASSERT(source->isMappable(GL_MAP_READ_BIT));
ASSERT(source->isMappable(GL_MAP_READ_BIT) && source->getUsage() == BUFFER_USAGE_STAGING);
uint8_t *sourceData = nullptr; uint8_t *sourceData = nullptr;
ANGLE_TRY(source->map(sourceOffset, size, GL_MAP_READ_BIT, &sourceData)); ANGLE_TRY(source->map(sourceOffset, size, GL_MAP_READ_BIT, &sourceData));
ASSERT(destOffset + size <= mMemoryBuffer.size()); ASSERT(destOffset + size <= mMemoryBuffer.size());
......
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