File tree Expand file tree Collapse file tree 1 file changed +11
-8
lines changed Expand file tree Collapse file tree 1 file changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -1032,17 +1032,20 @@ namespace KlayGE
1032
1032
1033
1033
void RenderMaterial::LoadTextureSlots ()
1034
1034
{
1035
- auto & rf = Context::Instance ().RenderFactoryInstance ();
1036
- for (size_t i = 0 ; i < RenderMaterial::TS_NumTextureSlots; ++i)
1035
+ if (Context::Instance ().RenderFactoryValid ())
1037
1036
{
1038
- auto slot = static_cast <RenderMaterial::TextureSlot>(i);
1039
- auto const & tex_name = textures_[slot].first ;
1040
- if (!tex_name.empty ())
1037
+ auto & rf = Context::Instance ().RenderFactoryInstance ();
1038
+ for (size_t i = 0 ; i < RenderMaterial::TS_NumTextureSlots; ++i)
1041
1039
{
1042
- if (!ResLoader::Instance ().Locate (tex_name).empty ()
1043
- || !ResLoader::Instance ().Locate (tex_name + " .dds" ).empty ())
1040
+ auto slot = static_cast <RenderMaterial::TextureSlot>(i);
1041
+ auto const & tex_name = textures_[slot].first ;
1042
+ if (!tex_name.empty ())
1044
1043
{
1045
- this ->Texture (slot, rf.MakeTextureSrv (ASyncLoadTexture (tex_name, EAH_GPU_Read | EAH_Immutable)));
1044
+ if (!ResLoader::Instance ().Locate (tex_name).empty ()
1045
+ || !ResLoader::Instance ().Locate (tex_name + " .dds" ).empty ())
1046
+ {
1047
+ this ->Texture (slot, rf.MakeTextureSrv (ASyncLoadTexture (tex_name, EAH_GPU_Read | EAH_Immutable)));
1048
+ }
1046
1049
}
1047
1050
}
1048
1051
}
You can’t perform that action at this time.
0 commit comments