29#ifndef CM_RADIX_SORT_H
30#define CM_RADIX_SORT_H
32#include "common/PxPhysXCommonConfig.h"
43 RADIX_FORCE_DWORD = 0x7fffffff
46#define INVALIDATE_RANKS mCurrentSize|=0x80000000
47#define VALIDATE_RANKS mCurrentSize&=0x7fffffff
48#define CURRENT_SIZE (mCurrentSize&0x7fffffff)
49#define INVALID_RANKS (mCurrentSize&0x80000000)
58 RadixSort& Sort(
const PxU32* input, PxU32 nb, RadixHint hint=RADIX_SIGNED);
59 RadixSort& Sort(
const float* input, PxU32 nb);
74 bool SetBuffers(PxU32* ranks0, PxU32* ranks1, PxU32* histogram1024, PxU32** links256);
79 PxU32* mHistogram1024;
89 #define StackRadixSort(name, ranks0, ranks1) \
91 PxU32 histogramBuffer[1024]; \
92 PxU32* linksBuffer[256]; \
93 name.SetBuffers(ranks0, ranks1, histogramBuffer, linksBuffer);
103 RadixSortBuffered& Sort(
const PxU32* input, PxU32 nb, RadixHint hint=RADIX_SIGNED);
111 void CheckResize(PxU32 nb);
112 bool Resize(PxU32 nb);
Definition CmRadixSort.h:96
Definition CmRadixSort.h:52
PX_FORCE_INLINE PxU32 GetNbHits() const
Returns the number of eraly exits due to temporal coherence.
Definition CmRadixSort.h:70
PxU32 mCurrentSize
Current size of the indices list.
Definition CmRadixSort.h:76
PxU32 * mRanks
Two lists, swapped each pass.
Definition CmRadixSort.h:77
PX_FORCE_INLINE PxU32 * GetRecyclable() const
mIndices2 gets trashed on calling the sort routine, but otherwise you can recycle it the way you want...
Definition CmRadixSort.h:65
PxU32 mTotalCalls
Total number of calls to the sort routine.
Definition CmRadixSort.h:82
PxU32 mNbHits
Number of early exits due to coherence.
Definition CmRadixSort.h:83
PX_FORCE_INLINE PxU32 GetNbTotalCalls() const
Returns the total number of calls to the radix sorter.
Definition CmRadixSort.h:68
PX_FORCE_INLINE const PxU32 * GetRanks() const
Access to results. mRanks is a list of indices in sorted order, i.e. in the order you may further pro...
Definition CmRadixSort.h:62
#define PX_FORCE_INLINE
Definition PxPreprocessor.h:335
Sorts an array of objects in ascending order, assuming that the predicate implements the < operator:
Definition PxBoxController.h:39