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

Method ReleaseDeviceResources

trinity/Shader/Tr2EffectStateManager.cpp:982–1023  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

980
981
982void Tr2EffectStateManager::ReleaseDeviceResources( TriStorage s )
983{
984 USE_MAIN_THREAD_RENDER_CONTEXT();
985
986 if( ( s & TRISTORAGE_ALL ) == TRISTORAGE_ALL )
987 {
988 if( renderContext.IsValid() )
989 {
990 for( uint32_t i = 0; i < VERTEX_STREAM_MAX_COUNT; ++i )
991 {
992 m_renderContext.SetStreamSource( i, Tr2BufferAL(), 0, 0 );
993 }
994 m_renderContext.SetIndices( Tr2BufferAL() );
995 }
996 m_currentValues.Reset();
997
998 for( auto it = s_shaders.begin(); it != s_shaders.end(); ++it )
999 {
1000 delete *it;
1001 }
1002 s_shaders.clear();
1003 for( auto it = s_shaderPrograms.begin(); it != s_shaderPrograms.end(); ++it )
1004 {
1005 delete it->first;
1006 }
1007 s_shaderPrograms.clear();
1008 for( auto it = s_shaderLibraries.begin(); it != s_shaderLibraries.end(); ++it )
1009 {
1010 //delete[]( *it )->bytecode;
1011 delete *it;
1012 }
1013 s_shaderLibraries.clear();
1014
1015 s_renderStateSetups.erase( s_renderStateSetups.begin() + RM_COUNT, s_renderStateSetups.end() );
1016 m_renderStates.clear();
1017
1018 for( uint32_t i = 0; i != CBUFFER_COUNT; ++i )
1019 {
1020 m_perObjectConstantBuffers[i] = Tr2ConstantBufferAL();
1021 }
1022 }
1023}
1024
1025
1026bool Tr2EffectStateManager::PushDepthStencilBuffer()

Callers

nothing calls this directly

Calls 8

Tr2BufferALClass · 0.50
Tr2ConstantBufferALClass · 0.50
IsValidMethod · 0.45
SetStreamSourceMethod · 0.45
SetIndicesMethod · 0.45
ResetMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected