MCPcopy Create free account
hub / github.com/carbonengine/trinity / Sort

Method Sort

trinity/Particle/Tr2GpuParticleSystem.cpp:604–630  ·  view source on GitHub ↗

-------------------------------------------------------------------------------------- Description: Sorts particles! --------------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

602// Sorts particles!
603// --------------------------------------------------------------------------------------
604void Tr2GpuParticleSystem::Sort( Tr2RenderContext& renderContext )
605{
606 if( !CheckEffect( m_setSortParameters ) || !CheckEffect( m_sort ) || !CheckEffect( m_sortStep ) || !CheckEffect( m_sortInner ) )
607 {
608 return;
609 }
610
611 m_sortTimer.Begin( renderContext );
612 ON_BLOCK_EXIT( [&] { m_sortTimer.End( renderContext ); } );
613
614 Tr2Renderer::RunComputeShader( m_setSortParameters, 1, 1, 1, renderContext );
615 if( m_sortParameters && m_sortParameters->IsValid() )
616 {
617 Tr2Renderer::RunComputeShaderIndirect( m_sort, *m_sortParameters, 0, renderContext );
618
619 if( m_maxParticles > 512 )
620 {
621 uint32_t presorted = 512;
622 bool done = false;
623 while( !done )
624 {
625 done = SortIncremental( presorted, renderContext );
626 presorted *= 2;
627 }
628 }
629 }
630}
631
632// --------------------------------------------------------------------------------------
633// Description:

Callers

nothing calls this directly

Calls 4

CheckEffectFunction · 0.85
BeginMethod · 0.45
EndMethod · 0.45
IsValidMethod · 0.45

Tested by

no test coverage detected