On gcc 11.3, Ubuntu 22.04 the default constructor for ColorSceneLinear4f did not zero the r,g,b,a member variables. Replacing the empty constructor with a default constructor circumvents this problem (compiler bug? ) even though it *should* be more or less equivalent.
Details
Details
- Reviewers
Hans Goudey (HooglyBoogly) Jesse Yurkovich (deadpin) - Maniphest Tasks
- T103432: class SampleMeshBarycentricFunction assumes the types it is templated to has a default constructor initializing all members.
- Commits
- rB14667de65bd1: Fix uninitialized ColorSceneLinear4f occuring in certain situations.
Diff Detail
Diff Detail
- Repository
- rB Blender
Event Timeline
Comment Actions
I'm glad a simple solution like this was possible in the end. If we have Array<ColorGeometry4f> colors(size);, the array is still not initialized by default, right?
Comment Actions
I'm not really sure. I think it would be initialized. But at least it now behaves the same on all platforms.
now Array<ColorSceneLinear4f> behaves the same as Array<ColorRGBA> , whereas previously they were different.
I'll test.
Comment Actions
I tested it and the Array<ColorScene4f> situation is indeed not initialized by default.
Comment Actions
Then I think this is a fine solution. It's consistent with similar code elsewhere too. Thanks.