This was caused by querying on the selection state
before it is setup. It is only setup just before
the draw function.
To fix this, we sync the `info_buf` just before
drawing the overlays.
Also add some safety to avoid uninitialized memory.
Fixes Overlay-Next selection when multiple objects are hit.
To reproduce:
- enable "Ovlay Next" in Preferences>Experimental
- create any Empty object and duplicate it without moving
- try to select by clicking them
Crash occurs because `mixed_bones_object_selectbuffer` in `view3d_select.cc` expects that `view3d_opengl_select_ex` will append results to `buffer`. Depending on situation after several `view3d_opengl_select_ex`calls with decreasing radius it tries to `slice` results from buffer:
```c
has_bones9 = selectbuffer_has_bones(storage.as_span().slice(ofs, hits9));
```
Pull Request: https://projects.blender.org/blender/blender/pulls/124154
Prefer the name 'hit_result' since 'result' was sometimes used for
a vector of GPUSelectResult and is often used a functions return value.
Use hit_results for the span/vector and hit_result for a single hit.
Also assign struct members for new GPUSelectResult as it reads better
and avoids depending on struct order.
Listing the "Blender Foundation" as copyright holder implied the Blender
Foundation holds copyright to files which may include work from many
developers.
While keeping copyright on headers makes sense for isolated libraries,
Blender's own code may be refactored or moved between files in a way
that makes the per file copyright holders less meaningful.
Copyright references to the "Blender Foundation" have been replaced with
"Blender Authors", with the exception of `./extern/` since these this
contains libraries which are more isolated, any changed to license
headers there can be handled on a case-by-case basis.
Some directories in `./intern/` have also been excluded:
- `./intern/cycles/` it's own `AUTHORS` file is planned.
- `./intern/opensubdiv/`.
An "AUTHORS" file has been added, using the chromium projects authors
file as a template.
Design task: #110784
Ref !110783.
A lot of files were missing copyright field in the header and
the Blender Foundation contributed to them in a sense of bug
fixing and general maintenance.
This change makes it explicit that those files are at least
partially copyrighted by the Blender Foundation.
Note that this does not make it so the Blender Foundation is
the only holder of the copyright in those files, and developers
who do not have a signed contract with the foundation still
hold the copyright as well.
Another aspect of this change is using SPDX format for the
header. We already used it for the license specification,
and now we state it for the copyright as well, following the
FAQ:
https://reuse.software/faq/
This contains the basis of the new overlay engine.
Only a few overlays are ported for proof of concept of the new design.
This new design unifies the selection drawing with the overlay-next engine.
It now becomes responsible of selection in object mode.
For this we create a dedicated shader module that patches the shaders
for selection.
Note that the gizmo selection still uses the occlusion queries and edit-mode
the current selection engine (select_engine.c).
Related task #102179
Related task #102177
Co-authored-by: Clément Foucault <foucault.clem@gmail.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/107734