MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / AcquireQuery

Method AcquireQuery

Source/Engine/GraphicsDevice/Vulkan/GPUDeviceVulkan.cpp:676–701  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

674}
675
676bool BufferedQueryPoolVulkan::AcquireQuery(CmdBufferVulkan* cmdBuffer, uint32& resultIndex)
677{
678 const uint64 allUsedMask = MAX_uint64;
679 for (int32 wordIndex = _lastBeginIndex / 64; wordIndex < _usedQueryBits.Count(); wordIndex++)
680 {
681 uint64 beginQueryWord = _usedQueryBits[wordIndex];
682 if (beginQueryWord != allUsedMask)
683 {
684 resultIndex = 0;
685 while ((beginQueryWord & 1) == 1)
686 {
687 resultIndex++;
688 beginQueryWord >>= 1;
689 }
690 resultIndex += wordIndex * 64;
691 const uint64 bit = (uint64)1 << (uint64)(resultIndex % 64);
692 _usedQueryBits[wordIndex] = _usedQueryBits[wordIndex] | bit;
693 _readResultsBits[wordIndex] &= ~bit;
694 _lastBeginIndex = resultIndex + 1;
695 if (ResetBeforeUse)
696 Reset(cmdBuffer);
697 return true;
698 }
699 }
700 return false;
701}
702
703void BufferedQueryPoolVulkan::ReleaseQuery(uint32 queryIndex)
704{

Callers 2

BeginQueryMethod · 0.80
WriteTimestampMethod · 0.80

Calls 2

ResetFunction · 0.50
CountMethod · 0.45

Tested by

no test coverage detected