WickedEngine/wiGraphicsDevice_DX12.h
void Update(uint64_t FRAMECOUNT, uint32_t BUFFERCOUNT)
			{
				destroylocker.lock();
				framecount = FRAMECOUNT;
				while (!destroyer_allocations.empty())
				{
					if (destroyer_allocations.front().second + BUFFERCOUNT < FRAMECOUNT)
					{
						auto item = destroyer_allocations.front();
						destroyer_allocations.pop_front();
						item.first->Release();
					}
					else
					{
						break;
					}
				}
				while (!destroyer_resources.empty())
				{
					if (destroyer_resources.front().second + BUFFERCOUNT < FRAMECOUNT)
					{
						destroyer_resources.pop_front();
						// comptr auto delete
					}
					else
					{
						break;
					}
				}
				while (!destroyer_queryheaps.empty())
				{
					if (destroyer_queryheaps.front().second + BUFFERCOUNT < FRAMECOUNT)
					{
						destroyer_queryheaps.pop_front();
						// comptr auto delete
					}
					else
					{
						break;
					}
				}
				while (!destroyer_pipelines.empty())
				{
					if (destroyer_pipelines.front().second + BUFFERCOUNT < FRAMECOUNT)
					{
						destroyer_pipelines.pop_front();
						// comptr auto delete
					}
					else
					{
						break;
					}
				}
				while (!destroyer_rootSignatures.empty())
				{
					if (destroyer_rootSignatures.front().second + BUFFERCOUNT < FRAMECOUNT)
					{
						destroyer_rootSignatures.pop_front();
						// comptr auto delete
					}
					else
					{
						break;
					}
				}
				while (!destroyer_stateobjects.empty())
				{
					if (destroyer_stateobjects.front().second + BUFFERCOUNT < FRAMECOUNT)
					{
						destroyer_stateobjects.pop_front();
						// comptr auto delete
					}
					else
					{
						break;
					}
				}
				while (!destroyer_bindless_res.empty())
				{
					if (destroyer_bindless_res.front().second + BUFFERCOUNT < FRAMECOUNT)
					{
						int index = destroyer_bindless_res.front().first;
						destroyer_bindless_res.pop_front();
						free_bindless_res.push_back(index);
					}
					else
					{
						break;
					}
				}
				while (!destroyer_bindless_sam.empty())
				{
					if (destroyer_bindless_sam.front().second + BUFFERCOUNT < FRAMECOUNT)
					{
						int index = destroyer_bindless_sam.front().first;
						destroyer_bindless_sam.pop_front();
						free_bindless_sam.push_back(index);
					}
					else
					{
						break;
					}
				}
				destroylocker.unlock();
			}
// Deferred destroy of resources that the GPU is already finished with:
Deferred destroy of resources that the GPU is already finished with.
Deferred destroy of resources that the GPU is already finished with .
void Update(uint64_t FRAMECOUNT, uint32_t BUFFERCOUNT)
			{
				destroylocker.lock();
				framecount = FRAMECOUNT;
				while (!destroyer_allocations.empty())
				{
					if (destroyer_allocations.front().second + BUFFERCOUNT < FRAMECOUNT)
					{
						auto item = destroyer_allocations.front();
						destroyer_allocations.pop_front();
						item.first->Release();
					}
					else
					{
						break;
					}
				}
				while (!destroyer_resources.empty())
				{
					if (destroyer_resources.front().second + BUFFERCOUNT < FRAMECOUNT)
					{
						destroyer_resources.pop_front();
					}
					else
					{
						break;
					}
				}
				while (!destroyer_queryheaps.empty())
				{
					if (destroyer_queryheaps.front().second + BUFFERCOUNT < FRAMECOUNT)
					{
						destroyer_queryheaps.pop_front();
					}
					else
					{
						break;
					}
				}
				while (!destroyer_pipelines.empty())
				{
					if (destroyer_pipelines.front().second + BUFFERCOUNT < FRAMECOUNT)
					{
						destroyer_pipelines.pop_front();
					}
					else
					{
						break;
					}
				}
				while (!destroyer_rootSignatures.empty())
				{
					if (destroyer_rootSignatures.front().second + BUFFERCOUNT < FRAMECOUNT)
					{
						destroyer_rootSignatures.pop_front();
					}
					else
					{
						break;
					}
				}
				while (!destroyer_stateobjects.empty())
				{
					if (destroyer_stateobjects.front().second + BUFFERCOUNT < FRAMECOUNT)
					{
						destroyer_stateobjects.pop_front();
					}
					else
					{
						break;
					}
				}
				while (!destroyer_bindless_res.empty())
				{
					if (destroyer_bindless_res.front().second + BUFFERCOUNT < FRAMECOUNT)
					{
						int index = destroyer_bindless_res.front().first;
						destroyer_bindless_res.pop_front();
						free_bindless_res.push_back(index);
					}
					else
					{
						break;
					}
				}
				while (!destroyer_bindless_sam.empty())
				{
					if (destroyer_bindless_sam.front().second + BUFFERCOUNT < FRAMECOUNT)
					{
						int index = destroyer_bindless_sam.front().first;
						destroyer_bindless_sam.pop_front();
						free_bindless_sam.push_back(index);
					}
					else
					{
						break;
					}
				}
				destroylocker.unlock();
			}
void Update ( uint64_t FRAMECOUNT , uint32_t BUFFERCOUNT ) { destroylocker . lock ( ) ; framecount = FRAMECOUNT ; while ( ! destroyer_allocations . empty ( ) ) { if ( destroyer_allocations . front ( ) . second + BUFFERCOUNT < FRAMECOUNT ) { auto item = destroyer_allocations . front ( ) ; destroyer_allocations . pop_front ( ) ; item . first -> Release ( ) ; } else { break ; } } while ( ! destroyer_resources . empty ( ) ) { if ( destroyer_resources . front ( ) . second + BUFFERCOUNT < FRAMECOUNT ) { destroyer_resources . pop_front ( ) ; } else { break ; } } while ( ! destroyer_queryheaps . empty ( ) ) { if ( destroyer_queryheaps . front ( ) . second + BUFFERCOUNT < FRAMECOUNT ) { destroyer_queryheaps . pop_front ( ) ; } else { break ; } } while ( ! destroyer_pipelines . empty ( ) ) { if ( destroyer_pipelines . front ( ) . second + BUFFERCOUNT < FRAMECOUNT ) { destroyer_pipelines . pop_front ( ) ; } else { break ; } } while ( ! destroyer_rootSignatures . empty ( ) ) { if ( destroyer_rootSignatures . front ( ) . second + BUFFERCOUNT < FRAMECOUNT ) { destroyer_rootSignatures . pop_front ( ) ; } else { break ; } } while ( ! destroyer_stateobjects . empty ( ) ) { if ( destroyer_stateobjects . front ( ) . second + BUFFERCOUNT < FRAMECOUNT ) { destroyer_stateobjects . pop_front ( ) ; } else { break ; } } while ( ! destroyer_bindless_res . empty ( ) ) { if ( destroyer_bindless_res . front ( ) . second + BUFFERCOUNT < FRAMECOUNT ) { int index = destroyer_bindless_res . front ( ) . first ; destroyer_bindless_res . pop_front ( ) ; free_bindless_res . push_back ( index ) ; } else { break ; } } while ( ! destroyer_bindless_sam . empty ( ) ) { if ( destroyer_bindless_sam . front ( ) . second + BUFFERCOUNT < FRAMECOUNT ) { int index = destroyer_bindless_sam . front ( ) . first ; destroyer_bindless_sam . pop_front ( ) ; free_bindless_sam . push_back ( index ) ; } else { break ; } } destroylocker . unlock ( ) ; }
Deferred destroy of resources that the GPU is already finished with:
Deferred destroy of resources that the GPU is already finished with :
// comptr auto delete // comptr auto delete // comptr auto delete // comptr auto delete // comptr auto delete