mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-14 07:36:15 +00:00
Cleanup CopyBufferToBufferCmd
This command internally used a BufferCopy struct which is meant for Buffer->Texture / Texture->Buffer copies. It contained unnecessary rowPitch and imageHeight. This patch changes the members of CopyBufferToBufferCmd to match the CopyBufferToBuffer api call. Bug: dawn:164 Change-Id: I4737eb4ceb655e8282964c438242627070e355dc Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/6320 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Kai Ninomiya <kainino@chromium.org> Commit-Queue: Austin Eng <enga@chromium.org>
This commit is contained in:
committed by
Commit Bot service account
parent
2d4b529443
commit
fa7228a1fa
@@ -360,13 +360,11 @@ namespace dawn_native { namespace opengl {
|
||||
|
||||
case Command::CopyBufferToBuffer: {
|
||||
CopyBufferToBufferCmd* copy = mCommands.NextCommand<CopyBufferToBufferCmd>();
|
||||
auto& src = copy->source;
|
||||
auto& dst = copy->destination;
|
||||
|
||||
glBindBuffer(GL_PIXEL_PACK_BUFFER, ToBackend(src.buffer)->GetHandle());
|
||||
glBindBuffer(GL_PIXEL_UNPACK_BUFFER, ToBackend(dst.buffer)->GetHandle());
|
||||
glCopyBufferSubData(GL_PIXEL_PACK_BUFFER, GL_PIXEL_UNPACK_BUFFER, src.offset,
|
||||
dst.offset, copy->size);
|
||||
glBindBuffer(GL_PIXEL_PACK_BUFFER, ToBackend(copy->source)->GetHandle());
|
||||
glBindBuffer(GL_PIXEL_UNPACK_BUFFER, ToBackend(copy->destination)->GetHandle());
|
||||
glCopyBufferSubData(GL_PIXEL_PACK_BUFFER, GL_PIXEL_UNPACK_BUFFER,
|
||||
copy->sourceOffset, copy->destinationOffset, copy->size);
|
||||
|
||||
glBindBuffer(GL_PIXEL_PACK_BUFFER, 0);
|
||||
glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0);
|
||||
|
||||
Reference in New Issue
Block a user