Clear D3D12 texture on first usage if not yet initialized

This prevents dirty textures to be used when memory is recycled while
destroying/creating new textures. If a texture is being used for the
first time and has not yet been initialized, it will be cleared
to zeros.

Bug: dawn:145
Change-Id: I8b9571c5a8fdd366717ffbd0fafca89b86653cea
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/8062
Commit-Queue: Natasha Lee <natlee@microsoft.com>
Reviewed-by: Austin Eng <enga@chromium.org>
This commit is contained in:
Natasha Lee
2019-06-24 17:49:46 +00:00
committed by Commit Bot service account
parent 5dee3e826b
commit 99b76d1b8f
4 changed files with 205 additions and 40 deletions

View File

@@ -400,5 +400,7 @@ TEST_P(TextureZeroInitTest, DepthStencilClear) {
}
DAWN_INSTANTIATE_TEST(TextureZeroInitTest,
ForceWorkarounds(D3D12Backend,
{"nonzero_clear_resources_on_creation_for_testing"}),
ForceWorkarounds(VulkanBackend,
{"nonzero_clear_resources_on_creation_for_testing"}));