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>
diff --git a/src/dawn_native/CommandEncoder.cpp b/src/dawn_native/CommandEncoder.cpp
index 26992a8..9c85531 100644
--- a/src/dawn_native/CommandEncoder.cpp
+++ b/src/dawn_native/CommandEncoder.cpp
@@ -77,9 +77,10 @@
return {};
}
- MaybeError ValidateTextureDepthStencilToBufferCopyRestrictions(const TextureCopyView& src) {
+ MaybeError ValidateTextureDepthStencilToBufferCopyRestrictions(
+ const ImageCopyTexture& src) {
Aspect aspectUsed;
- DAWN_TRY_ASSIGN(aspectUsed, SingleAspectUsedByTextureCopyView(src));
+ DAWN_TRY_ASSIGN(aspectUsed, SingleAspectUsedByImageCopyTexture(src));
if (aspectUsed == Aspect::Depth) {
switch (src.texture->GetFormat().format) {
case wgpu::TextureFormat::Depth24Plus:
@@ -621,15 +622,15 @@
});
}
- void CommandEncoder::CopyBufferToTexture(const BufferCopyView* source,
- const TextureCopyView* destination,
+ void CommandEncoder::CopyBufferToTexture(const ImageCopyBuffer* source,
+ const ImageCopyTexture* destination,
const Extent3D* copySize) {
mEncodingContext.TryEncode(this, [&](CommandAllocator* allocator) -> MaybeError {
if (GetDevice()->IsValidationEnabled()) {
- DAWN_TRY(ValidateBufferCopyView(GetDevice(), *source));
+ DAWN_TRY(ValidateImageCopyBuffer(GetDevice(), *source));
DAWN_TRY(ValidateCanUseAs(source->buffer, wgpu::BufferUsage::CopySrc));
- DAWN_TRY(ValidateTextureCopyView(GetDevice(), *destination, *copySize));
+ DAWN_TRY(ValidateImageCopyTexture(GetDevice(), *destination, *copySize));
DAWN_TRY(ValidateCanUseAs(destination->texture, wgpu::TextureUsage::CopyDst));
DAWN_TRY(ValidateTextureSampleCountInBufferCopyCommands(destination->texture));
@@ -676,17 +677,17 @@
});
}
- void CommandEncoder::CopyTextureToBuffer(const TextureCopyView* source,
- const BufferCopyView* destination,
+ void CommandEncoder::CopyTextureToBuffer(const ImageCopyTexture* source,
+ const ImageCopyBuffer* destination,
const Extent3D* copySize) {
mEncodingContext.TryEncode(this, [&](CommandAllocator* allocator) -> MaybeError {
if (GetDevice()->IsValidationEnabled()) {
- DAWN_TRY(ValidateTextureCopyView(GetDevice(), *source, *copySize));
+ DAWN_TRY(ValidateImageCopyTexture(GetDevice(), *source, *copySize));
DAWN_TRY(ValidateCanUseAs(source->texture, wgpu::TextureUsage::CopySrc));
DAWN_TRY(ValidateTextureSampleCountInBufferCopyCommands(source->texture));
DAWN_TRY(ValidateTextureDepthStencilToBufferCopyRestrictions(*source));
- DAWN_TRY(ValidateBufferCopyView(GetDevice(), *destination));
+ DAWN_TRY(ValidateImageCopyBuffer(GetDevice(), *destination));
DAWN_TRY(ValidateCanUseAs(destination->buffer, wgpu::BufferUsage::CopyDst));
// We validate texture copy range before validating linear texture data,
@@ -730,16 +731,16 @@
});
}
- void CommandEncoder::CopyTextureToTexture(const TextureCopyView* source,
- const TextureCopyView* destination,
+ void CommandEncoder::CopyTextureToTexture(const ImageCopyTexture* source,
+ const ImageCopyTexture* destination,
const Extent3D* copySize) {
mEncodingContext.TryEncode(this, [&](CommandAllocator* allocator) -> MaybeError {
if (GetDevice()->IsValidationEnabled()) {
DAWN_TRY(GetDevice()->ValidateObject(source->texture));
DAWN_TRY(GetDevice()->ValidateObject(destination->texture));
- DAWN_TRY(ValidateTextureCopyView(GetDevice(), *source, *copySize));
- DAWN_TRY(ValidateTextureCopyView(GetDevice(), *destination, *copySize));
+ DAWN_TRY(ValidateImageCopyTexture(GetDevice(), *source, *copySize));
+ DAWN_TRY(ValidateImageCopyTexture(GetDevice(), *destination, *copySize));
DAWN_TRY(
ValidateTextureToTextureCopyRestrictions(*source, *destination, *copySize));
diff --git a/src/dawn_native/CommandEncoder.h b/src/dawn_native/CommandEncoder.h
index 6698396..0abab3a 100644
--- a/src/dawn_native/CommandEncoder.h
+++ b/src/dawn_native/CommandEncoder.h
@@ -49,14 +49,14 @@
BufferBase* destination,
uint64_t destinationOffset,
uint64_t size);
- void CopyBufferToTexture(const BufferCopyView* source,
- const TextureCopyView* destination,
+ void CopyBufferToTexture(const ImageCopyBuffer* source,
+ const ImageCopyTexture* destination,
const Extent3D* copySize);
- void CopyTextureToBuffer(const TextureCopyView* source,
- const BufferCopyView* destination,
+ void CopyTextureToBuffer(const ImageCopyTexture* source,
+ const ImageCopyBuffer* destination,
const Extent3D* copySize);
- void CopyTextureToTexture(const TextureCopyView* source,
- const TextureCopyView* destination,
+ void CopyTextureToTexture(const ImageCopyTexture* source,
+ const ImageCopyTexture* destination,
const Extent3D* copySize);
void InjectValidationError(const char* message);
diff --git a/src/dawn_native/CommandValidation.cpp b/src/dawn_native/CommandValidation.cpp
index 174510b..e8e2b2e 100644
--- a/src/dawn_native/CommandValidation.cpp
+++ b/src/dawn_native/CommandValidation.cpp
@@ -265,11 +265,11 @@
return {};
}
- MaybeError ValidateBufferCopyView(DeviceBase const* device,
- const BufferCopyView& bufferCopyView) {
- DAWN_TRY(device->ValidateObject(bufferCopyView.buffer));
- if (bufferCopyView.layout.bytesPerRow != wgpu::kCopyStrideUndefined) {
- if (bufferCopyView.layout.bytesPerRow % kTextureBytesPerRowAlignment != 0) {
+ MaybeError ValidateImageCopyBuffer(DeviceBase const* device,
+ const ImageCopyBuffer& imageCopyBuffer) {
+ DAWN_TRY(device->ValidateObject(imageCopyBuffer.buffer));
+ if (imageCopyBuffer.layout.bytesPerRow != wgpu::kCopyStrideUndefined) {
+ if (imageCopyBuffer.layout.bytesPerRow % kTextureBytesPerRowAlignment != 0) {
return DAWN_VALIDATION_ERROR("bytesPerRow must be a multiple of 256");
}
}
@@ -277,9 +277,9 @@
return {};
}
- MaybeError ValidateTextureCopyView(DeviceBase const* device,
- const TextureCopyView& textureCopy,
- const Extent3D& copySize) {
+ MaybeError ValidateImageCopyTexture(DeviceBase const* device,
+ const ImageCopyTexture& textureCopy,
+ const Extent3D& copySize) {
const TextureBase* texture = textureCopy.texture;
DAWN_TRY(device->ValidateObject(texture));
if (textureCopy.mipLevel >= texture->GetNumMipLevels()) {
@@ -305,7 +305,7 @@
return {};
}
- MaybeError ValidateTextureCopyRange(const TextureCopyView& textureCopy,
+ MaybeError ValidateTextureCopyRange(const ImageCopyTexture& textureCopy,
const Extent3D& copySize) {
// TODO(jiawei.shao@intel.com): add validations on the texture-to-texture copies within the
// same texture.
@@ -357,7 +357,7 @@
// Always returns a single aspect (color, stencil, depth, or ith plane for multi-planar
// formats).
- ResultOrError<Aspect> SingleAspectUsedByTextureCopyView(const TextureCopyView& view) {
+ ResultOrError<Aspect> SingleAspectUsedByImageCopyTexture(const ImageCopyTexture& view) {
const Format& format = view.texture->GetFormat();
switch (view.aspect) {
case wgpu::TextureAspect::All:
@@ -382,9 +382,9 @@
}
}
- MaybeError ValidateLinearToDepthStencilCopyRestrictions(const TextureCopyView& dst) {
+ MaybeError ValidateLinearToDepthStencilCopyRestrictions(const ImageCopyTexture& dst) {
Aspect aspectUsed;
- DAWN_TRY_ASSIGN(aspectUsed, SingleAspectUsedByTextureCopyView(dst));
+ DAWN_TRY_ASSIGN(aspectUsed, SingleAspectUsedByImageCopyTexture(dst));
if (aspectUsed == Aspect::Depth) {
return DAWN_VALIDATION_ERROR("Cannot copy into the depth aspect of a texture");
}
@@ -392,8 +392,8 @@
return {};
}
- MaybeError ValidateTextureToTextureCopyRestrictions(const TextureCopyView& src,
- const TextureCopyView& dst,
+ MaybeError ValidateTextureToTextureCopyRestrictions(const ImageCopyTexture& src,
+ const ImageCopyTexture& dst,
const Extent3D& copySize) {
const uint32_t srcSamples = src.texture->GetSampleCount();
const uint32_t dstSamples = dst.texture->GetSampleCount();
diff --git a/src/dawn_native/CommandValidation.h b/src/dawn_native/CommandValidation.h
index f0fbb10..f6dc60a 100644
--- a/src/dawn_native/CommandValidation.h
+++ b/src/dawn_native/CommandValidation.h
@@ -48,16 +48,16 @@
uint64_t byteSize,
const TexelBlockInfo& blockInfo,
const Extent3D& copyExtent);
- MaybeError ValidateTextureCopyRange(const TextureCopyView& textureCopyView,
+ MaybeError ValidateTextureCopyRange(const ImageCopyTexture& imageCopyTexture,
const Extent3D& copySize);
- ResultOrError<Aspect> SingleAspectUsedByTextureCopyView(const TextureCopyView& view);
- MaybeError ValidateLinearToDepthStencilCopyRestrictions(const TextureCopyView& dst);
+ ResultOrError<Aspect> SingleAspectUsedByImageCopyTexture(const ImageCopyTexture& view);
+ MaybeError ValidateLinearToDepthStencilCopyRestrictions(const ImageCopyTexture& dst);
- MaybeError ValidateBufferCopyView(DeviceBase const* device,
- const BufferCopyView& bufferCopyView);
- MaybeError ValidateTextureCopyView(DeviceBase const* device,
- const TextureCopyView& textureCopyView,
- const Extent3D& copySize);
+ MaybeError ValidateImageCopyBuffer(DeviceBase const* device,
+ const ImageCopyBuffer& imageCopyBuffer);
+ MaybeError ValidateImageCopyTexture(DeviceBase const* device,
+ const ImageCopyTexture& imageCopyTexture,
+ const Extent3D& copySize);
MaybeError ValidateRowsPerImage(const Format& format,
uint32_t rowsPerImage,
@@ -71,8 +71,8 @@
bool IsRangeOverlapped(uint32_t startA, uint32_t startB, uint32_t length);
- MaybeError ValidateTextureToTextureCopyRestrictions(const TextureCopyView& src,
- const TextureCopyView& dst,
+ MaybeError ValidateTextureToTextureCopyRestrictions(const ImageCopyTexture& src,
+ const ImageCopyTexture& dst,
const Extent3D& copySize);
MaybeError ValidateCanUseAs(const TextureBase* texture, wgpu::TextureUsage usage);
diff --git a/src/dawn_native/CopyTextureForBrowserHelper.cpp b/src/dawn_native/CopyTextureForBrowserHelper.cpp
index cd1fac6..0a7a87f 100644
--- a/src/dawn_native/CopyTextureForBrowserHelper.cpp
+++ b/src/dawn_native/CopyTextureForBrowserHelper.cpp
@@ -170,15 +170,15 @@
} // anonymous namespace
MaybeError ValidateCopyTextureForBrowser(DeviceBase* device,
- const TextureCopyView* source,
- const TextureCopyView* destination,
+ const ImageCopyTexture* source,
+ const ImageCopyTexture* destination,
const Extent3D* copySize,
const CopyTextureForBrowserOptions* options) {
DAWN_TRY(device->ValidateObject(source->texture));
DAWN_TRY(device->ValidateObject(destination->texture));
- DAWN_TRY(ValidateTextureCopyView(device, *source, *copySize));
- DAWN_TRY(ValidateTextureCopyView(device, *destination, *copySize));
+ DAWN_TRY(ValidateImageCopyTexture(device, *source, *copySize));
+ DAWN_TRY(ValidateImageCopyTexture(device, *destination, *copySize));
DAWN_TRY(ValidateTextureToTextureCopyRestrictions(*source, *destination, *copySize));
@@ -208,8 +208,8 @@
}
MaybeError DoCopyTextureForBrowser(DeviceBase* device,
- const TextureCopyView* source,
- const TextureCopyView* destination,
+ const ImageCopyTexture* source,
+ const ImageCopyTexture* destination,
const Extent3D* copySize,
const CopyTextureForBrowserOptions* options) {
// TODO(shaobo.yan@intel.com): In D3D12 and Vulkan, compatible texture format can directly
diff --git a/src/dawn_native/CopyTextureForBrowserHelper.h b/src/dawn_native/CopyTextureForBrowserHelper.h
index e65a37e..e0965ab 100644
--- a/src/dawn_native/CopyTextureForBrowserHelper.h
+++ b/src/dawn_native/CopyTextureForBrowserHelper.h
@@ -21,18 +21,18 @@
namespace dawn_native {
class DeviceBase;
struct Extent3D;
- struct TextureCopyView;
+ struct ImageCopyTexture;
struct CopyTextureForBrowserOptions;
MaybeError ValidateCopyTextureForBrowser(DeviceBase* device,
- const TextureCopyView* source,
- const TextureCopyView* destination,
+ const ImageCopyTexture* source,
+ const ImageCopyTexture* destination,
const Extent3D* copySize,
const CopyTextureForBrowserOptions* options);
MaybeError DoCopyTextureForBrowser(DeviceBase* device,
- const TextureCopyView* source,
- const TextureCopyView* destination,
+ const ImageCopyTexture* source,
+ const ImageCopyTexture* destination,
const Extent3D* copySize,
const CopyTextureForBrowserOptions* options);
diff --git a/src/dawn_native/Queue.cpp b/src/dawn_native/Queue.cpp
index 5560ca6..e3e9141 100644
--- a/src/dawn_native/Queue.cpp
+++ b/src/dawn_native/Queue.cpp
@@ -291,7 +291,7 @@
buffer, bufferOffset, size);
}
- void QueueBase::WriteTexture(const TextureCopyView* destination,
+ void QueueBase::WriteTexture(const ImageCopyTexture* destination,
const void* data,
size_t dataSize,
const TextureDataLayout* dataLayout,
@@ -300,7 +300,7 @@
WriteTextureInternal(destination, data, dataSize, dataLayout, writeSize));
}
- MaybeError QueueBase::WriteTextureInternal(const TextureCopyView* destination,
+ MaybeError QueueBase::WriteTextureInternal(const ImageCopyTexture* destination,
const void* data,
size_t dataSize,
const TextureDataLayout* dataLayout,
@@ -318,7 +318,7 @@
return WriteTextureImpl(*destination, data, layout, *writeSize);
}
- MaybeError QueueBase::WriteTextureImpl(const TextureCopyView& destination,
+ MaybeError QueueBase::WriteTextureImpl(const ImageCopyTexture& destination,
const void* data,
const TextureDataLayout& dataLayout,
const Extent3D& writeSizePixel) {
@@ -362,8 +362,8 @@
&textureCopy, writeSizePixel);
}
- void QueueBase::CopyTextureForBrowser(const TextureCopyView* source,
- const TextureCopyView* destination,
+ void QueueBase::CopyTextureForBrowser(const ImageCopyTexture* source,
+ const ImageCopyTexture* destination,
const Extent3D* copySize,
const CopyTextureForBrowserOptions* options) {
GetDevice()->ConsumedError(
@@ -371,8 +371,8 @@
}
MaybeError QueueBase::CopyTextureForBrowserInternal(
- const TextureCopyView* source,
- const TextureCopyView* destination,
+ const ImageCopyTexture* source,
+ const ImageCopyTexture* destination,
const Extent3D* copySize,
const CopyTextureForBrowserOptions* options) {
if (GetDevice()->IsValidationEnabled()) {
@@ -485,7 +485,7 @@
return {};
}
- MaybeError QueueBase::ValidateWriteTexture(const TextureCopyView* destination,
+ MaybeError QueueBase::ValidateWriteTexture(const ImageCopyTexture* destination,
size_t dataSize,
const TextureDataLayout* dataLayout,
const Extent3D* writeSize) const {
@@ -493,7 +493,7 @@
DAWN_TRY(GetDevice()->ValidateObject(this));
DAWN_TRY(GetDevice()->ValidateObject(destination->texture));
- DAWN_TRY(ValidateTextureCopyView(GetDevice(), *destination, *writeSize));
+ DAWN_TRY(ValidateImageCopyTexture(GetDevice(), *destination, *writeSize));
if (dataLayout->offset > dataSize) {
return DAWN_VALIDATION_ERROR("Queue::WriteTexture out of range");
diff --git a/src/dawn_native/Queue.h b/src/dawn_native/Queue.h
index bdc2007..bb538db 100644
--- a/src/dawn_native/Queue.h
+++ b/src/dawn_native/Queue.h
@@ -44,13 +44,13 @@
WGPUQueueWorkDoneCallback callback,
void* userdata);
void WriteBuffer(BufferBase* buffer, uint64_t bufferOffset, const void* data, size_t size);
- void WriteTexture(const TextureCopyView* destination,
+ void WriteTexture(const ImageCopyTexture* destination,
const void* data,
size_t dataSize,
const TextureDataLayout* dataLayout,
const Extent3D* writeSize);
- void CopyTextureForBrowser(const TextureCopyView* source,
- const TextureCopyView* destination,
+ void CopyTextureForBrowser(const ImageCopyTexture* source,
+ const ImageCopyTexture* destination,
const Extent3D* copySize,
const CopyTextureForBrowserOptions* options);
@@ -67,13 +67,13 @@
uint64_t bufferOffset,
const void* data,
size_t size);
- MaybeError WriteTextureInternal(const TextureCopyView* destination,
+ MaybeError WriteTextureInternal(const ImageCopyTexture* destination,
const void* data,
size_t dataSize,
const TextureDataLayout* dataLayout,
const Extent3D* writeSize);
- MaybeError CopyTextureForBrowserInternal(const TextureCopyView* source,
- const TextureCopyView* destination,
+ MaybeError CopyTextureForBrowserInternal(const ImageCopyTexture* source,
+ const ImageCopyTexture* destination,
const Extent3D* copySize,
const CopyTextureForBrowserOptions* options);
@@ -83,7 +83,7 @@
uint64_t bufferOffset,
const void* data,
size_t size);
- virtual MaybeError WriteTextureImpl(const TextureCopyView& destination,
+ virtual MaybeError WriteTextureImpl(const ImageCopyTexture& destination,
const void* data,
const TextureDataLayout& dataLayout,
const Extent3D& writeSize);
@@ -96,7 +96,7 @@
MaybeError ValidateWriteBuffer(const BufferBase* buffer,
uint64_t bufferOffset,
size_t size) const;
- MaybeError ValidateWriteTexture(const TextureCopyView* destination,
+ MaybeError ValidateWriteTexture(const ImageCopyTexture* destination,
size_t dataSize,
const TextureDataLayout* dataLayout,
const Extent3D* writeSize) const;
diff --git a/src/dawn_native/opengl/QueueGL.cpp b/src/dawn_native/opengl/QueueGL.cpp
index 5340d98..23eb143 100644
--- a/src/dawn_native/opengl/QueueGL.cpp
+++ b/src/dawn_native/opengl/QueueGL.cpp
@@ -52,7 +52,7 @@
return {};
}
- MaybeError Queue::WriteTextureImpl(const TextureCopyView& destination,
+ MaybeError Queue::WriteTextureImpl(const ImageCopyTexture& destination,
const void* data,
const TextureDataLayout& dataLayout,
const Extent3D& writeSizePixel) {
diff --git a/src/dawn_native/opengl/QueueGL.h b/src/dawn_native/opengl/QueueGL.h
index a95e1a4..b5a5243 100644
--- a/src/dawn_native/opengl/QueueGL.h
+++ b/src/dawn_native/opengl/QueueGL.h
@@ -31,7 +31,7 @@
uint64_t bufferOffset,
const void* data,
size_t size) override;
- MaybeError WriteTextureImpl(const TextureCopyView& destination,
+ MaybeError WriteTextureImpl(const ImageCopyTexture& destination,
const void* data,
const TextureDataLayout& dataLayout,
const Extent3D& writeSizePixel) override;
diff --git a/src/dawn_wire/client/Queue.cpp b/src/dawn_wire/client/Queue.cpp
index 8c9f78b..6d4da45 100644
--- a/src/dawn_wire/client/Queue.cpp
+++ b/src/dawn_wire/client/Queue.cpp
@@ -90,7 +90,7 @@
client->SerializeCommand(cmd);
}
- void Queue::WriteTexture(const WGPUTextureCopyView* destination,
+ void Queue::WriteTexture(const WGPUImageCopyTexture* destination,
const void* data,
size_t dataSize,
const WGPUTextureDataLayout* dataLayout,
diff --git a/src/dawn_wire/client/Queue.h b/src/dawn_wire/client/Queue.h
index f14fae1..46a2fb5 100644
--- a/src/dawn_wire/client/Queue.h
+++ b/src/dawn_wire/client/Queue.h
@@ -37,7 +37,7 @@
void* userdata);
WGPUFence CreateFence(const WGPUFenceDescriptor* descriptor);
void WriteBuffer(WGPUBuffer cBuffer, uint64_t bufferOffset, const void* data, size_t size);
- void WriteTexture(const WGPUTextureCopyView* destination,
+ void WriteTexture(const WGPUImageCopyTexture* destination,
const void* data,
size_t dataSize,
const WGPUTextureDataLayout* dataLayout,
diff --git a/src/dawn_wire/server/ServerQueue.cpp b/src/dawn_wire/server/ServerQueue.cpp
index 9ab8bc0..f194b32 100644
--- a/src/dawn_wire/server/ServerQueue.cpp
+++ b/src/dawn_wire/server/ServerQueue.cpp
@@ -97,7 +97,7 @@
}
bool Server::DoQueueWriteTextureInternal(ObjectId queueId,
- const WGPUTextureCopyView* destination,
+ const WGPUImageCopyTexture* destination,
const uint8_t* data,
uint64_t dataSize,
const WGPUTextureDataLayout* dataLayout,
diff --git a/src/tests/DawnTest.cpp b/src/tests/DawnTest.cpp
index b1dcab1..fe816c2 100644
--- a/src/tests/DawnTest.cpp
+++ b/src/tests/DawnTest.cpp
@@ -1036,14 +1036,14 @@
// We need to enqueue the copy immediately because by the time we resolve the expectation,
// the texture might have been modified.
- wgpu::TextureCopyView textureCopyView =
- utils::CreateTextureCopyView(texture, level, {x, y, slice}, aspect);
- wgpu::BufferCopyView bufferCopyView =
- utils::CreateBufferCopyView(readback.buffer, readback.offset, bytesPerRow, rowsPerImage);
+ wgpu::ImageCopyTexture imageCopyTexture =
+ utils::CreateImageCopyTexture(texture, level, {x, y, slice}, aspect);
+ wgpu::ImageCopyBuffer imageCopyBuffer =
+ utils::CreateImageCopyBuffer(readback.buffer, readback.offset, bytesPerRow, rowsPerImage);
wgpu::Extent3D copySize = {width, height, 1};
wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
- encoder.CopyTextureToBuffer(&textureCopyView, &bufferCopyView, ©Size);
+ encoder.CopyTextureToBuffer(&imageCopyTexture, &imageCopyBuffer, ©Size);
wgpu::CommandBuffer commands = encoder.Finish();
queue.Submit(1, &commands);
diff --git a/src/tests/end2end/BindGroupTests.cpp b/src/tests/end2end/BindGroupTests.cpp
index d87f8fb..40e7c47 100644
--- a/src/tests/end2end/BindGroupTests.cpp
+++ b/src/tests/end2end/BindGroupTests.cpp
@@ -319,11 +319,11 @@
{{0, buffer, 0, sizeof(transform)}, {1, sampler}, {2, textureView}});
wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
- wgpu::BufferCopyView bufferCopyView =
- utils::CreateBufferCopyView(stagingBuffer, 0, widthInBytes);
- wgpu::TextureCopyView textureCopyView = utils::CreateTextureCopyView(texture, 0, {0, 0, 0});
+ wgpu::ImageCopyBuffer imageCopyBuffer =
+ utils::CreateImageCopyBuffer(stagingBuffer, 0, widthInBytes);
+ wgpu::ImageCopyTexture imageCopyTexture = utils::CreateImageCopyTexture(texture, 0, {0, 0, 0});
wgpu::Extent3D copySize = {width, height, 1};
- encoder.CopyBufferToTexture(&bufferCopyView, &textureCopyView, ©Size);
+ encoder.CopyBufferToTexture(&imageCopyBuffer, &imageCopyTexture, ©Size);
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass.renderPassInfo);
pass.SetPipeline(pipeline);
pass.SetBindGroup(0, bindGroup);
@@ -1181,16 +1181,16 @@
wgpu::Buffer textureData =
utils::CreateBufferFromData(device, wgpu::BufferUsage::CopySrc, {value});
- wgpu::BufferCopyView bufferCopyView = {};
- bufferCopyView.buffer = textureData;
- bufferCopyView.layout.bytesPerRow = 256;
+ wgpu::ImageCopyBuffer imageCopyBuffer = {};
+ imageCopyBuffer.buffer = textureData;
+ imageCopyBuffer.layout.bytesPerRow = 256;
- wgpu::TextureCopyView textureCopyView = {};
- textureCopyView.texture = texture;
+ wgpu::ImageCopyTexture imageCopyTexture = {};
+ imageCopyTexture.texture = texture;
wgpu::Extent3D copySize = {1, 1, 1};
- commandEncoder.CopyBufferToTexture(&bufferCopyView, &textureCopyView, ©Size);
+ commandEncoder.CopyBufferToTexture(&imageCopyBuffer, &imageCopyTexture, ©Size);
return texture;
};
diff --git a/src/tests/end2end/BufferZeroInitTests.cpp b/src/tests/end2end/BufferZeroInitTests.cpp
index 93ef8b6..d6df575 100644
--- a/src/tests/end2end/BufferZeroInitTests.cpp
+++ b/src/tests/end2end/BufferZeroInitTests.cpp
@@ -126,19 +126,19 @@
wgpu::Texture texture =
CreateAndInitializeTexture(spec.textureSize, kTextureFormat, kClearColor);
- const wgpu::TextureCopyView textureCopyView =
- utils::CreateTextureCopyView(texture, 0, {0, 0, 0});
+ const wgpu::ImageCopyTexture imageCopyTexture =
+ utils::CreateImageCopyTexture(texture, 0, {0, 0, 0});
const uint64_t bufferSize = spec.bufferOffset + spec.extraBytes +
utils::RequiredBytesInCopy(spec.bytesPerRow, spec.rowsPerImage,
spec.textureSize, kTextureFormat);
wgpu::Buffer buffer =
CreateBuffer(bufferSize, wgpu::BufferUsage::CopySrc | wgpu::BufferUsage::CopyDst);
- const wgpu::BufferCopyView bufferCopyView = utils::CreateBufferCopyView(
+ const wgpu::ImageCopyBuffer imageCopyBuffer = utils::CreateImageCopyBuffer(
buffer, spec.bufferOffset, spec.bytesPerRow, spec.rowsPerImage);
wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
- encoder.CopyTextureToBuffer(&textureCopyView, &bufferCopyView, &spec.textureSize);
+ encoder.CopyTextureToBuffer(&imageCopyTexture, &imageCopyBuffer, &spec.textureSize);
wgpu::CommandBuffer commandBuffer = encoder.Finish();
EXPECT_LAZY_CLEAR(spec.lazyClearCount, queue.Submit(1, &commandBuffer));
@@ -871,8 +871,8 @@
constexpr wgpu::TextureFormat kTextureFormat = wgpu::TextureFormat::R32Uint;
wgpu::Texture texture = CreateAndInitializeTexture(kTextureSize, kTextureFormat);
- const wgpu::TextureCopyView textureCopyView =
- utils::CreateTextureCopyView(texture, 0, {0, 0, 0});
+ const wgpu::ImageCopyTexture imageCopyTexture =
+ utils::CreateImageCopyTexture(texture, 0, {0, 0, 0});
const uint32_t rowsPerImage = kTextureSize.height;
const uint32_t requiredBufferSizeForCopy = utils::RequiredBytesInCopy(
@@ -886,11 +886,11 @@
constexpr uint64_t kOffset = 0;
const uint32_t totalBufferSize = requiredBufferSizeForCopy + kOffset;
wgpu::Buffer buffer = CreateBuffer(totalBufferSize, kBufferUsage);
- const wgpu::BufferCopyView bufferCopyView = utils::CreateBufferCopyView(
+ const wgpu::ImageCopyBuffer imageCopyBuffer = utils::CreateImageCopyBuffer(
buffer, kOffset, kTextureBytesPerRowAlignment, kTextureSize.height);
wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
- encoder.CopyBufferToTexture(&bufferCopyView, &textureCopyView, &kTextureSize);
+ encoder.CopyBufferToTexture(&imageCopyBuffer, &imageCopyTexture, &kTextureSize);
wgpu::CommandBuffer commandBuffer = encoder.Finish();
EXPECT_LAZY_CLEAR(1u, queue.Submit(1, &commandBuffer));
@@ -904,11 +904,11 @@
constexpr uint64_t kOffset = 8u;
const uint32_t totalBufferSize = requiredBufferSizeForCopy + kOffset;
wgpu::Buffer buffer = CreateBuffer(totalBufferSize, kBufferUsage);
- const wgpu::BufferCopyView bufferCopyView = utils::CreateBufferCopyView(
+ const wgpu::ImageCopyBuffer imageCopyBuffer = utils::CreateImageCopyBuffer(
buffer, kOffset, kTextureBytesPerRowAlignment, kTextureSize.height);
wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
- encoder.CopyBufferToTexture(&bufferCopyView, &textureCopyView, &kTextureSize);
+ encoder.CopyBufferToTexture(&imageCopyBuffer, &imageCopyTexture, &kTextureSize);
wgpu::CommandBuffer commandBuffer = encoder.Finish();
EXPECT_LAZY_CLEAR(1u, queue.Submit(1, &commandBuffer));
diff --git a/src/tests/end2end/CompressedTextureFormatTests.cpp b/src/tests/end2end/CompressedTextureFormatTests.cpp
index a129b9d..0c601b6 100644
--- a/src/tests/end2end/CompressedTextureFormatTests.cpp
+++ b/src/tests/end2end/CompressedTextureFormatTests.cpp
@@ -96,15 +96,15 @@
// Copy texture data from a staging buffer to the destination texture.
wgpu::Buffer stagingBuffer = utils::CreateBufferFromData(device, data.data(), data.size(),
wgpu::BufferUsage::CopySrc);
- wgpu::BufferCopyView bufferCopyView =
- utils::CreateBufferCopyView(stagingBuffer, copyConfig.bufferOffset,
- copyConfig.bytesPerRowAlignment, copyConfig.rowsPerImage);
+ wgpu::ImageCopyBuffer imageCopyBuffer =
+ utils::CreateImageCopyBuffer(stagingBuffer, copyConfig.bufferOffset,
+ copyConfig.bytesPerRowAlignment, copyConfig.rowsPerImage);
- wgpu::TextureCopyView textureCopyView = utils::CreateTextureCopyView(
+ wgpu::ImageCopyTexture imageCopyTexture = utils::CreateImageCopyTexture(
bcCompressedTexture, copyConfig.viewMipmapLevel, copyConfig.copyOrigin3D);
wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
- encoder.CopyBufferToTexture(&bufferCopyView, &textureCopyView, ©Config.copyExtent3D);
+ encoder.CopyBufferToTexture(&imageCopyBuffer, &imageCopyTexture, ©Config.copyExtent3D);
wgpu::CommandBuffer copy = encoder.Finish();
queue.Submit(1, ©);
}
@@ -258,11 +258,11 @@
wgpu::Texture dstTexture,
CopyConfig srcConfig,
CopyConfig dstConfig) {
- wgpu::TextureCopyView textureCopyViewSrc = utils::CreateTextureCopyView(
+ wgpu::ImageCopyTexture imageCopyTextureSrc = utils::CreateImageCopyTexture(
srcTexture, srcConfig.viewMipmapLevel, srcConfig.copyOrigin3D);
- wgpu::TextureCopyView textureCopyViewDst = utils::CreateTextureCopyView(
+ wgpu::ImageCopyTexture imageCopyTextureDst = utils::CreateImageCopyTexture(
dstTexture, dstConfig.viewMipmapLevel, dstConfig.copyOrigin3D);
- encoder.CopyTextureToTexture(&textureCopyViewSrc, &textureCopyViewDst,
+ encoder.CopyTextureToTexture(&imageCopyTextureSrc, &imageCopyTextureDst,
&dstConfig.copyExtent3D);
}
@@ -629,7 +629,7 @@
srcConfig.textureDescriptor.usage =
wgpu::TextureUsage::CopySrc | wgpu::TextureUsage::CopyDst;
wgpu::Texture bcTextureSrc = CreateTextureWithCompressedData(srcConfig);
- wgpu::TextureCopyView textureCopyViewSrc = utils::CreateTextureCopyView(
+ wgpu::ImageCopyTexture imageCopyTextureSrc = utils::CreateImageCopyTexture(
bcTextureSrc, srcConfig.viewMipmapLevel, srcConfig.copyOrigin3D);
// Create bcTexture and copy from the content in bcTextureSrc into it.
@@ -1113,12 +1113,12 @@
bufferDescriptor.usage = wgpu::BufferUsage::CopySrc | wgpu::BufferUsage::CopyDst;
wgpu::Buffer buffer = device.CreateBuffer(&bufferDescriptor);
- wgpu::TextureCopyView textureCopyView = utils::CreateTextureCopyView(texture, 0, {0, 0, 0});
- wgpu::BufferCopyView bufferCopyView = utils::CreateBufferCopyView(buffer, 0, 256);
+ wgpu::ImageCopyTexture imageCopyTexture = utils::CreateImageCopyTexture(texture, 0, {0, 0, 0});
+ wgpu::ImageCopyBuffer imageCopyBuffer = utils::CreateImageCopyBuffer(buffer, 0, 256);
wgpu::Extent3D copyExtent = {4, 4, 1};
wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
- encoder.CopyTextureToBuffer(&textureCopyView, &bufferCopyView, ©Extent);
+ encoder.CopyTextureToBuffer(&imageCopyTexture, &imageCopyBuffer, ©Extent);
wgpu::CommandBuffer commands = encoder.Finish();
queue.Submit(1, &commands);
}
@@ -1148,10 +1148,10 @@
wgpu::TextureDataLayout textureDataLayout = utils::CreateTextureDataLayout(
copyConfig.bufferOffset, copyConfig.bytesPerRowAlignment, copyConfig.rowsPerImage);
- wgpu::TextureCopyView textureCopyView = utils::CreateTextureCopyView(
+ wgpu::ImageCopyTexture imageCopyTexture = utils::CreateImageCopyTexture(
bcCompressedTexture, copyConfig.viewMipmapLevel, copyConfig.copyOrigin3D);
- queue.WriteTexture(&textureCopyView, data.data(), data.size(), &textureDataLayout,
+ queue.WriteTexture(&imageCopyTexture, data.data(), data.size(), &textureDataLayout,
©Config.copyExtent3D);
}
diff --git a/src/tests/end2end/CopyTests.cpp b/src/tests/end2end/CopyTests.cpp
index 040e610..4829eb8 100644
--- a/src/tests/end2end/CopyTests.cpp
+++ b/src/tests/end2end/CopyTests.cpp
@@ -149,11 +149,11 @@
// Initialize the source texture
std::vector<RGBA8> textureArrayData = GetExpectedTextureDataRGBA8(copyLayout);
{
- wgpu::TextureCopyView textureCopyView =
- utils::CreateTextureCopyView(texture, textureSpec.copyLevel, {0, 0, 0});
+ wgpu::ImageCopyTexture imageCopyTexture =
+ utils::CreateImageCopyTexture(texture, textureSpec.copyLevel, {0, 0, 0});
wgpu::TextureDataLayout textureDataLayout =
utils::CreateTextureDataLayout(0, copyLayout.bytesPerRow, copyLayout.rowsPerImage);
- queue.WriteTexture(&textureCopyView, textureArrayData.data(), copyLayout.byteLength,
+ queue.WriteTexture(&imageCopyTexture, textureArrayData.data(), copyLayout.byteLength,
&textureDataLayout, ©Layout.mipSize);
}
@@ -169,11 +169,11 @@
wgpu::Buffer buffer = device.CreateBuffer(&bufferDesc);
{
- wgpu::TextureCopyView textureCopyView = utils::CreateTextureCopyView(
+ wgpu::ImageCopyTexture imageCopyTexture = utils::CreateImageCopyTexture(
texture, textureSpec.copyLevel, textureSpec.copyOrigin);
- wgpu::BufferCopyView bufferCopyView = utils::CreateBufferCopyView(
+ wgpu::ImageCopyBuffer imageCopyBuffer = utils::CreateImageCopyBuffer(
buffer, bufferSpec.offset, bufferSpec.bytesPerRow, bufferSpec.rowsPerImage);
- encoder.CopyTextureToBuffer(&textureCopyView, &bufferCopyView, ©Size);
+ encoder.CopyTextureToBuffer(&imageCopyTexture, &imageCopyBuffer, ©Size);
}
wgpu::CommandBuffer commands = encoder.Finish();
@@ -260,11 +260,11 @@
const uint32_t maxArrayLayer = textureSpec.copyOrigin.z + copySize.depth;
- wgpu::BufferCopyView bufferCopyView = utils::CreateBufferCopyView(
+ wgpu::ImageCopyBuffer imageCopyBuffer = utils::CreateImageCopyBuffer(
buffer, bufferSpec.offset, bufferSpec.bytesPerRow, bufferSpec.rowsPerImage);
- wgpu::TextureCopyView textureCopyView =
- utils::CreateTextureCopyView(texture, textureSpec.copyLevel, textureSpec.copyOrigin);
- encoder.CopyBufferToTexture(&bufferCopyView, &textureCopyView, ©Size);
+ wgpu::ImageCopyTexture imageCopyTexture =
+ utils::CreateImageCopyTexture(texture, textureSpec.copyLevel, textureSpec.copyOrigin);
+ encoder.CopyBufferToTexture(&imageCopyBuffer, &imageCopyTexture, ©Size);
wgpu::CommandBuffer commands = encoder.Finish();
queue.Submit(1, &commands);
@@ -339,11 +339,11 @@
// Initialize the source texture
const std::vector<uint8_t> srcTextureCopyData = GetExpectedTextureData(srcDataCopyLayout);
{
- wgpu::TextureCopyView textureCopyView = utils::CreateTextureCopyView(
+ wgpu::ImageCopyTexture imageCopyTexture = utils::CreateImageCopyTexture(
srcTexture, srcSpec.copyLevel, {0, 0, srcSpec.copyOrigin.z});
wgpu::TextureDataLayout textureDataLayout = utils::CreateTextureDataLayout(
0, srcDataCopyLayout.bytesPerRow, srcDataCopyLayout.rowsPerImage);
- queue.WriteTexture(&textureCopyView, srcTextureCopyData.data(),
+ queue.WriteTexture(&imageCopyTexture, srcTextureCopyData.data(),
srcDataCopyLayout.byteLength, &textureDataLayout,
&srcDataCopyLayout.mipSize);
}
@@ -351,11 +351,11 @@
wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
// Perform the texture to texture copy
- wgpu::TextureCopyView srcTextureCopyView =
- utils::CreateTextureCopyView(srcTexture, srcSpec.copyLevel, srcSpec.copyOrigin);
- wgpu::TextureCopyView dstTextureCopyView =
- utils::CreateTextureCopyView(dstTexture, dstSpec.copyLevel, dstSpec.copyOrigin);
- encoder.CopyTextureToTexture(&srcTextureCopyView, &dstTextureCopyView, ©Size);
+ wgpu::ImageCopyTexture srcImageCopyTexture =
+ utils::CreateImageCopyTexture(srcTexture, srcSpec.copyLevel, srcSpec.copyOrigin);
+ wgpu::ImageCopyTexture dstImageCopyTexture =
+ utils::CreateImageCopyTexture(dstTexture, dstSpec.copyLevel, dstSpec.copyOrigin);
+ encoder.CopyTextureToTexture(&srcImageCopyTexture, &dstImageCopyTexture, ©Size);
// Copy the data from the srcSpec.copyOrigin.z-th layer to (srcSpec.copyOrigin.z +
// copySize.depth)-th layer of dstTexture to outputBuffer
@@ -367,9 +367,9 @@
outputBufferDescriptor.size = dstDataCopyLayout.byteLength;
outputBufferDescriptor.usage = wgpu::BufferUsage::CopySrc | wgpu::BufferUsage::CopyDst;
wgpu::Buffer outputBuffer = device.CreateBuffer(&outputBufferDescriptor);
- wgpu::BufferCopyView outputBufferCopyView = utils::CreateBufferCopyView(
+ wgpu::ImageCopyBuffer outputImageCopyBuffer = utils::CreateImageCopyBuffer(
outputBuffer, 0, dstDataCopyLayout.bytesPerRow, dstDataCopyLayout.rowsPerImage);
- encoder.CopyTextureToBuffer(&dstTextureCopyView, &outputBufferCopyView, ©Size);
+ encoder.CopyTextureToBuffer(&dstImageCopyTexture, &outputImageCopyBuffer, ©Size);
wgpu::CommandBuffer commands = encoder.Finish();
queue.Submit(1, &commands);
@@ -1597,12 +1597,12 @@
bufferDescriptor.usage = wgpu::BufferUsage::CopySrc | wgpu::BufferUsage::CopyDst;
wgpu::Buffer buffer = device.CreateBuffer(&bufferDescriptor);
- wgpu::BufferCopyView bufferCopyView =
- utils::CreateBufferCopyView(buffer, kBufferCopyOffset, kTextureBytesPerRowAlignment);
- wgpu::TextureCopyView textureCopyView = utils::CreateTextureCopyView(texture, 0, {0, 0, 0});
+ wgpu::ImageCopyBuffer imageCopyBuffer =
+ utils::CreateImageCopyBuffer(buffer, kBufferCopyOffset, kTextureBytesPerRowAlignment);
+ wgpu::ImageCopyTexture imageCopyTexture = utils::CreateImageCopyTexture(texture, 0, {0, 0, 0});
wgpu::Extent3D copySize = textureDescriptor.size;
- encoder.CopyTextureToBuffer(&textureCopyView, &bufferCopyView, ©Size);
+ encoder.CopyTextureToBuffer(&imageCopyTexture, &imageCopyBuffer, ©Size);
wgpu::CommandBuffer commandBuffer = encoder.Finish();
queue.Submit(1, &commandBuffer);
diff --git a/src/tests/end2end/CopyTextureForBrowserTests.cpp b/src/tests/end2end/CopyTextureForBrowserTests.cpp
index 570d7ef..b7cfd08 100644
--- a/src/tests/end2end/CopyTextureForBrowserTests.cpp
+++ b/src/tests/end2end/CopyTextureForBrowserTests.cpp
@@ -145,29 +145,29 @@
srcSpec.level);
const std::vector<RGBA8> textureArrayCopyData = GetSourceTextureData(copyLayout);
- wgpu::TextureCopyView textureCopyView =
- utils::CreateTextureCopyView(srcTexture, srcSpec.level, {0, 0, srcSpec.copyOrigin.z});
+ wgpu::ImageCopyTexture imageCopyTexture =
+ utils::CreateImageCopyTexture(srcTexture, srcSpec.level, {0, 0, srcSpec.copyOrigin.z});
wgpu::TextureDataLayout textureDataLayout;
textureDataLayout.offset = 0;
textureDataLayout.bytesPerRow = copyLayout.bytesPerRow;
textureDataLayout.rowsPerImage = copyLayout.rowsPerImage;
- device.GetQueue().WriteTexture(&textureCopyView, textureArrayCopyData.data(),
+ device.GetQueue().WriteTexture(&imageCopyTexture, textureArrayCopyData.data(),
textureArrayCopyData.size() * sizeof(RGBA8),
&textureDataLayout, ©Layout.mipSize);
// Perform the texture to texture copy
- wgpu::TextureCopyView srcTextureCopyView =
- utils::CreateTextureCopyView(srcTexture, srcSpec.level, srcSpec.copyOrigin);
- wgpu::TextureCopyView dstTextureCopyView =
- utils::CreateTextureCopyView(dstTexture, dstSpec.level, dstSpec.copyOrigin);
+ wgpu::ImageCopyTexture srcImageCopyTexture =
+ utils::CreateImageCopyTexture(srcTexture, srcSpec.level, srcSpec.copyOrigin);
+ wgpu::ImageCopyTexture dstImageCopyTexture =
+ utils::CreateImageCopyTexture(dstTexture, dstSpec.level, dstSpec.copyOrigin);
wgpu::CommandBuffer commands = encoder.Finish();
queue.Submit(1, &commands);
- device.GetQueue().CopyTextureForBrowser(&srcTextureCopyView, &dstTextureCopyView, ©Size,
- &options);
+ device.GetQueue().CopyTextureForBrowser(&srcImageCopyTexture, &dstImageCopyTexture,
+ ©Size, &options);
// Update uniform buffer based on test config
uint32_t uniformBufferData[] = {
diff --git a/src/tests/end2end/D3D12ResourceWrappingTests.cpp b/src/tests/end2end/D3D12ResourceWrappingTests.cpp
index b8d3c65..12e0aeb 100644
--- a/src/tests/end2end/D3D12ResourceWrappingTests.cpp
+++ b/src/tests/end2end/D3D12ResourceWrappingTests.cpp
@@ -282,8 +282,8 @@
protected:
// Submits a 1x1x1 copy from source to destination
void SimpleCopyTextureToTexture(wgpu::Texture source, wgpu::Texture destination) {
- wgpu::TextureCopyView copySrc = utils::CreateTextureCopyView(source, 0, {0, 0, 0});
- wgpu::TextureCopyView copyDst = utils::CreateTextureCopyView(destination, 0, {0, 0, 0});
+ wgpu::ImageCopyTexture copySrc = utils::CreateImageCopyTexture(source, 0, {0, 0, 0});
+ wgpu::ImageCopyTexture copyDst = utils::CreateImageCopyTexture(destination, 0, {0, 0, 0});
wgpu::Extent3D copySize = {1, 1, 1};
diff --git a/src/tests/end2end/DeprecatedAPITests.cpp b/src/tests/end2end/DeprecatedAPITests.cpp
index f16c838..ba045d7 100644
--- a/src/tests/end2end/DeprecatedAPITests.cpp
+++ b/src/tests/end2end/DeprecatedAPITests.cpp
@@ -180,16 +180,16 @@
OpenGLESBackend(),
VulkanBackend());
-class BufferCopyViewDeprecationTests : public DeprecationTests {
+class ImageCopyBufferDeprecationTests : public DeprecationTests {
protected:
- wgpu::TextureCopyView MakeTextureCopyView() {
+ wgpu::ImageCopyTexture MakeImageCopyTexture() {
wgpu::TextureDescriptor desc = {};
desc.usage = wgpu::TextureUsage::CopySrc | wgpu::TextureUsage::CopyDst;
desc.dimension = wgpu::TextureDimension::e2D;
desc.size = {1, 1, 2};
desc.format = wgpu::TextureFormat::RGBA8Unorm;
- wgpu::TextureCopyView copy;
+ wgpu::ImageCopyTexture copy;
copy.texture = device.CreateTexture(&desc);
copy.origin = {0, 0, 1};
return copy;
diff --git a/src/tests/end2end/DepthStencilCopyTests.cpp b/src/tests/end2end/DepthStencilCopyTests.cpp
index e616423..f548f04 100644
--- a/src/tests/end2end/DepthStencilCopyTests.cpp
+++ b/src/tests/end2end/DepthStencilCopyTests.cpp
@@ -173,8 +173,10 @@
// Perform a T2T copy of all aspects
{
wgpu::CommandEncoder commandEncoder = device.CreateCommandEncoder();
- wgpu::TextureCopyView srcView = utils::CreateTextureCopyView(src, mipLevel, {0, 0, 0});
- wgpu::TextureCopyView dstView = utils::CreateTextureCopyView(dst, mipLevel, {0, 0, 0});
+ wgpu::ImageCopyTexture srcView =
+ utils::CreateImageCopyTexture(src, mipLevel, {0, 0, 0});
+ wgpu::ImageCopyTexture dstView =
+ utils::CreateImageCopyTexture(dst, mipLevel, {0, 0, 0});
wgpu::Extent3D copySize = {width >> mipLevel, height >> mipLevel, 1};
commandEncoder.CopyTextureToTexture(&srcView, &dstView, ©Size);
@@ -229,10 +231,10 @@
}
uploadBuffer.Unmap();
- wgpu::BufferCopyView bufferCopy =
- utils::CreateBufferCopyView(uploadBuffer, 0, bytesPerRow, height);
- wgpu::TextureCopyView textureCopy =
- utils::CreateTextureCopyView(depthDataTexture, 0, {0, 0, 0}, wgpu::TextureAspect::All);
+ wgpu::ImageCopyBuffer bufferCopy =
+ utils::CreateImageCopyBuffer(uploadBuffer, 0, bytesPerRow, height);
+ wgpu::ImageCopyTexture textureCopy =
+ utils::CreateImageCopyTexture(depthDataTexture, 0, {0, 0, 0}, wgpu::TextureAspect::All);
commandEncoder.CopyBufferToTexture(&bufferCopy, &textureCopy, &depthDataDesc.size);
// Pipeline for a full screen quad.
@@ -636,11 +638,11 @@
wgpu::TextureDataLayout stencilDataLayout = {};
stencilDataLayout.bytesPerRow = kWidth * sizeof(uint8_t);
- wgpu::TextureCopyView stencilDataCopyView = utils::CreateTextureCopyView(
+ wgpu::ImageCopyTexture stencilDataCopyTexture = utils::CreateImageCopyTexture(
depthStencilTexture, 0, {0, 0, 0}, wgpu::TextureAspect::StencilOnly);
wgpu::Extent3D writeSize = {kWidth, kHeight, 1};
- queue.WriteTexture(&stencilDataCopyView, stencilData.data(),
+ queue.WriteTexture(&stencilDataCopyTexture, stencilData.data(),
stencilData.size() * sizeof(uint8_t), &stencilDataLayout, &writeSize);
// Decrement the stencil value in a render pass to ensure the data is visible to the pipeline.
diff --git a/src/tests/end2end/GpuMemorySynchronizationTests.cpp b/src/tests/end2end/GpuMemorySynchronizationTests.cpp
index 5f7fb35..b7182f9 100644
--- a/src/tests/end2end/GpuMemorySynchronizationTests.cpp
+++ b/src/tests/end2end/GpuMemorySynchronizationTests.cpp
@@ -242,12 +242,12 @@
wgpu::TextureUsage::Storage | wgpu::TextureUsage::Sampled | wgpu::TextureUsage::CopyDst;
wgpu::Texture tex = device.CreateTexture(&texDesc);
- wgpu::TextureCopyView copyView;
- copyView.texture = tex;
+ wgpu::ImageCopyTexture copyDst;
+ copyDst.texture = tex;
wgpu::TextureDataLayout layout;
wgpu::Extent3D copySize = {1, 1, 1};
uint32_t kOne = 1;
- queue.WriteTexture(©View, &kOne, sizeof(kOne), &layout, ©Size);
+ queue.WriteTexture(©Dst, &kOne, sizeof(kOne), &layout, ©Size);
// Create a pipeline that loads the texture from both the sampled and storage paths.
wgpu::ComputePipelineDescriptor pipelineDesc;
diff --git a/src/tests/end2end/NonzeroTextureCreationTests.cpp b/src/tests/end2end/NonzeroTextureCreationTests.cpp
index 20e8ed2..91fab10 100644
--- a/src/tests/end2end/NonzeroTextureCreationTests.cpp
+++ b/src/tests/end2end/NonzeroTextureCreationTests.cpp
@@ -138,12 +138,12 @@
wgpu::Buffer bufferDst = utils::CreateBufferFromData(
device, data.data(), static_cast<uint32_t>(data.size()), wgpu::BufferUsage::CopySrc);
- wgpu::BufferCopyView bufferCopyView = utils::CreateBufferCopyView(bufferDst, 0, kSize * 4);
- wgpu::TextureCopyView textureCopyView = utils::CreateTextureCopyView(texture, 0, {0, 0, 0});
+ wgpu::ImageCopyBuffer imageCopyBuffer = utils::CreateImageCopyBuffer(bufferDst, 0, kSize * 4);
+ wgpu::ImageCopyTexture imageCopyTexture = utils::CreateImageCopyTexture(texture, 0, {0, 0, 0});
wgpu::Extent3D copySize = {kSize, kSize, 1};
wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
- encoder.CopyTextureToBuffer(&textureCopyView, &bufferCopyView, ©Size);
+ encoder.CopyTextureToBuffer(&imageCopyTexture, &imageCopyBuffer, ©Size);
wgpu::CommandBuffer commands = encoder.Finish();
queue.Submit(1, &commands);
@@ -176,12 +176,12 @@
wgpu::Buffer bufferDst = utils::CreateBufferFromData(
device, data.data(), static_cast<uint32_t>(data.size()), wgpu::BufferUsage::CopySrc);
- wgpu::BufferCopyView bufferCopyView = utils::CreateBufferCopyView(bufferDst, 0, kSize * 4);
- wgpu::TextureCopyView textureCopyView = utils::CreateTextureCopyView(texture, 0, {0, 0, 1});
+ wgpu::ImageCopyBuffer imageCopyBuffer = utils::CreateImageCopyBuffer(bufferDst, 0, kSize * 4);
+ wgpu::ImageCopyTexture imageCopyTexture = utils::CreateImageCopyTexture(texture, 0, {0, 0, 1});
wgpu::Extent3D copySize = {kSize, kSize, 1};
wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
- encoder.CopyTextureToBuffer(&textureCopyView, &bufferCopyView, ©Size);
+ encoder.CopyTextureToBuffer(&imageCopyTexture, &imageCopyBuffer, ©Size);
wgpu::CommandBuffer commands = encoder.Finish();
queue.Submit(1, &commands);
diff --git a/src/tests/end2end/QueueTests.cpp b/src/tests/end2end/QueueTests.cpp
index 02cfad0..4dce823 100644
--- a/src/tests/end2end/QueueTests.cpp
+++ b/src/tests/end2end/QueueTests.cpp
@@ -277,10 +277,10 @@
wgpu::TextureDataLayout textureDataLayout = utils::CreateTextureDataLayout(
dataSpec.offset, dataSpec.bytesPerRow, dataSpec.rowsPerImage);
- wgpu::TextureCopyView textureCopyView =
- utils::CreateTextureCopyView(texture, textureSpec.level, textureSpec.copyOrigin);
+ wgpu::ImageCopyTexture imageCopyTexture =
+ utils::CreateImageCopyTexture(texture, textureSpec.level, textureSpec.copyOrigin);
- queue.WriteTexture(&textureCopyView, data.data(), dataSpec.size, &textureDataLayout,
+ queue.WriteTexture(&imageCopyTexture, data.data(), dataSpec.size, &textureDataLayout,
©Size);
const uint32_t bytesPerTexel = utils::GetTexelBlockSizeInBytes(kTextureFormat);
diff --git a/src/tests/end2end/RenderPassLoadOpTests.cpp b/src/tests/end2end/RenderPassLoadOpTests.cpp
index 1c7d8c1..eab3005 100644
--- a/src/tests/end2end/RenderPassLoadOpTests.cpp
+++ b/src/tests/end2end/RenderPassLoadOpTests.cpp
@@ -126,10 +126,11 @@
bufferDescriptor.usage = wgpu::BufferUsage::CopySrc | wgpu::BufferUsage::CopyDst;
wgpu::Buffer buffer = device.CreateBuffer(&bufferDescriptor);
- wgpu::TextureCopyView textureCopyView = utils::CreateTextureCopyView(texture, 0, {0, 0, 0});
- wgpu::BufferCopyView bufferCopyView =
- utils::CreateBufferCopyView(buffer, 0, kTextureBytesPerRowAlignment);
- encoder.CopyTextureToBuffer(&textureCopyView, &bufferCopyView, &kTextureSize);
+ wgpu::ImageCopyTexture imageCopyTexture =
+ utils::CreateImageCopyTexture(texture, 0, {0, 0, 0});
+ wgpu::ImageCopyBuffer imageCopyBuffer =
+ utils::CreateImageCopyBuffer(buffer, 0, kTextureBytesPerRowAlignment);
+ encoder.CopyTextureToBuffer(&imageCopyTexture, &imageCopyBuffer, &kTextureSize);
wgpu::CommandBuffer commandBuffer = encoder.Finish();
queue.Submit(1, &commandBuffer);
diff --git a/src/tests/end2end/SamplerFilterAnisotropicTests.cpp b/src/tests/end2end/SamplerFilterAnisotropicTests.cpp
index 6338b9c..67f7bc9 100644
--- a/src/tests/end2end/SamplerFilterAnisotropicTests.cpp
+++ b/src/tests/end2end/SamplerFilterAnisotropicTests.cpp
@@ -121,12 +121,12 @@
std::vector<RGBA8> data(rowPixels * texHeight, color);
wgpu::Buffer stagingBuffer = utils::CreateBufferFromData(
device, data.data(), data.size() * sizeof(RGBA8), wgpu::BufferUsage::CopySrc);
- wgpu::BufferCopyView bufferCopyView =
- utils::CreateBufferCopyView(stagingBuffer, 0, kTextureBytesPerRowAlignment);
- wgpu::TextureCopyView textureCopyView =
- utils::CreateTextureCopyView(texture, level, {0, 0, 0});
+ wgpu::ImageCopyBuffer imageCopyBuffer =
+ utils::CreateImageCopyBuffer(stagingBuffer, 0, kTextureBytesPerRowAlignment);
+ wgpu::ImageCopyTexture imageCopyTexture =
+ utils::CreateImageCopyTexture(texture, level, {0, 0, 0});
wgpu::Extent3D copySize = {texWidth, texHeight, 1};
- encoder.CopyBufferToTexture(&bufferCopyView, &textureCopyView, ©Size);
+ encoder.CopyBufferToTexture(&imageCopyBuffer, &imageCopyTexture, ©Size);
}
wgpu::CommandBuffer copy = encoder.Finish();
queue.Submit(1, ©);
diff --git a/src/tests/end2end/SamplerTests.cpp b/src/tests/end2end/SamplerTests.cpp
index daea20c..77ebcd2 100644
--- a/src/tests/end2end/SamplerTests.cpp
+++ b/src/tests/end2end/SamplerTests.cpp
@@ -108,12 +108,13 @@
wgpu::Buffer stagingBuffer =
utils::CreateBufferFromData(device, data, sizeof(data), wgpu::BufferUsage::CopySrc);
- wgpu::BufferCopyView bufferCopyView = utils::CreateBufferCopyView(stagingBuffer, 0, 256);
- wgpu::TextureCopyView textureCopyView = utils::CreateTextureCopyView(texture, 0, {0, 0, 0});
+ wgpu::ImageCopyBuffer imageCopyBuffer = utils::CreateImageCopyBuffer(stagingBuffer, 0, 256);
+ wgpu::ImageCopyTexture imageCopyTexture =
+ utils::CreateImageCopyTexture(texture, 0, {0, 0, 0});
wgpu::Extent3D copySize = {2, 2, 1};
wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
- encoder.CopyBufferToTexture(&bufferCopyView, &textureCopyView, ©Size);
+ encoder.CopyBufferToTexture(&imageCopyBuffer, &imageCopyTexture, ©Size);
wgpu::CommandBuffer copy = encoder.Finish();
queue.Submit(1, ©);
diff --git a/src/tests/end2end/StorageTextureTests.cpp b/src/tests/end2end/StorageTextureTests.cpp
index 495d804..3557e18 100644
--- a/src/tests/end2end/StorageTextureTests.cpp
+++ b/src/tests/end2end/StorageTextureTests.cpp
@@ -448,11 +448,11 @@
wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
const wgpu::Extent3D copyExtent = {kWidth, kHeight, arrayLayerCount};
- wgpu::BufferCopyView bufferCopyView =
- utils::CreateBufferCopyView(uploadBuffer, 0, kTextureBytesPerRowAlignment, kHeight);
- wgpu::TextureCopyView textureCopyView;
- textureCopyView.texture = outputTexture;
- encoder.CopyBufferToTexture(&bufferCopyView, &textureCopyView, ©Extent);
+ wgpu::ImageCopyBuffer imageCopyBuffer =
+ utils::CreateImageCopyBuffer(uploadBuffer, 0, kTextureBytesPerRowAlignment, kHeight);
+ wgpu::ImageCopyTexture imageCopyTexture;
+ imageCopyTexture.texture = outputTexture;
+ encoder.CopyBufferToTexture(&imageCopyBuffer, &imageCopyTexture, ©Extent);
wgpu::CommandBuffer commandBuffer = encoder.Finish();
queue.Submit(1, &commandBuffer);
@@ -622,11 +622,11 @@
wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
const wgpu::Extent3D copyExtent = {kWidth, kHeight, arrayLayerCount};
- wgpu::TextureCopyView textureCopyView =
- utils::CreateTextureCopyView(writeonlyStorageTexture, 0, {0, 0, 0});
- wgpu::BufferCopyView bufferCopyView =
- utils::CreateBufferCopyView(resultBuffer, 0, kTextureBytesPerRowAlignment, kHeight);
- encoder.CopyTextureToBuffer(&textureCopyView, &bufferCopyView, ©Extent);
+ wgpu::ImageCopyTexture imageCopyTexture =
+ utils::CreateImageCopyTexture(writeonlyStorageTexture, 0, {0, 0, 0});
+ wgpu::ImageCopyBuffer imageCopyBuffer =
+ utils::CreateImageCopyBuffer(resultBuffer, 0, kTextureBytesPerRowAlignment, kHeight);
+ encoder.CopyTextureToBuffer(&imageCopyTexture, &imageCopyBuffer, ©Extent);
wgpu::CommandBuffer commandBuffer = encoder.Finish();
queue.Submit(1, &commandBuffer);
@@ -1032,12 +1032,12 @@
bufferDescriptor.usage = wgpu::BufferUsage::CopySrc | wgpu::BufferUsage::CopyDst;
wgpu::Buffer resultBuffer = device.CreateBuffer(&bufferDescriptor);
- wgpu::TextureCopyView textureCopyView;
- textureCopyView.texture = storageTexture1;
+ wgpu::ImageCopyTexture imageCopyTexture;
+ imageCopyTexture.texture = storageTexture1;
- wgpu::BufferCopyView bufferCopyView = utils::CreateBufferCopyView(resultBuffer, 0, 256, 1);
+ wgpu::ImageCopyBuffer imageCopyBuffer = utils::CreateImageCopyBuffer(resultBuffer, 0, 256, 1);
wgpu::Extent3D extent3D = {1, 1, 1};
- encoder.CopyTextureToBuffer(&textureCopyView, &bufferCopyView, &extent3D);
+ encoder.CopyTextureToBuffer(&imageCopyTexture, &imageCopyBuffer, &extent3D);
wgpu::CommandBuffer commands = encoder.Finish();
queue.Submit(1, &commands);
@@ -1106,12 +1106,12 @@
bufferDescriptor.usage = wgpu::BufferUsage::CopySrc | wgpu::BufferUsage::CopyDst;
wgpu::Buffer resultBuffer = device.CreateBuffer(&bufferDescriptor);
- wgpu::TextureCopyView textureCopyView;
- textureCopyView.texture = storageTexture1;
+ wgpu::ImageCopyTexture imageCopyTexture;
+ imageCopyTexture.texture = storageTexture1;
- wgpu::BufferCopyView bufferCopyView = utils::CreateBufferCopyView(resultBuffer, 0, 256, 1);
+ wgpu::ImageCopyBuffer imageCopyBuffer = utils::CreateImageCopyBuffer(resultBuffer, 0, 256, 1);
wgpu::Extent3D extent3D = {1, 1, 1};
- encoder.CopyTextureToBuffer(&textureCopyView, &bufferCopyView, &extent3D);
+ encoder.CopyTextureToBuffer(&imageCopyTexture, &imageCopyBuffer, &extent3D);
wgpu::CommandBuffer commands = encoder.Finish();
queue.Submit(1, &commands);
diff --git a/src/tests/end2end/TextureFormatTests.cpp b/src/tests/end2end/TextureFormatTests.cpp
index eda28d3..e343128 100644
--- a/src/tests/end2end/TextureFormatTests.cpp
+++ b/src/tests/end2end/TextureFormatTests.cpp
@@ -235,9 +235,9 @@
wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
{
- wgpu::BufferCopyView bufferView = utils::CreateBufferCopyView(uploadBuffer, 0, 256);
- wgpu::TextureCopyView textureView =
- utils::CreateTextureCopyView(sampleTexture, 0, {0, 0, 0});
+ wgpu::ImageCopyBuffer bufferView = utils::CreateImageCopyBuffer(uploadBuffer, 0, 256);
+ wgpu::ImageCopyTexture textureView =
+ utils::CreateImageCopyTexture(sampleTexture, 0, {0, 0, 0});
wgpu::Extent3D extent{width, 1, 1};
encoder.CopyBufferToTexture(&bufferView, &textureView, &extent);
}
@@ -250,9 +250,9 @@
renderPass.EndPass();
{
- wgpu::BufferCopyView bufferView = utils::CreateBufferCopyView(readbackBuffer, 0, 256);
- wgpu::TextureCopyView textureView =
- utils::CreateTextureCopyView(renderTarget, 0, {0, 0, 0});
+ wgpu::ImageCopyBuffer bufferView = utils::CreateImageCopyBuffer(readbackBuffer, 0, 256);
+ wgpu::ImageCopyTexture textureView =
+ utils::CreateImageCopyTexture(renderTarget, 0, {0, 0, 0});
wgpu::Extent3D extent{width, 1, 1};
encoder.CopyTextureToBuffer(&textureView, &bufferView, &extent);
}
diff --git a/src/tests/end2end/TextureViewTests.cpp b/src/tests/end2end/TextureViewTests.cpp
index 19649d6..f0aa2cd 100644
--- a/src/tests/end2end/TextureViewTests.cpp
+++ b/src/tests/end2end/TextureViewTests.cpp
@@ -147,12 +147,12 @@
std::vector<RGBA8> data(kPaddedTexWidth * texHeight, RGBA8(0, 0, 0, pixelValue));
wgpu::Buffer stagingBuffer = utils::CreateBufferFromData(
device, data.data(), data.size() * sizeof(RGBA8), wgpu::BufferUsage::CopySrc);
- wgpu::BufferCopyView bufferCopyView =
- utils::CreateBufferCopyView(stagingBuffer, 0, kTextureBytesPerRowAlignment);
- wgpu::TextureCopyView textureCopyView =
- utils::CreateTextureCopyView(mTexture, level, {0, 0, layer});
+ wgpu::ImageCopyBuffer imageCopyBuffer =
+ utils::CreateImageCopyBuffer(stagingBuffer, 0, kTextureBytesPerRowAlignment);
+ wgpu::ImageCopyTexture imageCopyTexture =
+ utils::CreateImageCopyTexture(mTexture, level, {0, 0, layer});
wgpu::Extent3D copySize = {texWidth, texHeight, 1};
- encoder.CopyBufferToTexture(&bufferCopyView, &textureCopyView, ©Size);
+ encoder.CopyBufferToTexture(&imageCopyBuffer, &imageCopyTexture, ©Size);
}
}
wgpu::CommandBuffer copy = encoder.Finish();
diff --git a/src/tests/end2end/TextureZeroInitTests.cpp b/src/tests/end2end/TextureZeroInitTests.cpp
index f900008..8664b78 100644
--- a/src/tests/end2end/TextureZeroInitTests.cpp
+++ b/src/tests/end2end/TextureZeroInitTests.cpp
@@ -157,14 +157,14 @@
{kSize, kSize, kArrayLayers}, kColorFormat);
wgpu::Buffer buffer = device.CreateBuffer(&bufferDescriptor);
- const wgpu::BufferCopyView bufferCopyView =
- utils::CreateBufferCopyView(buffer, 0, bytesPerRow, kSize);
- const wgpu::TextureCopyView textureCopyView =
- utils::CreateTextureCopyView(texture, 0, {0, 0, 0});
+ const wgpu::ImageCopyBuffer imageCopyBuffer =
+ utils::CreateImageCopyBuffer(buffer, 0, bytesPerRow, kSize);
+ const wgpu::ImageCopyTexture imageCopyTexture =
+ utils::CreateImageCopyTexture(texture, 0, {0, 0, 0});
const wgpu::Extent3D copySize = {kSize, kSize, kArrayLayers};
wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
- encoder.CopyTextureToBuffer(&textureCopyView, &bufferCopyView, ©Size);
+ encoder.CopyTextureToBuffer(&imageCopyTexture, &imageCopyBuffer, ©Size);
wgpu::CommandBuffer commandBuffer = encoder.Finish();
// Expect texture to be lazy initialized.
@@ -279,13 +279,13 @@
wgpu::Buffer stagingBuffer = utils::CreateBufferFromData(
device, data.data(), static_cast<uint32_t>(data.size()), wgpu::BufferUsage::CopySrc);
- wgpu::BufferCopyView bufferCopyView =
- utils::CreateBufferCopyView(stagingBuffer, 0, kSize * sizeof(uint32_t));
- wgpu::TextureCopyView textureCopyView = utils::CreateTextureCopyView(texture, 0, {0, 0, 0});
+ wgpu::ImageCopyBuffer imageCopyBuffer =
+ utils::CreateImageCopyBuffer(stagingBuffer, 0, kSize * sizeof(uint32_t));
+ wgpu::ImageCopyTexture imageCopyTexture = utils::CreateImageCopyTexture(texture, 0, {0, 0, 0});
wgpu::Extent3D copySize = {kSize, kSize, 1};
wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
- encoder.CopyBufferToTexture(&bufferCopyView, &textureCopyView, ©Size);
+ encoder.CopyBufferToTexture(&imageCopyBuffer, &imageCopyTexture, ©Size);
wgpu::CommandBuffer commands = encoder.Finish();
EXPECT_LAZY_CLEAR(0u, queue.Submit(1, &commands));
@@ -310,13 +310,13 @@
wgpu::Buffer stagingBuffer = utils::CreateBufferFromData(
device, data.data(), static_cast<uint32_t>(data.size()), wgpu::BufferUsage::CopySrc);
- wgpu::BufferCopyView bufferCopyView =
- utils::CreateBufferCopyView(stagingBuffer, 0, kSize * sizeof(uint16_t));
- wgpu::TextureCopyView textureCopyView = utils::CreateTextureCopyView(texture, 0, {0, 0, 0});
+ wgpu::ImageCopyBuffer imageCopyBuffer =
+ utils::CreateImageCopyBuffer(stagingBuffer, 0, kSize * sizeof(uint16_t));
+ wgpu::ImageCopyTexture imageCopyTexture = utils::CreateImageCopyTexture(texture, 0, {0, 0, 0});
wgpu::Extent3D copySize = {kSize / 2, kSize, 1};
wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
- encoder.CopyBufferToTexture(&bufferCopyView, &textureCopyView, ©Size);
+ encoder.CopyBufferToTexture(&imageCopyBuffer, &imageCopyTexture, ©Size);
wgpu::CommandBuffer commands = encoder.Finish();
EXPECT_LAZY_CLEAR(1u, queue.Submit(1, &commands));
@@ -344,14 +344,14 @@
wgpu::Buffer stagingBuffer = utils::CreateBufferFromData(
device, data.data(), static_cast<uint32_t>(data.size()), wgpu::BufferUsage::CopySrc);
- const wgpu::BufferCopyView bufferCopyView =
- utils::CreateBufferCopyView(stagingBuffer, 0, kSize * kFormatBlockByteSize, kSize);
- const wgpu::TextureCopyView textureCopyView =
- utils::CreateTextureCopyView(texture, 0, {0, 0, kBaseArrayLayer});
+ const wgpu::ImageCopyBuffer imageCopyBuffer =
+ utils::CreateImageCopyBuffer(stagingBuffer, 0, kSize * kFormatBlockByteSize, kSize);
+ const wgpu::ImageCopyTexture imageCopyTexture =
+ utils::CreateImageCopyTexture(texture, 0, {0, 0, kBaseArrayLayer});
const wgpu::Extent3D copySize = {kSize, kSize, kCopyLayerCount};
wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
- encoder.CopyBufferToTexture(&bufferCopyView, &textureCopyView, ©Size);
+ encoder.CopyBufferToTexture(&imageCopyBuffer, &imageCopyTexture, ©Size);
wgpu::CommandBuffer commands = encoder.Finish();
// The copy overwrites the whole subresources so we don't need to do lazy initialization on
@@ -374,8 +374,8 @@
1, 1, wgpu::TextureUsage::Sampled | wgpu::TextureUsage::CopySrc, kColorFormat);
wgpu::Texture srcTexture = device.CreateTexture(&srcDescriptor);
- wgpu::TextureCopyView srcTextureCopyView =
- utils::CreateTextureCopyView(srcTexture, 0, {0, 0, 0});
+ wgpu::ImageCopyTexture srcImageCopyTexture =
+ utils::CreateImageCopyTexture(srcTexture, 0, {0, 0, 0});
wgpu::TextureDescriptor dstDescriptor =
CreateTextureDescriptor(1, 1,
@@ -384,13 +384,13 @@
kColorFormat);
wgpu::Texture dstTexture = device.CreateTexture(&dstDescriptor);
- wgpu::TextureCopyView dstTextureCopyView =
- utils::CreateTextureCopyView(dstTexture, 0, {0, 0, 0});
+ wgpu::ImageCopyTexture dstImageCopyTexture =
+ utils::CreateImageCopyTexture(dstTexture, 0, {0, 0, 0});
wgpu::Extent3D copySize = {kSize, kSize, 1};
wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
- encoder.CopyTextureToTexture(&srcTextureCopyView, &dstTextureCopyView, ©Size);
+ encoder.CopyTextureToTexture(&srcImageCopyTexture, &dstImageCopyTexture, ©Size);
wgpu::CommandBuffer commands = encoder.Finish();
EXPECT_LAZY_CLEAR(1u, queue.Submit(1, &commands));
@@ -418,19 +418,19 @@
std::vector<uint8_t> data(kFormatBlockByteSize * kSize * kSize, 100);
wgpu::Buffer stagingBuffer = utils::CreateBufferFromData(
device, data.data(), static_cast<uint32_t>(data.size()), wgpu::BufferUsage::CopySrc);
- wgpu::BufferCopyView bufferCopyView =
- utils::CreateBufferCopyView(stagingBuffer, 0, kSize * kFormatBlockByteSize);
- wgpu::TextureCopyView textureCopyView =
- utils::CreateTextureCopyView(srcTexture, 0, {0, 0, 0});
+ wgpu::ImageCopyBuffer imageCopyBuffer =
+ utils::CreateImageCopyBuffer(stagingBuffer, 0, kSize * kFormatBlockByteSize);
+ wgpu::ImageCopyTexture imageCopyTexture =
+ utils::CreateImageCopyTexture(srcTexture, 0, {0, 0, 0});
wgpu::Extent3D copySize = {kSize, kSize, 1};
wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
- encoder.CopyBufferToTexture(&bufferCopyView, &textureCopyView, ©Size);
+ encoder.CopyBufferToTexture(&imageCopyBuffer, &imageCopyTexture, ©Size);
wgpu::CommandBuffer commands = encoder.Finish();
queue.Submit(1, &commands);
}
- wgpu::TextureCopyView srcTextureCopyView =
- utils::CreateTextureCopyView(srcTexture, 0, {0, 0, 0});
+ wgpu::ImageCopyTexture srcImageCopyTexture =
+ utils::CreateImageCopyTexture(srcTexture, 0, {0, 0, 0});
wgpu::TextureDescriptor dstDescriptor =
CreateTextureDescriptor(1, 1,
@@ -439,12 +439,12 @@
kColorFormat);
wgpu::Texture dstTexture = device.CreateTexture(&dstDescriptor);
- wgpu::TextureCopyView dstTextureCopyView =
- utils::CreateTextureCopyView(dstTexture, 0, {0, 0, 0});
+ wgpu::ImageCopyTexture dstImageCopyTexture =
+ utils::CreateImageCopyTexture(dstTexture, 0, {0, 0, 0});
wgpu::Extent3D copySize = {kSize / 2, kSize, 1};
wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
- encoder.CopyTextureToTexture(&srcTextureCopyView, &dstTextureCopyView, ©Size);
+ encoder.CopyTextureToTexture(&srcImageCopyTexture, &dstImageCopyTexture, ©Size);
wgpu::CommandBuffer commands = encoder.Finish();
EXPECT_LAZY_CLEAR(1u, queue.Submit(1, &commands));
@@ -1028,12 +1028,12 @@
wgpu::Buffer bufferDst = utils::CreateBufferFromData(
device, data.data(), static_cast<uint32_t>(data.size()), wgpu::BufferUsage::CopySrc);
- wgpu::BufferCopyView bufferCopyView = utils::CreateBufferCopyView(bufferDst, 0, bytesPerRow);
- wgpu::TextureCopyView textureCopyView = utils::CreateTextureCopyView(texture, 0, {0, 0, 0});
+ wgpu::ImageCopyBuffer imageCopyBuffer = utils::CreateImageCopyBuffer(bufferDst, 0, bytesPerRow);
+ wgpu::ImageCopyTexture imageCopyTexture = utils::CreateImageCopyTexture(texture, 0, {0, 0, 0});
wgpu::Extent3D copySize = {kSize, kSize, 1};
wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
- encoder.CopyTextureToBuffer(&textureCopyView, &bufferCopyView, ©Size);
+ encoder.CopyTextureToBuffer(&imageCopyTexture, &imageCopyBuffer, ©Size);
wgpu::CommandBuffer commands = encoder.Finish();
EXPECT_LAZY_CLEAR(1u, queue.Submit(1, &commands));
@@ -1063,12 +1063,12 @@
std::vector<uint8_t> data(bufferSize, 100);
wgpu::Buffer bufferDst = utils::CreateBufferFromData(
device, data.data(), static_cast<uint32_t>(data.size()), wgpu::BufferUsage::CopySrc);
- wgpu::BufferCopyView bufferCopyView = utils::CreateBufferCopyView(bufferDst, 0, bytesPerRow);
- wgpu::TextureCopyView textureCopyView = utils::CreateTextureCopyView(texture, 0, {0, 0, 0});
+ wgpu::ImageCopyBuffer imageCopyBuffer = utils::CreateImageCopyBuffer(bufferDst, 0, bytesPerRow);
+ wgpu::ImageCopyTexture imageCopyTexture = utils::CreateImageCopyTexture(texture, 0, {0, 0, 0});
wgpu::Extent3D copySize = {kUnalignedSize, kUnalignedSize, 1};
wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
- encoder.CopyTextureToBuffer(&textureCopyView, &bufferCopyView, ©Size);
+ encoder.CopyTextureToBuffer(&imageCopyTexture, &imageCopyBuffer, ©Size);
wgpu::CommandBuffer commands = encoder.Finish();
EXPECT_LAZY_CLEAR(1u, queue.Submit(1, &commands));
@@ -1096,13 +1096,13 @@
wgpu::Buffer bufferDst = utils::CreateBufferFromData(
device, data.data(), static_cast<uint32_t>(data.size()), wgpu::BufferUsage::CopySrc);
- wgpu::BufferCopyView bufferCopyView =
- utils::CreateBufferCopyView(bufferDst, 0, kSize * kFormatBlockByteSize);
- wgpu::TextureCopyView textureCopyView = utils::CreateTextureCopyView(texture, 0, {0, 0, 1});
+ wgpu::ImageCopyBuffer imageCopyBuffer =
+ utils::CreateImageCopyBuffer(bufferDst, 0, kSize * kFormatBlockByteSize);
+ wgpu::ImageCopyTexture imageCopyTexture = utils::CreateImageCopyTexture(texture, 0, {0, 0, 1});
wgpu::Extent3D copySize = {kSize, kSize, 1};
wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
- encoder.CopyTextureToBuffer(&textureCopyView, &bufferCopyView, ©Size);
+ encoder.CopyTextureToBuffer(&imageCopyTexture, &imageCopyBuffer, ©Size);
wgpu::CommandBuffer commands = encoder.Finish();
EXPECT_LAZY_CLEAR(1u, queue.Submit(1, &commands));
@@ -1131,12 +1131,12 @@
std::vector<uint8_t> data(kFormatBlockByteSize * kSize * kSize, 1);
wgpu::Buffer stagingBuffer = utils::CreateBufferFromData(
device, data.data(), static_cast<uint32_t>(data.size()), wgpu::BufferUsage::CopySrc);
- wgpu::BufferCopyView bufferCopyView =
- utils::CreateBufferCopyView(stagingBuffer, 0, kSize * kFormatBlockByteSize);
- wgpu::TextureCopyView textureCopyView = utils::CreateTextureCopyView(texture, 0, {0, 0, 0});
+ wgpu::ImageCopyBuffer imageCopyBuffer =
+ utils::CreateImageCopyBuffer(stagingBuffer, 0, kSize * kFormatBlockByteSize);
+ wgpu::ImageCopyTexture imageCopyTexture = utils::CreateImageCopyTexture(texture, 0, {0, 0, 0});
wgpu::Extent3D copySize = {kSize, kSize, 1};
wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
- encoder.CopyBufferToTexture(&bufferCopyView, &textureCopyView, ©Size);
+ encoder.CopyBufferToTexture(&imageCopyBuffer, &imageCopyTexture, ©Size);
wgpu::CommandBuffer commands = encoder.Finish();
// Expect 0 lazy clears because the texture will be completely copied to
EXPECT_LAZY_CLEAR(0u, queue.Submit(1, &commands));
@@ -1276,13 +1276,13 @@
std::vector<uint8_t> data(kFormatBlockByteSize * mipSize * mipSize, 2);
wgpu::Buffer stagingBuffer = utils::CreateBufferFromData(
device, data.data(), static_cast<uint32_t>(data.size()), wgpu::BufferUsage::CopySrc);
- wgpu::BufferCopyView bufferCopyView =
- utils::CreateBufferCopyView(stagingBuffer, 0, mipSize * kFormatBlockByteSize);
- wgpu::TextureCopyView textureCopyView =
- utils::CreateTextureCopyView(sampleTexture, 1, {0, 0, 0});
+ wgpu::ImageCopyBuffer imageCopyBuffer =
+ utils::CreateImageCopyBuffer(stagingBuffer, 0, mipSize * kFormatBlockByteSize);
+ wgpu::ImageCopyTexture imageCopyTexture =
+ utils::CreateImageCopyTexture(sampleTexture, 1, {0, 0, 0});
wgpu::Extent3D copySize = {mipSize, mipSize, 1};
wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
- encoder.CopyBufferToTexture(&bufferCopyView, &textureCopyView, ©Size);
+ encoder.CopyBufferToTexture(&imageCopyBuffer, &imageCopyTexture, ©Size);
wgpu::CommandBuffer commands = encoder.Finish();
// Expect 0 lazy clears because the texture subresource will be completely copied to
EXPECT_LAZY_CLEAR(0u, queue.Submit(1, &commands));
@@ -1353,13 +1353,13 @@
std::vector<uint8_t> data(kFormatBlockByteSize * kSize * kSize, 2);
wgpu::Buffer stagingBuffer = utils::CreateBufferFromData(
device, data.data(), static_cast<uint32_t>(data.size()), wgpu::BufferUsage::CopySrc);
- wgpu::BufferCopyView bufferCopyView =
- utils::CreateBufferCopyView(stagingBuffer, 0, kSize * kFormatBlockByteSize);
- wgpu::TextureCopyView textureCopyView =
- utils::CreateTextureCopyView(sampleTexture, 0, {0, 0, 1});
+ wgpu::ImageCopyBuffer imageCopyBuffer =
+ utils::CreateImageCopyBuffer(stagingBuffer, 0, kSize * kFormatBlockByteSize);
+ wgpu::ImageCopyTexture imageCopyTexture =
+ utils::CreateImageCopyTexture(sampleTexture, 0, {0, 0, 1});
wgpu::Extent3D copySize = {kSize, kSize, 1};
wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
- encoder.CopyBufferToTexture(&bufferCopyView, &textureCopyView, ©Size);
+ encoder.CopyBufferToTexture(&imageCopyBuffer, &imageCopyTexture, ©Size);
wgpu::CommandBuffer commands = encoder.Finish();
// Expect 0 lazy clears because the texture subresource will be completely copied to
EXPECT_LAZY_CLEAR(0u, queue.Submit(1, &commands));
@@ -1441,12 +1441,14 @@
wgpu::Buffer buffer = utils::CreateBufferFromData(device, initialBufferData.data(),
bufferSize, wgpu::BufferUsage::CopyDst);
- wgpu::TextureCopyView textureCopyView = utils::CreateTextureCopyView(texture, 0, {0, 0, 0});
- wgpu::BufferCopyView bufferCopyView = utils::CreateBufferCopyView(buffer, 0, bytesPerRow);
+ wgpu::ImageCopyTexture imageCopyTexture =
+ utils::CreateImageCopyTexture(texture, 0, {0, 0, 0});
+ wgpu::ImageCopyBuffer imageCopyBuffer =
+ utils::CreateImageCopyBuffer(buffer, 0, bytesPerRow);
wgpu::Extent3D copySize = {kUnalignedSize, kUnalignedSize, 1};
wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
- encoder.CopyTextureToBuffer(&textureCopyView, &bufferCopyView, ©Size);
+ encoder.CopyTextureToBuffer(&imageCopyTexture, &imageCopyBuffer, ©Size);
wgpu::CommandBuffer commands = encoder.Finish();
EXPECT_LAZY_CLEAR(1u, queue.Submit(1, &commands));
@@ -1462,7 +1464,7 @@
1, 1, wgpu::TextureUsage::CopyDst | wgpu::TextureUsage::CopySrc, kColorFormat);
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::Extent3D copySize = {kSize, kSize, 1};
wgpu::TextureDataLayout textureDataLayout;
@@ -1477,9 +1479,9 @@
{100, 100, 100, 100});
// The write overwrites the whole texture so we don't need to do lazy initialization.
- EXPECT_LAZY_CLEAR(0u,
- queue.WriteTexture(&textureCopyView, data.data(), data.size() * sizeof(RGBA8),
- &textureDataLayout, ©Size));
+ EXPECT_LAZY_CLEAR(
+ 0u, queue.WriteTexture(&imageCopyTexture, data.data(), data.size() * sizeof(RGBA8),
+ &textureDataLayout, ©Size));
// Expect texture initialized to be true
EXPECT_TRUE(dawn_native::IsTextureSubresourceInitialized(texture.Get(), 0, 1, 0, 1));
@@ -1496,7 +1498,7 @@
kColorFormat);
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::Extent3D copySize = {kSize / 2, kSize, 1};
wgpu::TextureDataLayout textureDataLayout;
@@ -1510,9 +1512,9 @@
sizeof(RGBA8),
{100, 100, 100, 100});
- EXPECT_LAZY_CLEAR(1u,
- queue.WriteTexture(&textureCopyView, data.data(), data.size() * sizeof(RGBA8),
- &textureDataLayout, ©Size));
+ EXPECT_LAZY_CLEAR(
+ 1u, queue.WriteTexture(&imageCopyTexture, data.data(), data.size() * sizeof(RGBA8),
+ &textureDataLayout, ©Size));
// Expect texture initialized to be true
EXPECT_EQ(true, dawn_native::IsTextureSubresourceInitialized(texture.Get(), 0, 1, 0, 1));
@@ -1534,8 +1536,8 @@
constexpr uint32_t kBaseArrayLayer = 2u;
constexpr uint32_t kCopyLayerCount = 3u;
- wgpu::TextureCopyView textureCopyView =
- utils::CreateTextureCopyView(texture, 0, {0, 0, kBaseArrayLayer});
+ wgpu::ImageCopyTexture imageCopyTexture =
+ utils::CreateImageCopyTexture(texture, 0, {0, 0, kBaseArrayLayer});
wgpu::Extent3D copySize = {kSize, kSize, kCopyLayerCount};
wgpu::TextureDataLayout textureDataLayout;
@@ -1551,9 +1553,9 @@
// The write overwrites the whole subresources so we don't need to do lazy initialization on
// them.
- EXPECT_LAZY_CLEAR(0u,
- queue.WriteTexture(&textureCopyView, data.data(), data.size() * sizeof(RGBA8),
- &textureDataLayout, ©Size));
+ EXPECT_LAZY_CLEAR(
+ 0u, queue.WriteTexture(&imageCopyTexture, data.data(), data.size() * sizeof(RGBA8),
+ &textureDataLayout, ©Size));
// Expect texture subresource initialized to be true
EXPECT_TRUE(dawn_native::IsTextureSubresourceInitialized(texture.Get(), 0, 1, kBaseArrayLayer,
@@ -1576,8 +1578,8 @@
constexpr uint32_t kBaseArrayLayer = 2u;
constexpr uint32_t kCopyLayerCount = 3u;
- wgpu::TextureCopyView textureCopyView =
- utils::CreateTextureCopyView(texture, 0, {0, 0, kBaseArrayLayer});
+ wgpu::ImageCopyTexture imageCopyTexture =
+ utils::CreateImageCopyTexture(texture, 0, {0, 0, kBaseArrayLayer});
wgpu::Extent3D copySize = {kSize / 2, kSize, kCopyLayerCount};
wgpu::TextureDataLayout textureDataLayout;
@@ -1591,9 +1593,9 @@
sizeof(RGBA8),
{100, 100, 100, 100});
- EXPECT_LAZY_CLEAR(1u,
- queue.WriteTexture(&textureCopyView, data.data(), data.size() * sizeof(RGBA8),
- &textureDataLayout, ©Size));
+ EXPECT_LAZY_CLEAR(
+ 1u, queue.WriteTexture(&imageCopyTexture, data.data(), data.size() * sizeof(RGBA8),
+ &textureDataLayout, ©Size));
// Expect texture subresource initialized to be true
EXPECT_EQ(true, dawn_native::IsTextureSubresourceInitialized(texture.Get(), 0, 1,
@@ -1618,8 +1620,8 @@
constexpr uint32_t kMipLevel = 2;
constexpr uint32_t kMipSize = kSize >> kMipLevel;
- wgpu::TextureCopyView textureCopyView =
- utils::CreateTextureCopyView(texture, kMipLevel, {0, 0, 0});
+ wgpu::ImageCopyTexture imageCopyTexture =
+ utils::CreateImageCopyTexture(texture, kMipLevel, {0, 0, 0});
wgpu::Extent3D copySize = {kMipSize, kMipSize, 1};
wgpu::TextureDataLayout textureDataLayout;
@@ -1634,9 +1636,9 @@
{100, 100, 100, 100});
// The write overwrites the whole texture so we don't need to do lazy initialization.
- EXPECT_LAZY_CLEAR(0u,
- queue.WriteTexture(&textureCopyView, data.data(), data.size() * sizeof(RGBA8),
- &textureDataLayout, ©Size));
+ EXPECT_LAZY_CLEAR(
+ 0u, queue.WriteTexture(&imageCopyTexture, data.data(), data.size() * sizeof(RGBA8),
+ &textureDataLayout, ©Size));
// Expect texture initialized to be true
EXPECT_TRUE(dawn_native::IsTextureSubresourceInitialized(texture.Get(), kMipLevel, 1, 0, 1));
@@ -1656,8 +1658,8 @@
constexpr uint32_t kMipLevel = 2;
constexpr uint32_t kMipSize = kSize >> kMipLevel;
- wgpu::TextureCopyView textureCopyView =
- utils::CreateTextureCopyView(texture, kMipLevel, {0, 0, 0});
+ wgpu::ImageCopyTexture imageCopyTexture =
+ utils::CreateImageCopyTexture(texture, kMipLevel, {0, 0, 0});
wgpu::Extent3D copySize = {kMipSize / 2, kMipSize, 1};
wgpu::TextureDataLayout textureDataLayout;
@@ -1671,9 +1673,9 @@
sizeof(RGBA8),
{100, 100, 100, 100});
- EXPECT_LAZY_CLEAR(1u,
- queue.WriteTexture(&textureCopyView, data.data(), data.size() * sizeof(RGBA8),
- &textureDataLayout, ©Size));
+ EXPECT_LAZY_CLEAR(
+ 1u, queue.WriteTexture(&imageCopyTexture, data.data(), data.size() * sizeof(RGBA8),
+ &textureDataLayout, ©Size));
// Expect texture initialized to be true
EXPECT_EQ(true,
@@ -1740,14 +1742,14 @@
// Copy texture data from a staging buffer to the destination texture.
wgpu::Buffer stagingBuffer = utils::CreateBufferFromData(device, data.data(), data.size(),
wgpu::BufferUsage::CopySrc);
- wgpu::BufferCopyView bufferCopyView =
- utils::CreateBufferCopyView(stagingBuffer, 0, copyBytesPerRow, copyHeightInBlock);
+ wgpu::ImageCopyBuffer imageCopyBuffer =
+ utils::CreateImageCopyBuffer(stagingBuffer, 0, copyBytesPerRow, copyHeightInBlock);
- wgpu::TextureCopyView textureCopyView = utils::CreateTextureCopyView(
+ wgpu::ImageCopyTexture imageCopyTexture = utils::CreateImageCopyTexture(
bcCompressedTexture, viewMipmapLevel, {0, 0, baseArrayLayer});
wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
- encoder.CopyBufferToTexture(&bufferCopyView, &textureCopyView, ©Extent3D);
+ encoder.CopyBufferToTexture(&imageCopyBuffer, &imageCopyTexture, ©Extent3D);
wgpu::CommandBuffer copy = encoder.Finish();
EXPECT_LAZY_CLEAR(lazyClearCount, queue.Submit(1, ©));
}
@@ -1975,8 +1977,8 @@
InitializeDataInCompressedTextureAndExpectLazyClear(srcTexture, srcDescriptor, copyExtent3D,
kViewMipLevel, 0, 0u);
- wgpu::TextureCopyView srcTextureCopyView =
- utils::CreateTextureCopyView(srcTexture, kViewMipLevel, {0, 0, 0});
+ wgpu::ImageCopyTexture srcImageCopyTexture =
+ utils::CreateImageCopyTexture(srcTexture, kViewMipLevel, {0, 0, 0});
// create dstTexture that we will copy to
wgpu::TextureDescriptor dstDescriptor = CreateTextureDescriptor(
@@ -1985,11 +1987,11 @@
utils::kBCFormats[0]);
wgpu::Texture dstTexture = device.CreateTexture(&dstDescriptor);
- wgpu::TextureCopyView dstTextureCopyView =
- utils::CreateTextureCopyView(dstTexture, kViewMipLevel, {0, 0, 0});
+ wgpu::ImageCopyTexture dstImageCopyTexture =
+ utils::CreateImageCopyTexture(dstTexture, kViewMipLevel, {0, 0, 0});
wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
- encoder.CopyTextureToTexture(&srcTextureCopyView, &dstTextureCopyView, ©Extent3D);
+ encoder.CopyTextureToTexture(&srcImageCopyTexture, &dstImageCopyTexture, ©Extent3D);
wgpu::CommandBuffer commands = encoder.Finish();
// the dstTexture does not need to be lazy cleared since it's fully copied to
EXPECT_LAZY_CLEAR(0u, queue.Submit(1, &commands));
@@ -2022,8 +2024,8 @@
InitializeDataInCompressedTextureAndExpectLazyClear(srcTexture, srcDescriptor, copyExtent3D,
kViewMipLevel, 0, 1u);
- wgpu::TextureCopyView srcTextureCopyView =
- utils::CreateTextureCopyView(srcTexture, kViewMipLevel, {0, 0, 0});
+ wgpu::ImageCopyTexture srcImageCopyTexture =
+ utils::CreateImageCopyTexture(srcTexture, kViewMipLevel, {0, 0, 0});
// create dstTexture that we will copy to
wgpu::TextureDescriptor dstDescriptor = CreateTextureDescriptor(
@@ -2032,11 +2034,11 @@
utils::kBCFormats[0]);
wgpu::Texture dstTexture = device.CreateTexture(&dstDescriptor);
- wgpu::TextureCopyView dstTextureCopyView =
- utils::CreateTextureCopyView(dstTexture, kViewMipLevel, {0, 0, 0});
+ wgpu::ImageCopyTexture dstImageCopyTexture =
+ utils::CreateImageCopyTexture(dstTexture, kViewMipLevel, {0, 0, 0});
wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
- encoder.CopyTextureToTexture(&srcTextureCopyView, &dstTextureCopyView, ©Extent3D);
+ encoder.CopyTextureToTexture(&srcImageCopyTexture, &dstImageCopyTexture, ©Extent3D);
wgpu::CommandBuffer commands = encoder.Finish();
// expect 1 lazy clear count since the dstTexture needs to be lazy cleared when we only copy to
// half texture
diff --git a/src/tests/perf_tests/SubresourceTrackingPerf.cpp b/src/tests/perf_tests/SubresourceTrackingPerf.cpp
index 3896147..96370b4 100644
--- a/src/tests/perf_tests/SubresourceTrackingPerf.cpp
+++ b/src/tests/perf_tests/SubresourceTrackingPerf.cpp
@@ -96,10 +96,10 @@
// Copy into the layer of the material array.
{
- wgpu::TextureCopyView sourceView;
+ wgpu::ImageCopyTexture sourceView;
sourceView.texture = mUploadTexture;
- wgpu::TextureCopyView destView;
+ wgpu::ImageCopyTexture destView;
destView.texture = mMaterials;
destView.origin.z = layerUploaded;
diff --git a/src/tests/unittests/validation/CopyCommandsValidationTests.cpp b/src/tests/unittests/validation/CopyCommandsValidationTests.cpp
index dd41962..62e4c9c 100644
--- a/src/tests/unittests/validation/CopyCommandsValidationTests.cpp
+++ b/src/tests/unittests/validation/CopyCommandsValidationTests.cpp
@@ -78,13 +78,13 @@
wgpu::Origin3D destOrigin,
wgpu::Extent3D extent3D,
wgpu::TextureAspect aspect = wgpu::TextureAspect::All) {
- wgpu::BufferCopyView bufferCopyView =
- utils::CreateBufferCopyView(srcBuffer, srcOffset, srcBytesPerRow, srcRowsPerImage);
- wgpu::TextureCopyView textureCopyView =
- utils::CreateTextureCopyView(destTexture, destLevel, destOrigin, aspect);
+ wgpu::ImageCopyBuffer imageCopyBuffer =
+ utils::CreateImageCopyBuffer(srcBuffer, srcOffset, srcBytesPerRow, srcRowsPerImage);
+ wgpu::ImageCopyTexture imageCopyTexture =
+ utils::CreateImageCopyTexture(destTexture, destLevel, destOrigin, aspect);
wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
- encoder.CopyBufferToTexture(&bufferCopyView, &textureCopyView, &extent3D);
+ encoder.CopyBufferToTexture(&imageCopyBuffer, &imageCopyTexture, &extent3D);
ValidateExpectation(encoder, expectation);
}
@@ -99,13 +99,13 @@
uint32_t destRowsPerImage,
wgpu::Extent3D extent3D,
wgpu::TextureAspect aspect = wgpu::TextureAspect::All) {
- wgpu::BufferCopyView bufferCopyView =
- utils::CreateBufferCopyView(destBuffer, destOffset, destBytesPerRow, destRowsPerImage);
- wgpu::TextureCopyView textureCopyView =
- utils::CreateTextureCopyView(srcTexture, srcLevel, srcOrigin, aspect);
+ wgpu::ImageCopyBuffer imageCopyBuffer =
+ utils::CreateImageCopyBuffer(destBuffer, destOffset, destBytesPerRow, destRowsPerImage);
+ wgpu::ImageCopyTexture imageCopyTexture =
+ utils::CreateImageCopyTexture(srcTexture, srcLevel, srcOrigin, aspect);
wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
- encoder.CopyTextureToBuffer(&textureCopyView, &bufferCopyView, &extent3D);
+ encoder.CopyTextureToBuffer(&imageCopyTexture, &imageCopyBuffer, &extent3D);
ValidateExpectation(encoder, expectation);
}
@@ -119,13 +119,13 @@
wgpu::Origin3D dstOrigin,
wgpu::Extent3D extent3D,
wgpu::TextureAspect aspect = wgpu::TextureAspect::All) {
- wgpu::TextureCopyView srcTextureCopyView =
- utils::CreateTextureCopyView(srcTexture, srcLevel, srcOrigin, aspect);
- wgpu::TextureCopyView dstTextureCopyView =
- utils::CreateTextureCopyView(dstTexture, dstLevel, dstOrigin, aspect);
+ wgpu::ImageCopyTexture srcImageCopyTexture =
+ utils::CreateImageCopyTexture(srcTexture, srcLevel, srcOrigin, aspect);
+ wgpu::ImageCopyTexture dstImageCopyTexture =
+ utils::CreateImageCopyTexture(dstTexture, dstLevel, dstOrigin, aspect);
wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
- encoder.CopyTextureToTexture(&srcTextureCopyView, &dstTextureCopyView, &extent3D);
+ encoder.CopyTextureToTexture(&srcImageCopyTexture, &dstImageCopyTexture, &extent3D);
ValidateExpectation(encoder, expectation);
}
@@ -666,20 +666,20 @@
errorTextureDescriptor.size.depth = 0;
ASSERT_DEVICE_ERROR(wgpu::Texture errorTexture = device.CreateTexture(&errorTextureDescriptor));
- wgpu::BufferCopyView errorBufferCopyView = utils::CreateBufferCopyView(errorBuffer, 0, 0, 0);
- wgpu::TextureCopyView errorTextureCopyView =
- utils::CreateTextureCopyView(errorTexture, 0, {0, 0, 0});
+ wgpu::ImageCopyBuffer errorImageCopyBuffer = utils::CreateImageCopyBuffer(errorBuffer, 0, 0, 0);
+ wgpu::ImageCopyTexture errorImageCopyTexture =
+ utils::CreateImageCopyTexture(errorTexture, 0, {0, 0, 0});
wgpu::Extent3D extent3D = {0, 0, 0};
{
wgpu::Texture destination = Create2DTexture(16, 16, 1, 1, wgpu::TextureFormat::RGBA8Unorm,
wgpu::TextureUsage::CopyDst);
- wgpu::TextureCopyView textureCopyView =
- utils::CreateTextureCopyView(destination, 0, {0, 0, 0});
+ wgpu::ImageCopyTexture imageCopyTexture =
+ utils::CreateImageCopyTexture(destination, 0, {0, 0, 0});
wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
- encoder.CopyBufferToTexture(&errorBufferCopyView, &textureCopyView, &extent3D);
+ encoder.CopyBufferToTexture(&errorImageCopyBuffer, &imageCopyTexture, &extent3D);
ASSERT_DEVICE_ERROR(encoder.Finish());
}
@@ -687,10 +687,10 @@
uint64_t bufferSize = BufferSizeForTextureCopy(4, 4, 1);
wgpu::Buffer source = CreateBuffer(bufferSize, wgpu::BufferUsage::CopySrc);
- wgpu::BufferCopyView bufferCopyView = utils::CreateBufferCopyView(source, 0, 0, 0);
+ wgpu::ImageCopyBuffer imageCopyBuffer = utils::CreateImageCopyBuffer(source, 0, 0, 0);
wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
- encoder.CopyBufferToTexture(&bufferCopyView, &errorTextureCopyView, &extent3D);
+ encoder.CopyBufferToTexture(&imageCopyBuffer, &errorImageCopyTexture, &extent3D);
ASSERT_DEVICE_ERROR(encoder.Finish());
}
}
@@ -1255,9 +1255,9 @@
errorTextureDescriptor.size.depth = 0;
ASSERT_DEVICE_ERROR(wgpu::Texture errorTexture = device.CreateTexture(&errorTextureDescriptor));
- wgpu::BufferCopyView errorBufferCopyView = utils::CreateBufferCopyView(errorBuffer, 0, 0, 0);
- wgpu::TextureCopyView errorTextureCopyView =
- utils::CreateTextureCopyView(errorTexture, 0, {0, 0, 0});
+ wgpu::ImageCopyBuffer errorImageCopyBuffer = utils::CreateImageCopyBuffer(errorBuffer, 0, 0, 0);
+ wgpu::ImageCopyTexture errorImageCopyTexture =
+ utils::CreateImageCopyTexture(errorTexture, 0, {0, 0, 0});
wgpu::Extent3D extent3D = {0, 0, 0};
@@ -1265,21 +1265,21 @@
uint64_t bufferSize = BufferSizeForTextureCopy(4, 4, 1);
wgpu::Buffer source = CreateBuffer(bufferSize, wgpu::BufferUsage::CopySrc);
- wgpu::BufferCopyView bufferCopyView = utils::CreateBufferCopyView(source, 0, 0, 0);
+ wgpu::ImageCopyBuffer imageCopyBuffer = utils::CreateImageCopyBuffer(source, 0, 0, 0);
wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
- encoder.CopyTextureToBuffer(&errorTextureCopyView, &bufferCopyView, &extent3D);
+ encoder.CopyTextureToBuffer(&errorImageCopyTexture, &imageCopyBuffer, &extent3D);
ASSERT_DEVICE_ERROR(encoder.Finish());
}
{
wgpu::Texture destination = Create2DTexture(16, 16, 1, 1, wgpu::TextureFormat::RGBA8Unorm,
wgpu::TextureUsage::CopyDst);
- wgpu::TextureCopyView textureCopyView =
- utils::CreateTextureCopyView(destination, 0, {0, 0, 0});
+ wgpu::ImageCopyTexture imageCopyTexture =
+ utils::CreateImageCopyTexture(destination, 0, {0, 0, 0});
wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
- encoder.CopyTextureToBuffer(&textureCopyView, &errorBufferCopyView, &extent3D);
+ encoder.CopyTextureToBuffer(&imageCopyTexture, &errorImageCopyBuffer, &extent3D);
ASSERT_DEVICE_ERROR(encoder.Finish());
}
}
@@ -1533,13 +1533,13 @@
TestT2TCopy(utils::Expectation::Success, source, 0, {0, 0, 1}, destination, 0, {0, 0, 1},
{16, 16, 1});
- // Copy multiple slices (srcTextureCopyView.arrayLayer + copySize.depth ==
- // srcTextureCopyView.texture.arrayLayerCount)
+ // Copy multiple slices (srcImageCopyTexture.arrayLayer + copySize.depth ==
+ // srcImageCopyTexture.texture.arrayLayerCount)
TestT2TCopy(utils::Expectation::Success, source, 0, {0, 0, 2}, destination, 0, {0, 0, 0},
{16, 16, 2});
- // Copy multiple slices (dstTextureCopyView.arrayLayer + copySize.depth ==
- // dstTextureCopyView.texture.arrayLayerCount)
+ // Copy multiple slices (dstImageCopyTexture.arrayLayer + copySize.depth ==
+ // dstImageCopyTexture.texture.arrayLayerCount)
TestT2TCopy(utils::Expectation::Success, source, 0, {0, 0, 0}, destination, 0, {0, 0, 2},
{16, 16, 2});
}
diff --git a/src/tests/unittests/validation/QueueWriteTextureValidationTests.cpp b/src/tests/unittests/validation/QueueWriteTextureValidationTests.cpp
index d464761..f115c30c 100644
--- a/src/tests/unittests/validation/QueueWriteTextureValidationTests.cpp
+++ b/src/tests/unittests/validation/QueueWriteTextureValidationTests.cpp
@@ -63,10 +63,10 @@
textureDataLayout.bytesPerRow = dataBytesPerRow;
textureDataLayout.rowsPerImage = dataRowsPerImage;
- wgpu::TextureCopyView textureCopyView =
- utils::CreateTextureCopyView(texture, texLevel, texOrigin, aspect);
+ wgpu::ImageCopyTexture imageCopyTexture =
+ utils::CreateImageCopyTexture(texture, texLevel, texOrigin, aspect);
- queue.WriteTexture(&textureCopyView, data.data(), dataSize, &textureDataLayout, &size);
+ queue.WriteTexture(&imageCopyTexture, data.data(), dataSize, &textureDataLayout, &size);
}
void TestWriteTextureExactDataSize(uint32_t bytesPerRow,
@@ -361,8 +361,8 @@
errorTextureDescriptor.size.depth = 0;
ASSERT_DEVICE_ERROR(wgpu::Texture errorTexture =
device.CreateTexture(&errorTextureDescriptor));
- wgpu::TextureCopyView errorTextureCopyView =
- utils::CreateTextureCopyView(errorTexture, 0, {0, 0, 0});
+ wgpu::ImageCopyTexture errorImageCopyTexture =
+ utils::CreateImageCopyTexture(errorTexture, 0, {0, 0, 0});
wgpu::Extent3D extent3D = {0, 0, 0};
@@ -370,7 +370,7 @@
std::vector<uint8_t> data(4);
wgpu::TextureDataLayout textureDataLayout = utils::CreateTextureDataLayout(0, 0, 0);
- ASSERT_DEVICE_ERROR(queue.WriteTexture(&errorTextureCopyView, data.data(), 4,
+ ASSERT_DEVICE_ERROR(queue.WriteTexture(&errorImageCopyTexture, data.data(), 4,
&textureDataLayout, &extent3D));
}
}
diff --git a/src/tests/unittests/validation/ResourceUsageTrackingTests.cpp b/src/tests/unittests/validation/ResourceUsageTrackingTests.cpp
index 865b70c..6b61912 100644
--- a/src/tests/unittests/validation/ResourceUsageTrackingTests.cpp
+++ b/src/tests/unittests/validation/ResourceUsageTrackingTests.cpp
@@ -1286,8 +1286,8 @@
wgpu::TextureView view0 = texture0.CreateView();
wgpu::TextureView view1 = texture1.CreateView();
- wgpu::TextureCopyView srcView = utils::CreateTextureCopyView(texture0, 0, {0, 0, 0});
- wgpu::TextureCopyView dstView = utils::CreateTextureCopyView(texture1, 0, {0, 0, 0});
+ wgpu::ImageCopyTexture srcView = utils::CreateImageCopyTexture(texture0, 0, {0, 0, 0});
+ wgpu::ImageCopyTexture dstView = utils::CreateImageCopyTexture(texture1, 0, {0, 0, 0});
wgpu::Extent3D copySize = {1, 1, 1};
// Use the texture as both copy dst and render attachment in render pass
diff --git a/src/tests/unittests/validation/VideoViewsValidationTests.cpp b/src/tests/unittests/validation/VideoViewsValidationTests.cpp
index 607393b..7f346cc 100644
--- a/src/tests/unittests/validation/VideoViewsValidationTests.cpp
+++ b/src/tests/unittests/validation/VideoViewsValidationTests.cpp
@@ -123,14 +123,14 @@
wgpu::Texture dstTexture = CreateVideoTextureForTest(
wgpu::TextureFormat::R8BG8Biplanar420Unorm, wgpu::TextureUsage::Sampled);
- wgpu::TextureCopyView srcCopyView = utils::CreateTextureCopyView(srcTexture, 0, {0, 0, 0});
+ wgpu::ImageCopyTexture copySrc = utils::CreateImageCopyTexture(srcTexture, 0, {0, 0, 0});
- wgpu::TextureCopyView dstCopyView = utils::CreateTextureCopyView(dstTexture, 0, {0, 0, 0});
+ wgpu::ImageCopyTexture copyDst = utils::CreateImageCopyTexture(dstTexture, 0, {0, 0, 0});
wgpu::Extent3D copySize = {1, 1, 1};
wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
- encoder.CopyTextureToTexture(&srcCopyView, &dstCopyView, ©Size);
+ encoder.CopyTextureToTexture(©Src, ©Dst, ©Size);
ASSERT_DEVICE_ERROR(encoder.Finish());
}
@@ -142,26 +142,26 @@
wgpu::Texture dstTexture = CreateVideoTextureForTest(
wgpu::TextureFormat::R8BG8Biplanar420Unorm, wgpu::TextureUsage::Sampled);
- wgpu::TextureCopyView srcCopyView =
- utils::CreateTextureCopyView(srcTexture, 0, {0, 0, 0}, wgpu::TextureAspect::Plane0Only);
+ wgpu::ImageCopyTexture copySrc = utils::CreateImageCopyTexture(
+ srcTexture, 0, {0, 0, 0}, wgpu::TextureAspect::Plane0Only);
- wgpu::TextureCopyView dstCopyView =
- utils::CreateTextureCopyView(dstTexture, 0, {0, 0, 0}, wgpu::TextureAspect::Plane1Only);
+ wgpu::ImageCopyTexture copyDst = utils::CreateImageCopyTexture(
+ dstTexture, 0, {0, 0, 0}, wgpu::TextureAspect::Plane1Only);
wgpu::Extent3D copySize = {1, 1, 1};
{
wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
- encoder.CopyTextureToTexture(&srcCopyView, &dstCopyView, ©Size);
+ encoder.CopyTextureToTexture(©Src, ©Dst, ©Size);
ASSERT_DEVICE_ERROR(encoder.Finish());
}
- srcCopyView =
- utils::CreateTextureCopyView(srcTexture, 0, {0, 0, 0}, wgpu::TextureAspect::Plane1Only);
+ copySrc = utils::CreateImageCopyTexture(srcTexture, 0, {0, 0, 0},
+ wgpu::TextureAspect::Plane1Only);
{
wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
- encoder.CopyTextureToTexture(&srcCopyView, &dstCopyView, ©Size);
+ encoder.CopyTextureToTexture(©Src, ©Dst, ©Size);
ASSERT_DEVICE_ERROR(encoder.Finish());
}
}
@@ -176,14 +176,14 @@
bufferDescriptor.usage = wgpu::BufferUsage::CopyDst;
wgpu::Buffer dstBuffer = device.CreateBuffer(&bufferDescriptor);
- wgpu::TextureCopyView srcCopyView = utils::CreateTextureCopyView(srcTexture, 0, {0, 0, 0});
+ wgpu::ImageCopyTexture copySrc = utils::CreateImageCopyTexture(srcTexture, 0, {0, 0, 0});
- wgpu::BufferCopyView dstCopyView = utils::CreateBufferCopyView(dstBuffer, 0, 4);
+ wgpu::ImageCopyBuffer copyDst = utils::CreateImageCopyBuffer(dstBuffer, 0, 4);
wgpu::Extent3D copySize = {1, 1, 1};
wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
- encoder.CopyTextureToBuffer(&srcCopyView, &dstCopyView, ©Size);
+ encoder.CopyTextureToBuffer(©Src, ©Dst, ©Size);
ASSERT_DEVICE_ERROR(encoder.Finish());
}
@@ -197,25 +197,25 @@
bufferDescriptor.usage = wgpu::BufferUsage::CopyDst;
wgpu::Buffer dstBuffer = device.CreateBuffer(&bufferDescriptor);
- wgpu::TextureCopyView srcCopyView =
- utils::CreateTextureCopyView(srcTexture, 0, {0, 0, 0}, wgpu::TextureAspect::Plane0Only);
+ wgpu::ImageCopyTexture copySrc = utils::CreateImageCopyTexture(
+ srcTexture, 0, {0, 0, 0}, wgpu::TextureAspect::Plane0Only);
- wgpu::BufferCopyView dstCopyView = utils::CreateBufferCopyView(dstBuffer, 0, 4);
+ wgpu::ImageCopyBuffer copyDst = utils::CreateImageCopyBuffer(dstBuffer, 0, 4);
wgpu::Extent3D copySize = {1, 1, 1};
{
wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
- encoder.CopyTextureToBuffer(&srcCopyView, &dstCopyView, ©Size);
+ encoder.CopyTextureToBuffer(©Src, ©Dst, ©Size);
ASSERT_DEVICE_ERROR(encoder.Finish());
}
- srcCopyView =
- utils::CreateTextureCopyView(srcTexture, 0, {0, 0, 0}, wgpu::TextureAspect::Plane1Only);
+ copySrc = utils::CreateImageCopyTexture(srcTexture, 0, {0, 0, 0},
+ wgpu::TextureAspect::Plane1Only);
{
wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
- encoder.CopyTextureToBuffer(&srcCopyView, &dstCopyView, ©Size);
+ encoder.CopyTextureToBuffer(©Src, ©Dst, ©Size);
ASSERT_DEVICE_ERROR(encoder.Finish());
}
}
@@ -230,14 +230,14 @@
wgpu::Texture dstTexture = CreateVideoTextureForTest(
wgpu::TextureFormat::R8BG8Biplanar420Unorm, wgpu::TextureUsage::Sampled);
- wgpu::BufferCopyView srcCopyView = utils::CreateBufferCopyView(srcBuffer, 0, 12, 4);
+ wgpu::ImageCopyBuffer copySrc = utils::CreateImageCopyBuffer(srcBuffer, 0, 12, 4);
- wgpu::TextureCopyView dstCopyView = utils::CreateTextureCopyView(dstTexture, 0, {0, 0, 0});
+ wgpu::ImageCopyTexture copyDst = utils::CreateImageCopyTexture(dstTexture, 0, {0, 0, 0});
wgpu::Extent3D copySize = {1, 1, 1};
wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
- encoder.CopyBufferToTexture(&srcCopyView, &dstCopyView, ©Size);
+ encoder.CopyBufferToTexture(©Src, ©Dst, ©Size);
ASSERT_DEVICE_ERROR(encoder.Finish());
}
@@ -251,25 +251,25 @@
wgpu::Texture dstTexture = CreateVideoTextureForTest(
wgpu::TextureFormat::R8BG8Biplanar420Unorm, wgpu::TextureUsage::Sampled);
- wgpu::BufferCopyView srcCopyView = utils::CreateBufferCopyView(srcBuffer, 0, 12, 4);
+ wgpu::ImageCopyBuffer copySrc = utils::CreateImageCopyBuffer(srcBuffer, 0, 12, 4);
- wgpu::TextureCopyView dstCopyView =
- utils::CreateTextureCopyView(dstTexture, 0, {0, 0, 0}, wgpu::TextureAspect::Plane0Only);
+ wgpu::ImageCopyTexture copyDst = utils::CreateImageCopyTexture(
+ dstTexture, 0, {0, 0, 0}, wgpu::TextureAspect::Plane0Only);
wgpu::Extent3D copySize = {1, 1, 1};
{
wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
- encoder.CopyBufferToTexture(&srcCopyView, &dstCopyView, ©Size);
+ encoder.CopyBufferToTexture(©Src, ©Dst, ©Size);
ASSERT_DEVICE_ERROR(encoder.Finish());
}
- dstCopyView =
- utils::CreateTextureCopyView(dstTexture, 0, {0, 0, 0}, wgpu::TextureAspect::Plane1Only);
+ copyDst = utils::CreateImageCopyTexture(dstTexture, 0, {0, 0, 0},
+ wgpu::TextureAspect::Plane1Only);
{
wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
- encoder.CopyBufferToTexture(&srcCopyView, &dstCopyView, ©Size);
+ encoder.CopyBufferToTexture(©Src, ©Dst, ©Size);
ASSERT_DEVICE_ERROR(encoder.Finish());
}
}
@@ -306,15 +306,16 @@
wgpu::TextureDataLayout textureDataLayout = utils::CreateTextureDataLayout(0, 4, 4);
- wgpu::TextureCopyView textureCopyView = utils::CreateTextureCopyView(texture, 0, {0, 0, 0});
+ wgpu::ImageCopyTexture imageCopyTexture =
+ utils::CreateImageCopyTexture(texture, 0, {0, 0, 0});
std::vector<uint8_t> dummyData(4, 0);
wgpu::Extent3D writeSize = {1, 1, 1};
wgpu::Queue queue = device.GetQueue();
- ASSERT_DEVICE_ERROR(queue.WriteTexture(&textureCopyView, dummyData.data(), dummyData.size(),
- &textureDataLayout, &writeSize));
+ ASSERT_DEVICE_ERROR(queue.WriteTexture(&imageCopyTexture, dummyData.data(),
+ dummyData.size(), &textureDataLayout, &writeSize));
}
// Tests writing into a multi-planar format per plane fails.
@@ -323,16 +324,16 @@
wgpu::TextureFormat::R8BG8Biplanar420Unorm, wgpu::TextureUsage::Sampled);
wgpu::TextureDataLayout textureDataLayout = utils::CreateTextureDataLayout(0, 12, 4);
- wgpu::TextureCopyView textureCopyView =
- utils::CreateTextureCopyView(texture, 0, {0, 0, 0}, wgpu::TextureAspect::Plane0Only);
+ wgpu::ImageCopyTexture imageCopyTexture =
+ utils::CreateImageCopyTexture(texture, 0, {0, 0, 0}, wgpu::TextureAspect::Plane0Only);
std::vector<uint8_t> dummmyData(4, 0);
wgpu::Extent3D writeSize = {1, 1, 1};
wgpu::Queue queue = device.GetQueue();
- ASSERT_DEVICE_ERROR(queue.WriteTexture(&textureCopyView, dummmyData.data(),
+ ASSERT_DEVICE_ERROR(queue.WriteTexture(&imageCopyTexture, dummmyData.data(),
dummmyData.size(), &textureDataLayout, &writeSize));
}
-} // anonymous namespace
\ No newline at end of file
+} // anonymous namespace
diff --git a/src/tests/white_box/VulkanImageWrappingTestsDmaBuf.cpp b/src/tests/white_box/VulkanImageWrappingTestsDmaBuf.cpp
index 3c90859..1ab886b 100644
--- a/src/tests/white_box/VulkanImageWrappingTestsDmaBuf.cpp
+++ b/src/tests/white_box/VulkanImageWrappingTestsDmaBuf.cpp
@@ -339,8 +339,9 @@
wgpu::Queue dawnQueue,
wgpu::Texture source,
wgpu::Texture destination) {
- wgpu::TextureCopyView copySrc = utils::CreateTextureCopyView(source, 0, {0, 0, 0});
- wgpu::TextureCopyView copyDst = utils::CreateTextureCopyView(destination, 0, {0, 0, 0});
+ wgpu::ImageCopyTexture copySrc = utils::CreateImageCopyTexture(source, 0, {0, 0, 0});
+ wgpu::ImageCopyTexture copyDst =
+ utils::CreateImageCopyTexture(destination, 0, {0, 0, 0});
wgpu::Extent3D copySize = {1, 1, 1};
@@ -531,9 +532,9 @@
wgpu::Buffer copyDstBuffer = device.CreateBuffer(&bufferDesc);
// Copy |deviceWrappedTexture| into |copyDstBuffer|
- wgpu::TextureCopyView copySrc =
- utils::CreateTextureCopyView(deviceWrappedTexture, 0, {0, 0, 0});
- wgpu::BufferCopyView copyDst = utils::CreateBufferCopyView(copyDstBuffer, 0, 256);
+ wgpu::ImageCopyTexture copySrc =
+ utils::CreateImageCopyTexture(deviceWrappedTexture, 0, {0, 0, 0});
+ wgpu::ImageCopyBuffer copyDst = utils::CreateImageCopyBuffer(copyDstBuffer, 0, 256);
wgpu::Extent3D copySize = {1, 1, 1};
@@ -585,9 +586,9 @@
utils::CreateBufferFromData(secondDevice, wgpu::BufferUsage::CopySrc, {0x04030201});
// Copy |copySrcBuffer| into |secondDeviceWrappedTexture|
- wgpu::BufferCopyView copySrc = utils::CreateBufferCopyView(copySrcBuffer, 0, 256);
- wgpu::TextureCopyView copyDst =
- utils::CreateTextureCopyView(secondDeviceWrappedTexture, 0, {0, 0, 0});
+ wgpu::ImageCopyBuffer copySrc = utils::CreateImageCopyBuffer(copySrcBuffer, 0, 256);
+ wgpu::ImageCopyTexture copyDst =
+ utils::CreateImageCopyTexture(secondDeviceWrappedTexture, 0, {0, 0, 0});
wgpu::Extent3D copySize = {1, 1, 1};
@@ -816,10 +817,10 @@
{
wgpu::Buffer copySrcBuffer = utils::CreateBufferFromData(
secondDevice, data.data(), data.size(), wgpu::BufferUsage::CopySrc);
- wgpu::BufferCopyView copySrc =
- utils::CreateBufferCopyView(copySrcBuffer, 0, bytesPerRow);
- wgpu::TextureCopyView copyDst =
- utils::CreateTextureCopyView(wrappedTexture, 0, {0, 0, 0});
+ wgpu::ImageCopyBuffer copySrc =
+ utils::CreateImageCopyBuffer(copySrcBuffer, 0, bytesPerRow);
+ wgpu::ImageCopyTexture copyDst =
+ utils::CreateImageCopyTexture(wrappedTexture, 0, {0, 0, 0});
wgpu::Extent3D copySize = {width, height, 1};
wgpu::CommandEncoder encoder = secondDevice.CreateCommandEncoder();
@@ -843,10 +844,10 @@
copyDesc.usage = wgpu::BufferUsage::CopySrc | wgpu::BufferUsage::CopyDst;
wgpu::Buffer copyDstBuffer = device.CreateBuffer(©Desc);
{
- wgpu::TextureCopyView copySrc =
- utils::CreateTextureCopyView(nextWrappedTexture, 0, {0, 0, 0});
- wgpu::BufferCopyView copyDst =
- utils::CreateBufferCopyView(copyDstBuffer, 0, bytesPerRow);
+ wgpu::ImageCopyTexture copySrc =
+ utils::CreateImageCopyTexture(nextWrappedTexture, 0, {0, 0, 0});
+ wgpu::ImageCopyBuffer copyDst =
+ utils::CreateImageCopyBuffer(copyDstBuffer, 0, bytesPerRow);
wgpu::Extent3D copySize = {width, height, 1};
diff --git a/src/tests/white_box/VulkanImageWrappingTestsOpaqueFD.cpp b/src/tests/white_box/VulkanImageWrappingTestsOpaqueFD.cpp
index b209ca7..7df34ab 100644
--- a/src/tests/white_box/VulkanImageWrappingTestsOpaqueFD.cpp
+++ b/src/tests/white_box/VulkanImageWrappingTestsOpaqueFD.cpp
@@ -455,12 +455,12 @@
wgpu::Queue dawnQueue,
wgpu::Texture source,
wgpu::Texture destination) {
- wgpu::TextureCopyView copySrc;
+ wgpu::ImageCopyTexture copySrc;
copySrc.texture = source;
copySrc.mipLevel = 0;
copySrc.origin = {0, 0, 0};
- wgpu::TextureCopyView copyDst;
+ wgpu::ImageCopyTexture copyDst;
copyDst.texture = destination;
copyDst.mipLevel = 0;
copyDst.origin = {0, 0, 0};
@@ -665,9 +665,9 @@
wgpu::Buffer copyDstBuffer = device.CreateBuffer(&bufferDesc);
// Copy |deviceWrappedTexture| into |copyDstBuffer|
- wgpu::TextureCopyView copySrc =
- utils::CreateTextureCopyView(deviceWrappedTexture, 0, {0, 0, 0});
- wgpu::BufferCopyView copyDst = utils::CreateBufferCopyView(copyDstBuffer, 0, 256);
+ wgpu::ImageCopyTexture copySrc =
+ utils::CreateImageCopyTexture(deviceWrappedTexture, 0, {0, 0, 0});
+ wgpu::ImageCopyBuffer copyDst = utils::CreateImageCopyBuffer(copyDstBuffer, 0, 256);
wgpu::Extent3D copySize = {1, 1, 1};
@@ -721,9 +721,9 @@
utils::CreateBufferFromData(secondDevice, wgpu::BufferUsage::CopySrc, {0x04030201});
// Copy |copySrcBuffer| into |secondDeviceWrappedTexture|
- wgpu::BufferCopyView copySrc = utils::CreateBufferCopyView(copySrcBuffer, 0, 256);
- wgpu::TextureCopyView copyDst =
- utils::CreateTextureCopyView(secondDeviceWrappedTexture, 0, {0, 0, 0});
+ wgpu::ImageCopyBuffer copySrc = utils::CreateImageCopyBuffer(copySrcBuffer, 0, 256);
+ wgpu::ImageCopyTexture copyDst =
+ utils::CreateImageCopyTexture(secondDeviceWrappedTexture, 0, {0, 0, 0});
wgpu::Extent3D copySize = {1, 1, 1};
@@ -979,10 +979,10 @@
{
wgpu::Buffer copySrcBuffer = utils::CreateBufferFromData(
secondDevice, data.data(), data.size(), wgpu::BufferUsage::CopySrc);
- wgpu::BufferCopyView copySrc =
- utils::CreateBufferCopyView(copySrcBuffer, 0, bytesPerRow);
- wgpu::TextureCopyView copyDst =
- utils::CreateTextureCopyView(wrappedTexture, 0, {0, 0, 0});
+ wgpu::ImageCopyBuffer copySrc =
+ utils::CreateImageCopyBuffer(copySrcBuffer, 0, bytesPerRow);
+ wgpu::ImageCopyTexture copyDst =
+ utils::CreateImageCopyTexture(wrappedTexture, 0, {0, 0, 0});
wgpu::Extent3D copySize = {width, height, 1};
wgpu::CommandEncoder encoder = secondDevice.CreateCommandEncoder();
@@ -1009,10 +1009,10 @@
copyDesc.usage = wgpu::BufferUsage::CopySrc | wgpu::BufferUsage::CopyDst;
wgpu::Buffer copyDstBuffer = device.CreateBuffer(©Desc);
{
- wgpu::TextureCopyView copySrc =
- utils::CreateTextureCopyView(nextWrappedTexture, 0, {0, 0, 0});
- wgpu::BufferCopyView copyDst =
- utils::CreateBufferCopyView(copyDstBuffer, 0, bytesPerRow);
+ wgpu::ImageCopyTexture copySrc =
+ utils::CreateImageCopyTexture(nextWrappedTexture, 0, {0, 0, 0});
+ wgpu::ImageCopyBuffer copyDst =
+ utils::CreateImageCopyBuffer(copyDstBuffer, 0, bytesPerRow);
wgpu::Extent3D copySize = {width, height, 1};
diff --git a/src/utils/TestUtils.cpp b/src/utils/TestUtils.cpp
index 6cbaa87..323c3c2 100644
--- a/src/utils/TestUtils.cpp
+++ b/src/utils/TestUtils.cpp
@@ -123,13 +123,14 @@
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
diff --git a/src/utils/WGPUHelpers.cpp b/src/utils/WGPUHelpers.cpp
index 8ac5387..8370c91 100644
--- a/src/utils/WGPUHelpers.cpp
+++ b/src/utils/WGPUHelpers.cpp
@@ -268,28 +268,28 @@
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,
diff --git a/src/utils/WGPUHelpers.h b/src/utils/WGPUHelpers.h
index 86dbb4e..0a36251 100644
--- a/src/utils/WGPUHelpers.h
+++ b/src/utils/WGPUHelpers.h
@@ -50,11 +50,11 @@
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,