Implement texture subresource on D3D12

When we use a texture for different purpose, we need to add proper
barrier(s) in order to make it ready. Previously, the barrier is
done per entire texture. So it is invalid to sample/read/copy from
one subresource (say a mip/array slice) and render/write/copy to
another subresource of the same texture at the same time.

With this patch, barrier is set per each texture subresource. So it is
valid to use a subresource as source and use another subresource of the
same texture as destination at the same time.

However, planar slices like depth/stencil planes are not handled
gracefully. This is a TODO task. Another task is to combine barriers
into one if they can be combined. I will do this optimization in
another patch in near future.

Bug: dawn:157

Change-Id: I783a76cb88fcdffb60c307ddfb89d50f1583201a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/22101
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Yunchao He <yunchao.he@intel.com>
This commit is contained in:
Yunchao He
2020-06-09 16:18:04 +00:00
committed by Commit Bot service account
parent c8000bb02b
commit 182af0a4c2
6 changed files with 257 additions and 144 deletions

View File

@@ -196,4 +196,8 @@ TEST_P(TextureSubresourceTest, ArrayLayersTest) {
//
// * add tests for clear operation upon texture subresource if needed
DAWN_INSTANTIATE_TEST(TextureSubresourceTest, MetalBackend(), OpenGLBackend(), VulkanBackend());
DAWN_INSTANTIATE_TEST(TextureSubresourceTest,
D3D12Backend(),
MetalBackend(),
OpenGLBackend(),
VulkanBackend());