FSlateShaderResourceProxy* FSlateRHIResourceManager::GetShaderResource( const FSlateBrush& InBrush ) { check( IsThreadSafeForSlateRendering() ); FSlateShaderResourceProxy* Texture = NULL; if( !InBrush.IsDynamicallyLoaded() && !InBrush.HasUObject() ) { Texture = ResourceMap.FindRef( InBrush.GetResourceName() ); } else if (InBrush.GetResourceObject() && InBrush.GetResourceObject()->IsA<UMaterialInterface>()) { Texture = GetMaterialResource(InBrush); } else if( InBrush.IsDynamicallyLoaded() || ( InBrush.HasUObject() ) ) { if( InBrush.HasUObject() && InBrush.GetResourceObject() == nullptr ) { // Hack for loading via the deprecated path LoadUObjectForBrush( InBrush ); } Texture = FindOrCreateDynamicTextureResource( InBrush ); } return Texture; }
FSlateShaderResource* FSlateRHIResourceManager::GetFontShaderResource( uint32 FontAtlasIndex, FSlateShaderResource* FontTextureAtlas, const class UObject* FontMaterial ) { if( FontMaterial == nullptr ) { return FontTextureAtlas; } else { return GetMaterialResource( FontMaterial, FVector2D::ZeroVector, FontTextureAtlas ); } }