mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-14 07:36:15 +00:00
Support Noop Copy for B2T, T2B and T2T Copies
In B2T, T2B and T2T copies, copySize has 0 in width, height or depth will trigger errors in D3D12 backend. This patch bypass the command record step for noop copy. But all validation rules still applies to the copy. BUG=dawn:255 Change-Id: I4d01cef2e3c1f78440014c2c6ac63a48310d99af Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/28521 Commit-Queue: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
committed by
Commit Bot service account
parent
a3651d2fe0
commit
75e5ed6161
@@ -87,6 +87,14 @@ namespace utils {
|
||||
}
|
||||
}
|
||||
|
||||
uint64_t GetTexelCountInCopyRegion(uint64_t bytesPerRow,
|
||||
uint64_t rowsPerImage,
|
||||
wgpu::Extent3D copyExtent,
|
||||
wgpu::TextureFormat textureFormat) {
|
||||
return RequiredBytesInCopy(bytesPerRow, rowsPerImage, copyExtent, textureFormat) /
|
||||
utils::GetTexelBlockSizeInBytes(textureFormat);
|
||||
}
|
||||
|
||||
void UnalignDynamicUploader(wgpu::Device device) {
|
||||
std::vector<uint8_t> data = {1};
|
||||
|
||||
|
||||
@@ -46,6 +46,11 @@ namespace utils {
|
||||
wgpu::Extent3D copyExtent,
|
||||
wgpu::TextureFormat textureFormat);
|
||||
|
||||
uint64_t GetTexelCountInCopyRegion(uint64_t bytesPerRow,
|
||||
uint64_t rowsPerImage,
|
||||
wgpu::Extent3D copyExtent,
|
||||
wgpu::TextureFormat textureFormat);
|
||||
|
||||
// A helper function used for testing DynamicUploader offset alignment.
|
||||
// A call of this function will do a Queue::WriteTexture with 1 byte of data,
|
||||
// so that assuming that WriteTexture uses DynamicUploader, the first RingBuffer
|
||||
|
||||
Reference in New Issue
Block a user