Blender Git Loki
Git Commits -> Revision fd414b4
Revision fd414b4 by Hans Goudey (master) April 8, 2021, 17:00 (GMT) |
Cleanup: Use const arguments for volume code The problem was that you could getting write access to a grid from a `const Volume *` without breaking const correctness. I encountered this when working on support for volumes in the bounding box node. For geometry nodes there is an important distinction between getting data "for read" and "for write", with the former returning a `const` version of the data. Also, for volumes it was necessary to cast away const, since all of the relevant functions in `volume.cc` didn't have const versions. This patch adds `const` in these places, distinguising between "for read" and "for write" versions of functions where necessary. The downside is that loading and unloading in the global volume cache needs const write-access to some member variables. I see that as an inherent problem that comes up with caching that never has a beautiful solution anyway. Some of the const-ness could probably be propogated futher in EEVEE code, but I'll leave that out, since there is another level of caching. Differential Revision: https://developer.blender.org/D10916 |
Commit Details:
Full Hash: fd414b49068c011a1fd63a304ea95bbe420d6570
Parent Commit: b51562e
Lines Changed: +107, -68
14 Modified Paths:
/intern/cycles/blender/blender_volume.cpp (+2, -2) (Diff)
/source/blender/blenkernel/BKE_volume.h (+10, -9) (Diff)
/source/blender/blenkernel/BKE_volume_render.h (+3, -3) (Diff)
/source/blender/blenkernel/intern/volume.cc (+55, -27) (Diff)
/source/blender/blenkernel/intern/volume_render.cc (+3, -3) (Diff)
/source/blender/draw/engines/eevee/eevee_volumes.c (+5, -6) (Diff)
/source/blender/draw/engines/workbench/workbench_volume.c (+1, -1) (Diff)
/source/blender/draw/intern/draw_cache.h (+2, -1) (Diff)
/source/blender/draw/intern/draw_cache_impl_volume.c (+5, -5) (Diff)
/source/blender/makesrna/intern/rna_volume.c (+13, -3) (Diff)
/source/blender/modifiers/intern/MOD_volume_displace.cc (+1, -1) (Diff)
/source/blender/modifiers/intern/MOD_volume_to_mesh.cc (+2, -2) (Diff)
/source/blender/nodes/geometry/nodes/node_geo_transform.cc (+2, -2) (Diff)
/source/blender/nodes/geometry/nodes/node_geo_volume_to_mesh.cc (+3, -3) (Diff)
/source/blender/blenkernel/BKE_volume.h (+10, -9) (Diff)
/source/blender/blenkernel/BKE_volume_render.h (+3, -3) (Diff)
/source/blender/blenkernel/intern/volume.cc (+55, -27) (Diff)
/source/blender/blenkernel/intern/volume_render.cc (+3, -3) (Diff)
/source/blender/draw/engines/eevee/eevee_volumes.c (+5, -6) (Diff)
/source/blender/draw/engines/workbench/workbench_volume.c (+1, -1) (Diff)
/source/blender/draw/intern/draw_cache.h (+2, -1) (Diff)
/source/blender/draw/intern/draw_cache_impl_volume.c (+5, -5) (Diff)
/source/blender/makesrna/intern/rna_volume.c (+13, -3) (Diff)
/source/blender/modifiers/intern/MOD_volume_displace.cc (+1, -1) (Diff)
/source/blender/modifiers/intern/MOD_volume_to_mesh.cc (+2, -2) (Diff)
/source/blender/nodes/geometry/nodes/node_geo_transform.cc (+2, -2) (Diff)
/source/blender/nodes/geometry/nodes/node_geo_volume_to_mesh.cc (+3, -3) (Diff)