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

Method ApplyVertexDeclaration

trinity/Shader/Tr2EffectStateManager.cpp:879–910  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

877}
878
879void Tr2EffectStateManager::ApplyVertexDeclaration( uint32_t declaration )
880{
881 if( m_isManagedRendering && declaration == m_currentValues.m_vertexDeclaration )
882 {
883 return;
884 }
885
886
887 CCP_ASSERT( declaration != UNINITIALIZED_DECLARATION );
888
889 if( declaration == NULL_DECLARATION )
890 {
891 m_renderContext.SetVertexLayout( Tr2VertexLayoutAL() );
892 }
893 else
894 {
895 CCP_ASSERT( declaration < s_vertexLayoutMap.size() );
896
897 if( declaration < s_vertexLayoutMap.size() )
898 {
899 Tr2VertexLayoutAL& hvl = *s_vertexLayoutMap[declaration].second;
900 if( !hvl.IsValid() )
901 {
902 USE_MAIN_THREAD_RENDER_CONTEXT();
903
904 hvl.Create( s_vertexLayoutMap[declaration].first, renderContext );
905 }
906 m_renderContext.SetVertexLayout( hvl );
907 }
908 }
909 m_currentValues.m_vertexDeclaration = declaration;
910}
911
912bool Tr2EffectStateManager::GetVertexDeclarationElements( uint32_t declaration, Tr2VertexDefinition& definition )
913{

Callers 13

DrawHelperMethod · 0.80
PickMethod · 0.80
EndRenderMethod · 0.80
RenderMethod · 0.80
RenderMethod · 0.80
SubmitGeometryFunction · 0.80
RenderBatchGroupMethod · 0.80
RenderGdprBatchesMethod · 0.80
SubmitGeometryMethod · 0.80
ExecuteMethod · 0.80
RenderAreasMethod · 0.80
RunJobHelperMethod · 0.80

Calls 5

sizeMethod · 0.80
Tr2VertexLayoutALClass · 0.50
SetVertexLayoutMethod · 0.45
IsValidMethod · 0.45
CreateMethod · 0.45

Tested by

no test coverage detected