diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2021-03-03 17:20:35 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2021-03-03 17:20:35 +0300 |
commit | b9bb69a1147e76460ab92b7bb97f493e2a26d9c7 (patch) | |
tree | e7e78d7f1b6566a25902a3be66ebf06307eabf83 /source/blender/blenloader | |
parent | cd9a6a0f93896f06cddaabaafc2c0adad4b5b0a9 (diff) |
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.
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r-- | source/blender/blenloader/intern/versioning_290.c | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/source/blender/blenloader/intern/versioning_290.c b/source/blender/blenloader/intern/versioning_290.c index fa9f00d67ec..5c8e9da41c4 100644 --- a/source/blender/blenloader/intern/versioning_290.c +++ b/source/blender/blenloader/intern/versioning_290.c @@ -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; } } |