mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-13 15:16:16 +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
@@ -68,11 +68,15 @@ void initTextures() {
|
||||
data[i] = static_cast<uint8_t>(i % 253);
|
||||
}
|
||||
|
||||
|
||||
dawn::Buffer stagingBuffer = utils::CreateBufferFromData(device, data.data(), static_cast<uint32_t>(data.size()), dawn::BufferUsageBit::TransferSrc);
|
||||
dawn::CommandBuffer copy = device.CreateCommandBufferBuilder()
|
||||
.CopyBufferToTexture(stagingBuffer, 0, 0, texture, 0, 0, 0, 1024, 1024, 1, 0, 0)
|
||||
.GetResult();
|
||||
dawn::BufferCopyView bufferCopyView = utils::CreateBufferCopyView(stagingBuffer, 0, 0, 0);
|
||||
dawn::TextureCopyView textureCopyView =
|
||||
utils::CreateTextureCopyView(texture, 0, 0, {0, 0, 0}, dawn::TextureAspect::Color);
|
||||
dawn::Extent3D copySize = {1024, 1024, 1};
|
||||
dawn::CommandBuffer copy =
|
||||
device.CreateCommandBufferBuilder()
|
||||
.CopyBufferToTexture(&bufferCopyView, &textureCopyView, ©Size)
|
||||
.GetResult();
|
||||
|
||||
queue.Submit(1, ©);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user