diff --git a/src/dawn_native/d3d12/TextureD3D12.cpp b/src/dawn_native/d3d12/TextureD3D12.cpp index 62fe6e9b2b..7767aa8d5d 100644 --- a/src/dawn_native/d3d12/TextureD3D12.cpp +++ b/src/dawn_native/d3d12/TextureD3D12.cpp @@ -722,6 +722,12 @@ namespace dawn_native { namespace d3d12 { CommandRecordingContext* commandContext, std::vector* barriers, const PassTextureUsage& textureUsages) { + if (mResourceAllocation.GetInfo().mMethod != AllocationMethod::kExternal) { + // Track the underlying heap to ensure residency. + Heap* heap = ToBackend(mResourceAllocation.GetResourceHeap()); + commandContext->TrackHeapUsage(heap, GetDevice()->GetPendingCommandSerial()); + } + HandleTransitionSpecialCases(commandContext); const Serial pendingCommandSerial = ToBackend(GetDevice())->GetPendingCommandSerial();