HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GR_Utils::RadixSortGPU Class Reference

#include <GR_UtilsVK.h>

Public Member Functions

 RadixSortGPU (uint num_instance)
 
void setupRadixSortGPUIndirect (RV_Render *rv, UT_UniquePtr< RV_ShaderBlock > &draw_indirect_params, RV_VKBuffer *keys_buffer, RV_VKBuffer *indices_buffer)
 
void setupRadixSortGPU (RV_Render *rv, RV_VKBuffer *keys_buffer, RV_VKBuffer *indices_buffer)
 
void radixSortGPU (RV_Render *rv, RV_VKBuffer *keys_buffer, RV_VKBuffer *indices_buffer)
 

Static Public Member Functions

static bool initShaders (RV_Instance *inst)
 
static void cleanupShaders ()
 

Detailed Description

The RadixSortGPU requires calling a setup function once during initialization, after which the sort can be invoked as needed.

Definition at line 272 of file GR_UtilsVK.h.

Constructor & Destructor Documentation

GR_Utils::RadixSortGPU::RadixSortGPU ( uint  num_instance)
inline

Definition at line 275 of file GR_UtilsVK.h.

Member Function Documentation

static void GR_Utils::RadixSortGPU::cleanupShaders ( )
static
static bool GR_Utils::RadixSortGPU::initShaders ( RV_Instance inst)
static
void GR_Utils::RadixSortGPU::radixSortGPU ( RV_Render rv,
RV_VKBuffer keys_buffer,
RV_VKBuffer indices_buffer 
)
void GR_Utils::RadixSortGPU::setupRadixSortGPU ( RV_Render rv,
RV_VKBuffer keys_buffer,
RV_VKBuffer indices_buffer 
)

Direct radix sort: Use when the number of elements to sort is known on the CPU. Creates a draw indirect buffer internally with the element count, then uses the same shader pipeline as the indirect version. No indirect buffer needed but requires CPU knowledge of the sort size.

void GR_Utils::RadixSortGPU::setupRadixSortGPUIndirect ( RV_Render rv,
UT_UniquePtr< RV_ShaderBlock > &  draw_indirect_params,
RV_VKBuffer keys_buffer,
RV_VKBuffer indices_buffer 
)

Indirect radix sort: Use when the number of elements to sort is determined dynamically on the GPU (e.g., after GPU frustum culling). Takes a draw indirect buffer from a previous GPU pass, keeping all data on the GPU without CPU readback. The indirect buffer's instance count determines how many elements to sort.


The documentation for this class was generated from the following file: