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

Method DoClear

trinity/Particle/Tr2GpuParticleSystem.cpp:396–405  ·  view source on GitHub ↗

-------------------------------------------------------------------------------------- Description: Removes all particles from the system. --------------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

394// Removes all particles from the system.
395// --------------------------------------------------------------------------------------
396bool Tr2GpuParticleSystem::DoClear( Tr2RenderContext& renderContext )
397{
398 m_liveTime = 0;
399 uint32_t zeroes[] = { 0, 0, 0, 0 };
400 renderContext.ClearUav( *m_counters->GetGpuBuffer( 0 ), zeroes );
401
402 uint32_t perObjectData[4] = { m_particleData->GetCount(), 0, 0, 0 };
403 FillAndSetConstants( m_updateCB, perObjectData, sizeof( perObjectData ), Tr2RenderContextEnum::COMPUTE_SHADER, Tr2Renderer::GetPerObjectVSStartRegister(), renderContext );
404 return Tr2Renderer::RunComputeShader( m_clear, 1, 1, 1, renderContext );
405}
406
407// --------------------------------------------------------------------------------------
408// Description:

Callers

nothing calls this directly

Calls 4

FillAndSetConstantsFunction · 0.50
ClearUavMethod · 0.45
GetGpuBufferMethod · 0.45
GetCountMethod · 0.45

Tested by

no test coverage detected