Track batch fences with the batches.

This commit is contained in:
Dr. Chat
2016-11-08 18:11:12 -06:00
parent 391b6e9bb7
commit 48f6ba747c
11 changed files with 255 additions and 108 deletions

View File

@@ -164,8 +164,8 @@ bool CircularBuffer::CanAcquire(VkDeviceSize length) {
return false;
}
CircularBuffer::Allocation* CircularBuffer::Acquire(
VkDeviceSize length, std::shared_ptr<Fence> fence) {
CircularBuffer::Allocation* CircularBuffer::Acquire(VkDeviceSize length,
VkFence fence) {
VkDeviceSize aligned_length = xe::round_up(length, alignment_);
if (!CanAcquire(aligned_length)) {
return nullptr;
@@ -243,7 +243,7 @@ void CircularBuffer::Clear() {
void CircularBuffer::Scavenge() {
for (auto it = allocations_.begin(); it != allocations_.end();) {
if ((*it)->fence->status() != VK_SUCCESS) {
if (vkGetFenceStatus(*device_, (*it)->fence) != VK_SUCCESS) {
// Don't bother freeing following allocations to ensure proper ordering.
break;
}