Commit 91bc2907 by Geoff Lang Committed by Commit Bot

D3D11: Add support for pack parameters when packing to PBOs.

BUG=angleproject:1268 TEST=conformance2/reading/read-pixels-pack-parameters.html Change-Id: Ia7d69bdabd94d146bc027e6a6d3bb619b1ada2e8 Reviewed-on: https://chromium-review.googlesource.com/360491Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
parent aeb477fb
......@@ -1267,9 +1267,16 @@ gl::ErrorOrResult<CopyResult> Buffer11::PackStorage::copyFromStorage(BufferStora
size_t size,
size_t destOffset)
{
// We copy through a staging buffer when drawing with a pack buffer,
// or for other cases where we access the pack buffer
UNREACHABLE();
ANGLE_TRY(flushQueuedPackCommand());
// We copy through a staging buffer when drawing with a pack buffer, or for other cases where we
// access the pack buffer
ASSERT(source->isMappable() && source->getUsage() == BUFFER_USAGE_STAGING);
uint8_t *sourceData = nullptr;
ANGLE_TRY(source->map(sourceOffset, size, GL_MAP_READ_BIT, &sourceData));
ASSERT(destOffset + size <= mMemoryBuffer.size());
memcpy(mMemoryBuffer.data() + destOffset, sourceData, size);
source->unmap();
return CopyResult::NOT_RECREATED;
}
......
......@@ -262,13 +262,6 @@ gl::Error Framebuffer11::readPixelsImpl(const gl::Rectangle &area,
gl::Buffer *packBuffer = pack.pixelBuffer.get();
if (packBuffer != nullptr)
{
if (pack.rowLength != 0 || pack.skipRows != 0 || pack.skipPixels != 0)
{
UNIMPLEMENTED();
return gl::Error(GL_INVALID_OPERATION,
"Unimplemented pixel store parameters in readPixelsImpl");
}
Buffer11 *packBufferStorage = GetImplAs<Buffer11>(packBuffer);
PackPixelsParams packParams(area, format, type, static_cast<GLuint>(outputPitch), pack,
reinterpret_cast<ptrdiff_t>(pixels));
......
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