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

Method OnPrepareResources

trinity/Tr2LightManager.cpp:657–675  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

655}
656
657bool Tr2LightManager::OnPrepareResources()
658{
659 USE_MAIN_THREAD_RENDER_CONTEXT();
660
661 m_lightBuffer->Create( LIGHT_BUFFER_SIZE, sizeof( PerLightData ), Tr2GpuBuffer::CPU_WRITABLE );
662 m_lightBuffer->SetName( "Light buffer" );
663 m_indexBuffer->Create( INDEX_BUFFER_SIZE, sizeof( uint32_t ), Tr2GpuStructuredBuffer::GPU_WRITABLE );
664 m_indexBuffer->SetName( "Light indices" );
665 m_indexBufferCounter->Create( 1, Tr2RenderContextEnum::PIXEL_FORMAT_R32_SINT, Tr2GpuBuffer::GPU_WRITABLE );
666 ClearLightIndices( renderContext );
667 m_perFrameData.Create( sizeof( PerFrameData ), Tr2ConstantUsageAL::ONE_SHOT, nullptr, renderContext );
668
669 m_effect->SetParameter( BlueSharedString( "LightBuffer" ), m_lightBuffer );
670 m_effect->SetParameter( BlueSharedString( "LightIndices" ), m_indexBuffer );
671 m_effect->SetParameter( BlueSharedString( "LightIndexCount" ), m_indexBufferCounter );
672 m_effect->SetParameter( BlueSharedString( "DepthMap" ), Tr2TextureAL() );
673
674 return true;
675}
676
677bool Tr2LightManager::AreLightFlagsValid( uint16_t flags )
678{

Callers

nothing calls this directly

Calls 4

Tr2TextureALClass · 0.70
CreateMethod · 0.45
SetNameMethod · 0.45
SetParameterMethod · 0.45

Tested by

no test coverage detected