![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
#include "GPUSort.h"#include "Math/RandomStream.h"#include "RHIBreadcrumbs.h"#include "RenderingThread.h"#include "RHIContext.h"#include "ShaderCompilerCore.h"#include "ShaderParameterMacros.h"#include "ShaderParameterUtils.h"#include "GlobalShader.h"#include "PipelineStateCache.h"#include "ProfilingDebugging/RealtimeGPUProfiler.h"Classes | |
| class | FSortOffsetBuffers |
| class | FRadixSortParametersBuffer |
| class | FRadixSortClearOffsetsCS |
| class | FRadixSortUpsweepCS |
| class | FRadixSortSpineCS |
| class | FRadixSortDownsweepCS |
Macros | |
| #define | GPUSORT_BITCOUNT 32 |
| #define | RADIX_BITS 4 |
| #define | DIGIT_COUNT (1 << RADIX_BITS) |
| #define | KEYS_PER_LOOP 8 |
| #define | THREAD_COUNT 128 |
| #define | TILE_SIZE (THREAD_COUNT * KEYS_PER_LOOP) |
| #define | MAX_GROUP_COUNT 64 |
| #define | MAX_PASS_COUNT (32 / RADIX_BITS) |
Typedefs | |
| typedef TUniformBufferRef< FRadixSortParameters > | FRadixSortUniformBufferRef |
Enumerations | |
| enum | { GPU_SORT_TEST_SIZE_SMALL = (1 << 9) , GPU_SORT_TEST_SIZE_LARGE = (1 << 20) , GPU_SORT_TEST_SIZE_MIN = (1 << 4) , GPU_SORT_TEST_SIZE_MAX = (1 << 20) } |
Variables | |
| TGlobalResource< FSortOffsetBuffers > | GSortOffsetBuffers |
| TGlobalResource< FRadixSortParametersBuffer > | GRadixSortParametersBuffer |
| #define DIGIT_COUNT (1 << RADIX_BITS) |
| #define GPUSORT_BITCOUNT 32 |
| #define KEYS_PER_LOOP 8 |
| #define MAX_GROUP_COUNT 64 |
| #define MAX_PASS_COUNT (32 / RADIX_BITS) |
| #define RADIX_BITS 4 |
| #define THREAD_COUNT 128 |
| #define TILE_SIZE (THREAD_COUNT * KEYS_PER_LOOP) |
| DEFINE_LOG_CATEGORY_STATIC | ( | LogGPUSort | , |
| Log | , | ||
| All | |||
| ) |
Get the number of passes we will need to make in order to sort
| IMPLEMENT_GLOBAL_SHADER_PARAMETER_STRUCT | ( | FRadixSortParameters | , |
| "RadixSortUB" | |||
| ) |
| IMPLEMENT_SHADER_TYPE | ( | FRadixSortClearOffsetsCS | , |
| TEXT("/Engine/Private/RadixSortShaders.usf") | , | ||
| TEXT("RadixSort_ClearOffsets") | , | ||
| SF_Compute | |||
| ) |
| IMPLEMENT_SHADER_TYPE | ( | FRadixSortDownsweepCS | , |
| TEXT("/Engine/Private/RadixSortShaders.usf") | , | ||
| TEXT("RadixSort_Downsweep") | , | ||
| SF_Compute | |||
| ) |
| IMPLEMENT_SHADER_TYPE | ( | FRadixSortSpineCS | , |
| TEXT("/Engine/Private/RadixSortShaders.usf") | , | ||
| TEXT("RadixSort_Spine") | , | ||
| SF_Compute | |||
| ) |
| IMPLEMENT_SHADER_TYPE | ( | FRadixSortUpsweepCS | , |
| TEXT("/Engine/Private/RadixSortShaders.usf") | , | ||
| TEXT("RadixSort_Upsweep") | , | ||
| SF_Compute | |||
| ) |
| void SetRadixSortShaderCompilerEnvironment | ( | FShaderCompilerEnvironment & | OutEnvironment | ) |
Setup radix sort shader compiler environment.
| OutEnvironment | - The environment to set. |
| int32 SortGPUBuffers | ( | FRHICommandList & | RHICmdList, |
| FGPUSortBuffers | SortBuffers, | ||
| int32 | BufferIndex, | ||
| uint32 | KeyMask, | ||
| int32 | Count, | ||
| ERHIFeatureLevel::Type | FeatureLevel | ||
| ) |
Sort a buffer on the GPU.
| SortBuffers | - The buffer to sort including required views and a ping- pong location of appropriate size. |
| BufferIndex | - Index of the buffer containing keys. |
| KeyMask | - Bitmask indicating which key bits contain useful information. |
| Count | - How many items in the buffer need to be sorted. |
| void TestGPUSort | ( | EGPUSortTest | TestToRun, |
| ERHIFeatureLevel::Type | FeatureLevel | ||
| ) |
Test that GPU sorting works.
| TestToRun | - The test to run. |
| TGlobalResource<FRadixSortParametersBuffer> GRadixSortParametersBuffer |
The global resource for the radix sort parameters buffer.
| TGlobalResource<FSortOffsetBuffers> GSortOffsetBuffers |
The global sort offset buffer resources.