Cleanup: always clear Vulkan textures with vkCmdClear*Image

Previously, this code path was gated on whether or not the texture
format is renderable. This should not be the case as this Vulkan
command only requires the texture to have TRANSFER_DST.

Bug: dawn:145
Change-Id: Ifd8f75a70477a8d159c04d1180247cd076c767bc
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/27941
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
This commit is contained in:
Austin Eng
2020-09-02 21:03:29 +00:00
committed by Commit Bot service account
parent ea82272fd6
commit a1758eef07
2 changed files with 64 additions and 95 deletions

View File

@@ -143,7 +143,8 @@ TEST_P(NonzeroTextureCreationTests, NonrenderableTextureFormat) {
wgpu::CommandBuffer commands = encoder.Finish();
queue.Submit(1, &commands);
std::vector<uint32_t> expected(bufferSize, 0x01010101);
uint32_t expectedBytes = IsVulkan() ? 0x7F7F7F7F : 0x01010101;
std::vector<uint32_t> expected(bufferSize, expectedBytes);
EXPECT_BUFFER_U32_RANGE_EQ(expected.data(), bufferDst, 0, 8);
}
@@ -176,7 +177,8 @@ TEST_P(NonzeroTextureCreationTests, NonRenderableTextureClearWithMultiArrayLayer
wgpu::CommandBuffer commands = encoder.Finish();
queue.Submit(1, &commands);
std::vector<uint32_t> expected(bufferSize, 0x01010101);
uint32_t expectedBytes = IsVulkan() ? 0x7F7F7F7F : 0x01010101;
std::vector<uint32_t> expected(bufferSize, expectedBytes);
EXPECT_BUFFER_U32_RANGE_EQ(expected.data(), bufferDst, 0, 8);
}
@@ -244,7 +246,7 @@ TEST_P(NonzeroTextureCreationTests, NonRenderableAllSubresourcesFilled) {
baseDescriptor.mipLevelCount = 1;
baseDescriptor.usage = wgpu::TextureUsage::CopySrc;
RGBA8 filled(1, 1, 1, 1);
RGBA8 filled = IsVulkan() ? RGBA8(127, 127, 127, 127) : RGBA8(1, 1, 1, 1);
{
wgpu::TextureDescriptor descriptor = baseDescriptor;