Optimize CPU particles drawing to support async

This commit is contained in:
Wojtek Figat
2025-08-05 09:03:47 +02:00
parent abe496fe12
commit 1a88fefd76
8 changed files with 59 additions and 41 deletions

View File

@@ -91,16 +91,9 @@ void BitonicSort::Dispose()
void BitonicSort::Sort(GPUContext* context, GPUBuffer* sortingKeysBuffer, GPUBuffer* countBuffer, uint32 counterOffset, bool sortAscending, GPUBuffer* sortedIndicesBuffer)
{
ASSERT(context && sortingKeysBuffer && countBuffer);
PROFILE_GPU_CPU("Bitonic Sort");
// Check if has missing resources
if (checkIfSkipPass())
{
return;
}
// Prepare
PROFILE_GPU_CPU("Bitonic Sort");
const uint32 elementSizeBytes = sizeof(uint64);
const uint32 maxNumElements = sortingKeysBuffer->GetSize() / elementSizeBytes;
const uint32 alignedMaxNumElements = Math::RoundUpToPowerOf2(maxNumElements);