D3D12: Fix usage of CopyResource

CopyResource may only be used for resources that have exactly the same
format, dimension, mips, layers. And it can only be used if the entire
texture region is copied.

Bug: dawn:353
Change-Id: Ia8f96cc10c88fe026e23bce2d0532624725b12e0
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/16984
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
This commit is contained in:
Austin Eng
2020-03-18 01:11:17 +00:00
committed by Commit Bot service account
parent b988e03982
commit 83e138ca96
2 changed files with 52 additions and 13 deletions

View File

@@ -729,6 +729,24 @@ TEST_P(CopyTests_T2T, TextureMip) {
}
}
TEST_P(CopyTests_T2T, SingleMipSrcMultipleMipDst) {
constexpr uint32_t kWidth = 256;
constexpr uint32_t kHeight = 128;
for (unsigned int i = 1; i < 4; ++i) {
DoTest({kWidth >> i, kHeight >> i, 0, 0, 0}, {kWidth, kHeight, 0, 0, i},
{kWidth >> i, kHeight >> i});
}
}
TEST_P(CopyTests_T2T, MultipleMipSrcSingleMipDst) {
constexpr uint32_t kWidth = 256;
constexpr uint32_t kHeight = 128;
for (unsigned int i = 1; i < 4; ++i) {
DoTest({kWidth, kHeight, 0, 0, i}, {kWidth >> i, kHeight >> i, 0, 0, 0},
{kWidth >> i, kHeight >> i});
}
}
// TODO(brandon1.jones@intel.com) Add test for ensuring blitCommandEncoder on Metal.
DAWN_INSTANTIATE_TEST(CopyTests_T2T, D3D12Backend(), MetalBackend(), OpenGLBackend(), VulkanBackend());