Commit Graph

13 Commits

Author SHA1 Message Date
Clément Foucault
fb84b21ec4 Cleanup: Selection: Assert legacy selection mode are not used 2024-12-04 19:18:14 +01:00
Clément Foucault
7371bde40b Cleanup: Selection: Adress warning 2024-11-29 21:36:41 +01:00
Clément Foucault
54be7ed322 Fix: Overlay-Next: Broken selection on first click
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.
2024-11-29 18:46:17 +01:00
Clément Foucault
324517fd78 Cleanup: GPU: Fix clang tidy warnings
Removes some other things like:
- `TRUST_NO_ONE` which was the same as `#ifndef NDEBUG`.
- Replace `reinterpret_cast` by `unwrap`

Pull Request: https://projects.blender.org/blender/blender/pulls/129631
2024-10-31 15:18:29 +01:00
Laurynas Duburas
a412268980 Fix: Overlay-Next when multiple objects are click selected
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
2024-07-17 16:07:15 +02:00
Hans Goudey
8b514bccd1 Cleanup: Move remaining GPU headers to C++
Pull Request: https://projects.blender.org/blender/blender/pulls/119807
2024-03-23 01:24:18 +01:00
Jesse Yurkovich
d304ba7906 Cleanup: Rename GPU_select header to indicate its move to C++
From a prior PR[0] there was a desire to rename this header to more
clearly indicate it's C++ now.

[0] !112491

Pull Request: https://projects.blender.org/blender/blender/pulls/115631
2023-12-01 03:39:03 +01:00
Campbell Barton
8aff65daf2 Cleanup: naming for GPUSelectResult
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.
2023-12-01 09:45:02 +11:00
Jesse Yurkovich
abf59eb23a Selection: Remove limit on number of items which can be selected at once
This removes the long-standing static limit for the selection buffer in
favor of a dynamic approach.

It replaces the static array with our Vector type where the inline
buffer provides parity with existing code while also providing the
ability to grow as necessary.

Fixes #102487, #109178, #112350, #112493, and https://projects.blender.org/blender/blender-manual/issues/102485

See PR for further notes and links to the different limits remaining.
Pull Request: https://projects.blender.org/blender/blender/pulls/112491
2023-11-30 21:27:15 +01:00
Campbell Barton
e955c94ed3 License Headers: Set copyright to "Blender Authors", add AUTHORS
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.
2023-08-16 00:20:26 +10:00
Campbell Barton
81ee130063 Cleanup: use C++ system headers
Apply clang-tidy modernize-deprecated-headers to source/
2023-07-22 11:27:25 +10:00
Sergey Sharybin
c1bc70b711 Cleanup: Add a copyright notice to files and use SPDX format
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/
2023-05-31 16:19:06 +02:00
Miguel Pozo
9ae2dd577a Overlay-Next: Initial implementation
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
2023-05-23 15:00:38 +02:00