Re-add heap usage tracking for textures in a pass

Heap usage tracking for textures in a pass was mistakenly removed when
texture subresource transitions was implemented. This must be re-added
for residency management to work (and not crash the application).

Bug: dawn:193
Change-Id: Ie5e9622f88a70d153232d5d72bb11846f4164e87
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/26461
Reviewed-by: Rafael Cintron <rafael.cintron@microsoft.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Brandon Jones <brandon1.jones@intel.com>
This commit is contained in:
Brandon Jones 2020-08-10 16:58:29 +00:00 committed by Commit Bot service account
parent 1662e97f32
commit ccf01e74ec
1 changed files with 6 additions and 0 deletions

View File

@ -722,6 +722,12 @@ namespace dawn_native { namespace d3d12 {
CommandRecordingContext* commandContext,
std::vector<D3D12_RESOURCE_BARRIER>* 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();