mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-07-08 06:05:55 +00:00
Change D3D12 Descriptor Allocator To Invalidate Submitted Descriptors
Changes D3D12 descriptor allocator to invalidate existing descriptors after the descriptor heap was submitted for use. This fixes a synchonization issue where stale descriptors were seen as valid because command list execution ran long. Bug: dawn:1701 Change-Id: Ibfd450b3be6cf91d66e8dce4ffd19ecf1a37f7f5 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/129920 Kokoro: Kokoro <noreply+kokoro@google.com> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Brandon1 Jones <brandon1.jones@intel.com>
This commit is contained in:
parent
948ef4292f
commit
df6cb23649
@ -237,9 +237,11 @@ bool ShaderVisibleDescriptorAllocator::IsLastShaderVisibleHeapInLRUForTesting()
|
|||||||
|
|
||||||
bool ShaderVisibleDescriptorAllocator::IsAllocationStillValid(
|
bool ShaderVisibleDescriptorAllocator::IsAllocationStillValid(
|
||||||
const GPUDescriptorHeapAllocation& allocation) const {
|
const GPUDescriptorHeapAllocation& allocation) const {
|
||||||
// Consider valid if allocated for the pending submit and the shader visible heaps
|
// Descriptor allocations are only valid for the serial they were created for and are
|
||||||
// have not switched over.
|
// re-allocated every submit. For this reason, we view any descriptors allocated prior to the
|
||||||
return (allocation.GetLastUsageSerial() > mDevice->GetCompletedCommandSerial() &&
|
// pending submit as invalid. We must also verify the descriptor heap has not switched (because
|
||||||
|
// a larger descriptor heap was needed).
|
||||||
|
return (allocation.GetLastUsageSerial() == mDevice->GetPendingCommandSerial() &&
|
||||||
allocation.GetHeapSerial() == mHeapSerial);
|
allocation.GetHeapSerial() == mHeapSerial);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user