Don't clear depth stencil textures when created as committed resource

The toggle D3D12ForceClearCopyableDepthStencilTextureOnCreation can be
disabled when the toggle D3D12Allocate2DTexturewithCopyDstAsCommittedResource
is enabled because with D3D12Allocate2DTexturewithCopyDstAsCommittedResource
all the depth stencil textures (can only be 2D textures) with CopyDst usage
have already been created with CreateCommittedResource() instead of
CreatePlacedResource(), thus the driver issue about creating depth stencil
texture on a dirty heap with CreatePlacedResource() won't be triggered.

Bug: dawn:1487, chromium:1237175
Change-Id: I872d4d95e6e05e1bcf9489b31a72e61f957de3e5
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/116129
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
Jiawei Shao 2023-01-05 01:30:54 +00:00 committed by Dawn LUCI CQ
parent 3e61641e12
commit 786d4b12dd
1 changed files with 4 additions and 0 deletions

View File

@ -733,6 +733,10 @@ void Device::InitTogglesFromDriver() {
if ((gpu_info::IsIntelGen9(vendorId, deviceId) && !gpu_info::IsSkylake(deviceId)) ||
gpu_info::IsIntelGen11(vendorId, deviceId)) {
SetToggle(Toggle::D3D12Allocate2DTexturewithCopyDstAsCommittedResource, true);
// Now we don't need to force clearing depth stencil textures with CopyDst as all the depth
// stencil textures (can only be 2D textures) will be created with CreateCommittedResource()
// instead of CreatePlacedResource().
SetToggle(Toggle::D3D12ForceClearCopyableDepthStencilTextureOnCreation, false);
}
// Currently this toggle is only needed on Intel Gen9 and Gen9.5 GPUs.