Rename d3d12 Device tick functions to Tick

This commit is contained in:
Austin Eng 2017-06-28 11:06:46 -04:00 committed by Austin Eng
parent 6103c62489
commit beb76d06db
7 changed files with 11 additions and 11 deletions

View File

@ -30,7 +30,7 @@ namespace d3d12 {
if (freeAllocators.none()) {
const uint64_t firstSerial = inFlightCommandAllocators.FirstSerial();
device->WaitForSerial(firstSerial);
ResetCompletedAllocators(firstSerial);
Tick(firstSerial);
}
ASSERT(freeAllocators.any());
@ -53,7 +53,7 @@ namespace d3d12 {
return commandAllocators[firstFreeIndex];
}
void CommandAllocatorManager::ResetCompletedAllocators(uint64_t lastCompletedSerial) {
void CommandAllocatorManager::Tick(uint64_t lastCompletedSerial) {
// Reset all command allocators that are no longer in flight
for (auto it : inFlightCommandAllocators.IterateUpTo(lastCompletedSerial)) {
ASSERT_SUCCESS(it.commandAllocator->Reset());

View File

@ -33,7 +33,7 @@ namespace d3d12 {
// A CommandAllocator that is reserved must be used on the next ExecuteCommandLists
// otherwise its commands may be reset before execution has completed on the GPU
ComPtr<ID3D12CommandAllocator> ReserveCommandAllocator();
void ResetCompletedAllocators(uint64_t lastCompletedSerial);
void Tick(uint64_t lastCompletedSerial);
private:
Device* device;

View File

@ -159,9 +159,9 @@ namespace d3d12 {
void Device::TickImpl() {
// Perform cleanup operations to free unused objects
const uint64_t lastCompletedSerial = fence->GetCompletedValue();
resourceAllocator->FreeUnusedResources(lastCompletedSerial);
commandAllocatorManager->ResetCompletedAllocators(lastCompletedSerial);
descriptorHeapAllocator->FreeDescriptorHeaps(lastCompletedSerial);
resourceAllocator->Tick(lastCompletedSerial);
commandAllocatorManager->Tick(lastCompletedSerial);
descriptorHeapAllocator->Tick(lastCompletedSerial);
}
uint64_t Device::GetSerial() const {

View File

@ -101,7 +101,7 @@ namespace d3d12 {
return Allocate(type, count, heapSize, &gpuDescriptorHeapInfos[type], D3D12_DESCRIPTOR_HEAP_FLAG_SHADER_VISIBLE);
}
void DescriptorHeapAllocator::FreeDescriptorHeaps(uint64_t lastCompletedSerial) {
void DescriptorHeapAllocator::Tick(uint64_t lastCompletedSerial) {
releasedHandles.ClearUpTo(lastCompletedSerial);
}

View File

@ -49,7 +49,7 @@ namespace d3d12 {
DescriptorHeapHandle AllocateGPUHeap(D3D12_DESCRIPTOR_HEAP_TYPE type, uint32_t count);
DescriptorHeapHandle AllocateCPUHeap(D3D12_DESCRIPTOR_HEAP_TYPE type, uint32_t count);
void FreeDescriptorHeaps(uint64_t lastCompletedSerial);
void Tick(uint64_t lastCompletedSerial);
private:
static constexpr unsigned int kMaxCbvUavSrvHeapSize = 1000000;

View File

@ -84,7 +84,7 @@ namespace d3d12 {
releasedResources.Enqueue(resource, device->GetSerial());
}
void ResourceAllocator::FreeUnusedResources(uint64_t lastCompletedSerial) {
void ResourceAllocator::Tick(uint64_t lastCompletedSerial) {
releasedResources.ClearUpTo(lastCompletedSerial);
}

View File

@ -31,7 +31,7 @@ namespace d3d12 {
ComPtr<ID3D12Resource> Allocate(D3D12_HEAP_TYPE heapType, const D3D12_RESOURCE_DESC &resourceDescriptor, D3D12_RESOURCE_STATES initialUsage);
void Release(ComPtr<ID3D12Resource> resource);
void FreeUnusedResources(uint64_t lastCompletedSerial);
void Tick(uint64_t lastCompletedSerial);
private:
Device* device;