mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-09 13:38:00 +00:00
Change Copy Operation Interfaces to Match WebGPU IDL
Cosmetic changes to copyBufferToTexture and copyTextureToBuffer to match WebGPU IDL. Introduces BufferCopyView, TextureCopyView, TextureAspect, and Origin3D types. Bug: dawn:17 Change-Id: Ic0e7f472a9dc1353d3fc3839ff02f348bb6067e8 Reviewed-on: https://dawn-review.googlesource.com/c/2520 Commit-Queue: Brandon1 Jones <brandon1.jones@intel.com> Reviewed-by: Kai Ninomiya <kainino@chromium.org>
This commit is contained in:
committed by
Commit Bot service account
parent
e06d57d338
commit
ac71e34d4a
@@ -433,9 +433,14 @@ namespace {
|
||||
}
|
||||
|
||||
dawn::Buffer staging = utils::CreateBufferFromData(device, data, rowPitch * iImage.height, dawn::BufferUsageBit::TransferSrc);
|
||||
dawn::BufferCopyView bufferCopyView =
|
||||
utils::CreateBufferCopyView(staging, 0, rowPitch, 0);
|
||||
dawn::TextureCopyView textureCopyView =
|
||||
utils::CreateTextureCopyView(oTexture, 0, 0, {0, 0, 0}, dawn::TextureAspect::Color);
|
||||
dawn::Extent3D copySize = {iImage.width, iImage.height, 1};
|
||||
auto cmdbuf = device.CreateCommandBufferBuilder()
|
||||
.CopyBufferToTexture(staging, 0, rowPitch, oTexture, 0, 0, 0, iImage.width, iImage.height, 1, 0, 0)
|
||||
.GetResult();
|
||||
.CopyBufferToTexture(&bufferCopyView, &textureCopyView, ©Size)
|
||||
.GetResult();
|
||||
queue.Submit(1, &cmdbuf);
|
||||
|
||||
textures[iTextureID] = oTexture.CreateDefaultTextureView();
|
||||
|
||||
Reference in New Issue
Block a user