Parameter File (XML) of a 2D texture should be stored as the dependency of the texture.
Currently, if we change the parameter file, the texture will not be reloaded applying the changes of its paramaters. E.g. when we change the filter mode in the test_texture.xml
, the test_texture.png
won’t be reloaded with the new filter mode.
Currently, 3D/Cube/2DArray textures have this feature, but 2D texture does not.
I have tested adding the following code to Texture2D
, it seems working correctly. I remember Parameter file ability was added by @Eugene, so I think it’s better to ask you first.
if (loadParameters_)
{
auto* cache = GetSubsystem<ResourceCache>();
String xmlName = ReplaceExtension(GetName(), ".xml");
cache->StoreResourceDependency(this, xmlName);
}
Best regards.