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

Method CacheTexture

trinity/Shader/Parameter/TriTextureParameter.cpp:369–382  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

367}
368
369void TriTextureParameter::CacheTexture()
370{
371 auto resource = GetResource();
372 if( const Tr2TextureAL* tex = ( resource ? resource->GetTexture() : nullptr ) )
373 {
374 m_cachedTexture = *tex;
375 }
376 else
377 {
378 m_cachedTexture = Tr2Renderer::GetFallbackTexture( m_resourceType, m_name.c_str() );
379 }
380 m_cachedSrvIndex[0] = m_cachedTexture.GetSrvIndexInHeap( Tr2RenderContextEnum::COLOR_SPACE_LINEAR );
381 m_cachedSrvIndex[1] = m_cachedTexture.GetSrvIndexInHeap( Tr2RenderContextEnum::COLOR_SPACE_SRGB );
382}
383
384void TriTextureParameter::OnTextureChanged()
385{

Callers

nothing calls this directly

Calls 2

GetTextureMethod · 0.45
GetSrvIndexInHeapMethod · 0.45

Tested by

no test coverage detected