Rename d3d12 Device tick functions to Tick
This commit is contained in:
parent
6103c62489
commit
beb76d06db
|
@ -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());
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue