mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-10-17 23:45:16 +00:00
Calling ID3D12SharingContract::Present issues GPU work on the command queue which needs to be synchronized with resource deallocation. This seems to work now perhaps due to the keyed mutex semantics keeping the D3D11 texture alive for longer than necessary. With fences, this missing synchronization causes the validation layers to complain about early deallocation of the ID3D12Resource. Moving the Present to SynchronizeImportTextureBeforeUse ensures that it happens before NextSerial and hence the signal fence that's recorded will include any GPU work issued by Present. Also, resource deallocation will happen after this work. However, this has the side-effect of PIX seeing more frames, once per ExecuteCommandLists, but it could be argued that's more accurate and useful. Bug: dawn:1544 Change-Id: I1b417049045a812837f67072d7f09ac47bc18125 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/103841 Reviewed-by: Austin Eng <enga@chromium.org> Kokoro: Kokoro <noreply+kokoro@google.com> Commit-Queue: Sunny Sachanandani <sunnyps@chromium.org>