mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-14 23:56:16 +00:00
Rename Buffer/TextureCopyView to ImageCopyBuffer/Texture.
This is to follow the renames in the upstream WebGPU specification. Typedef are left in places to make a smooth deprecation period. Bug: dawn:22 Change-Id: I5134b897930c1fa883c49dd80d2665d6684ec022 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/43882 Auto-Submit: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Austin Eng <enga@chromium.org> Reviewed-by: Brandon Jones <bajones@chromium.org> Commit-Queue: Brandon Jones <bajones@chromium.org>
This commit is contained in:
committed by
Commit Bot service account
parent
2015b2f169
commit
80915849ce
@@ -123,13 +123,14 @@ namespace utils {
|
||||
descriptor.usage = wgpu::TextureUsage::CopyDst | wgpu::TextureUsage::CopySrc;
|
||||
wgpu::Texture texture = device.CreateTexture(&descriptor);
|
||||
|
||||
wgpu::TextureCopyView textureCopyView = utils::CreateTextureCopyView(texture, 0, {0, 0, 0});
|
||||
wgpu::ImageCopyTexture imageCopyTexture =
|
||||
utils::CreateImageCopyTexture(texture, 0, {0, 0, 0});
|
||||
wgpu::TextureDataLayout textureDataLayout =
|
||||
utils::CreateTextureDataLayout(0, wgpu::kCopyStrideUndefined);
|
||||
wgpu::Extent3D copyExtent = {1, 1, 1};
|
||||
|
||||
// WriteTexture with exactly 1 byte of data.
|
||||
device.GetQueue().WriteTexture(&textureCopyView, data.data(), 1, &textureDataLayout,
|
||||
device.GetQueue().WriteTexture(&imageCopyTexture, data.data(), 1, &textureDataLayout,
|
||||
©Extent);
|
||||
}
|
||||
} // namespace utils
|
||||
|
||||
@@ -268,28 +268,28 @@ namespace utils {
|
||||
return BasicRenderPass(width, height, color);
|
||||
}
|
||||
|
||||
wgpu::BufferCopyView CreateBufferCopyView(wgpu::Buffer buffer,
|
||||
uint64_t offset,
|
||||
uint32_t bytesPerRow,
|
||||
uint32_t rowsPerImage) {
|
||||
wgpu::BufferCopyView bufferCopyView = {};
|
||||
bufferCopyView.buffer = buffer;
|
||||
bufferCopyView.layout = CreateTextureDataLayout(offset, bytesPerRow, rowsPerImage);
|
||||
wgpu::ImageCopyBuffer CreateImageCopyBuffer(wgpu::Buffer buffer,
|
||||
uint64_t offset,
|
||||
uint32_t bytesPerRow,
|
||||
uint32_t rowsPerImage) {
|
||||
wgpu::ImageCopyBuffer imageCopyBuffer = {};
|
||||
imageCopyBuffer.buffer = buffer;
|
||||
imageCopyBuffer.layout = CreateTextureDataLayout(offset, bytesPerRow, rowsPerImage);
|
||||
|
||||
return bufferCopyView;
|
||||
return imageCopyBuffer;
|
||||
}
|
||||
|
||||
wgpu::TextureCopyView CreateTextureCopyView(wgpu::Texture texture,
|
||||
uint32_t mipLevel,
|
||||
wgpu::Origin3D origin,
|
||||
wgpu::TextureAspect aspect) {
|
||||
wgpu::TextureCopyView textureCopyView;
|
||||
textureCopyView.texture = texture;
|
||||
textureCopyView.mipLevel = mipLevel;
|
||||
textureCopyView.origin = origin;
|
||||
textureCopyView.aspect = aspect;
|
||||
wgpu::ImageCopyTexture CreateImageCopyTexture(wgpu::Texture texture,
|
||||
uint32_t mipLevel,
|
||||
wgpu::Origin3D origin,
|
||||
wgpu::TextureAspect aspect) {
|
||||
wgpu::ImageCopyTexture imageCopyTexture;
|
||||
imageCopyTexture.texture = texture;
|
||||
imageCopyTexture.mipLevel = mipLevel;
|
||||
imageCopyTexture.origin = origin;
|
||||
imageCopyTexture.aspect = aspect;
|
||||
|
||||
return textureCopyView;
|
||||
return imageCopyTexture;
|
||||
}
|
||||
|
||||
wgpu::TextureDataLayout CreateTextureDataLayout(uint64_t offset,
|
||||
|
||||
@@ -50,11 +50,11 @@ namespace utils {
|
||||
return CreateBufferFromData(device, data.begin(), uint32_t(sizeof(T) * data.size()), usage);
|
||||
}
|
||||
|
||||
wgpu::BufferCopyView CreateBufferCopyView(wgpu::Buffer buffer,
|
||||
uint64_t offset,
|
||||
uint32_t bytesPerRow,
|
||||
uint32_t rowsPerImage = wgpu::kCopyStrideUndefined);
|
||||
wgpu::TextureCopyView CreateTextureCopyView(
|
||||
wgpu::ImageCopyBuffer CreateImageCopyBuffer(wgpu::Buffer buffer,
|
||||
uint64_t offset,
|
||||
uint32_t bytesPerRow,
|
||||
uint32_t rowsPerImage = wgpu::kCopyStrideUndefined);
|
||||
wgpu::ImageCopyTexture CreateImageCopyTexture(
|
||||
wgpu::Texture texture,
|
||||
uint32_t level,
|
||||
wgpu::Origin3D origin,
|
||||
|
||||
Reference in New Issue
Block a user