| 655 | } |
| 656 | |
| 657 | bool 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 | |
| 677 | bool Tr2LightManager::AreLightFlagsValid( uint16_t flags ) |
| 678 | { |
nothing calls this directly
no test coverage detected