EEVEE: Avoid old files with too many volume shadow sample being too slow

This clamp the volumetric shadow samples to the actual old max to avoid
problematic slowdown after the bugfix rB3a29c19b2bff.
This commit is contained in:
Clément Foucault 2021-03-03 15:20:35 +01:00
parent cd9a6a0f93
commit b9bb69a114
2 changed files with 19 additions and 8 deletions

View File

@ -39,7 +39,7 @@ extern "C" {
/* Blender file format version. */
#define BLENDER_FILE_VERSION BLENDER_VERSION
#define BLENDER_FILE_SUBVERSION 9
#define BLENDER_FILE_SUBVERSION 10
/* Minimum Blender version that supports reading file written with the current
* version. Older Blender versions will test this and show a warning if the file

View File

@ -1789,6 +1789,24 @@ void blo_do_versions_290(FileData *fd, Library *UNUSED(lib), Main *bmain)
FOREACH_NODETREE_END;
}
if (!MAIN_VERSION_ATLEAST(bmain, 293, 10)) {
FOREACH_NODETREE_BEGIN (bmain, ntree, id) {
if (ntree->type == NTREE_GEOMETRY) {
version_node_socket_name(ntree, GEO_NODE_ATTRIBUTE_PROXIMITY, "Location", "Position");
}
}
FOREACH_NODETREE_END;
LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
/* Fix old scene with too many samples that were not being used.
* Now they are properly used and might produce a huge slowdown.
* So we clamp to what the old max actual was. */
if (scene->eevee.volumetric_shadow_samples > 32) {
scene->eevee.volumetric_shadow_samples = 32;
}
}
}
/**
* Versioning code until next subversion bump goes here.
*
@ -1800,12 +1818,5 @@ void blo_do_versions_290(FileData *fd, Library *UNUSED(lib), Main *bmain)
*/
{
/* Keep this block, even when empty. */
FOREACH_NODETREE_BEGIN (bmain, ntree, id) {
if (ntree->type == NTREE_GEOMETRY) {
version_node_socket_name(ntree, GEO_NODE_ATTRIBUTE_PROXIMITY, "Location", "Position");
}
}
FOREACH_NODETREE_END;
}
}