--- layout: stdlib-reference --- # ReorderThread ## Description Reorders threads based on a coherence hint value. NumCoherenceHintBits indicates how many of the least significant bits of CoherenceHint should be considered during reordering (max: 16). Applications should set this to the lowest value required to represent all possible values in CoherenceHint. For best performance, all threads should provide the same value for NumCoherenceHintBits. Where possible, reordering will also attempt to retain locality in the thread's launch indices (DispatchRaysIndex in DXR). ## Signature
void ReorderThread(
    uint CoherenceHint,
    uint NumCoherenceHintBitsFromLSB);

void ReorderThread(
    HitObject HitOrMiss,
    uint CoherenceHint,
    uint NumCoherenceHintBitsFromLSB);

void ReorderThread(HitObject HitOrMiss);

## Parameters #### CoherenceHint : uint #### NumCoherenceHintBitsFromLSB : uint #### HitOrMiss : [HitObject](../types/hitobject-03/index.html) ## Availability and Requirements Defined for the following targets: #### hlsl Available in `raygen` stage only. Requires capabilities: `hlsl_nvapi`, `ser_hlsl_native`. #### glsl Available in `raygen` stage only. #### cuda Available in `raygen` stage only. #### spirv Available in `raygen` stage only. Requires capabilities: `spvRayTracingKHR`, `spvShaderInvocationReorderNV`, `spvShaderInvocationReorderEXT`.