Commit Graph

4042 Commits

Author SHA1 Message Date
Campbell Barton
48bf2c08b7 Fix experemental preference use when "Developer Extras" is disabled
When "Developer Extras" is disabled, the experemental options
must not be used.

Some checks for experemental options weren't using the macro which
checks both are set.

Add comment to avoid this happening in the future.
2024-12-13 11:25:39 +11:00
Clément Foucault
f6ecd033de Cleanup: DRW: Remove unused functions and variables 2024-12-12 12:53:20 +01:00
Clément Foucault
9a21d67a54 Fix #131652: DRW: Viewport/EEVEE retained ghost image of object
This was caused by a bad state where a texture (likely the viewport)
texture, could be bound as texture by the viewport blit function
and kept bound as texture input during the subsequent redraw.
This would provoke a feedback loop which is UB.

It is still unknown why this is not catched by our GL layer
and why it isn't an issue in Vulkan or Metal nor other GL
implementations.

Add back all missing calls from previous `DRW_state_reset` to
avoid more regressions.
2024-12-11 18:13:21 +01:00
Hans Goudey
071fb86a07 Cleanup: Remove unused function 2024-12-11 10:23:45 -05:00
Campbell Barton
e0f6a067c0 Cleanup: quiet undeclared function warning 2024-12-11 11:23:51 +11:00
Clément Foucault
f8da7ecfe1 Cleanup: DRW: Move DRW_SHADER_FREE_SAFE and DRW_UBO_FREE_SAFE to GPU 2024-12-11 00:43:32 +01:00
Clément Foucault
9bd1a92778 Cleanup: DRW: Remove unused code 2024-12-11 00:38:10 +01:00
Clément Foucault
0ad4696125 Cleanup: DRW: Remove remaining of DRWTexture API 2024-12-10 22:47:46 +01:00
Clément Foucault
fe228d26b4 Cleanup: DRW: Remove unused part of DRWTexture API 2024-12-10 11:33:00 +01:00
Clément Foucault
2e0f4eea66 Cleanup: DRW: Replace DRW_TEXTURE_FREE_SAFE by GPU_TEXTURE_FREE_SAFE 2024-12-09 23:23:53 +01:00
Campbell Barton
a3213dc82a Cleanup: trailing space 2024-12-09 09:23:23 +11:00
Campbell Barton
083b690fb5 Cleanup: spelling in comments 2024-12-09 09:14:44 +11:00
Miguel Pozo
e3c6c2c6fc Cleanup: CMake: De-duplicate with_shader_cpp_compilation code
Move the common setup and function to `macros.cmake`.

Pull Request: https://projects.blender.org/blender/blender/pulls/131391
2024-12-06 21:03:11 +01:00
Clément Foucault
52463a5f0b GPU: Remove unused GPUDrawList API
This was only used by the legacy draw manager.
This one has already been removed.
2024-12-05 23:26:29 +01:00
Clément Foucault
35c393acd6 Cleanup: DRW: Remove legacy resource handle
Pull Request: https://projects.blender.org/blender/blender/pulls/131456
2024-12-05 22:28:33 +01:00
Clément Foucault
db12edd825 Cleanu: DRW: Remove unused types 2024-12-05 22:27:38 +01:00
Clément Foucault
e2fb51b2e8 DRW: Remove legacy object data 2024-12-05 22:27:38 +01:00
Clément Foucault
897d24d193 DRW: Remove legacy view layer attribute support 2024-12-05 22:27:38 +01:00
Clément Foucault
35beef96fd DRW: Remove legacy DRWPass structures and storage 2024-12-05 22:27:38 +01:00
Clément Foucault
459c65f993 Cleanup: DRW: Remove legacy object attributes 2024-12-05 22:27:38 +01:00
Clément Foucault
04282ef91e DRW: Remove draw lists 2024-12-05 22:27:38 +01:00
Hans Goudey
2a8f671070 Cleanup: Formatting 2024-12-05 14:47:59 -05:00
Clément Foucault
9c7e18f515 DRW: Remove legacy state tracking
Fixes assert caused by uninitialized memory.
2024-12-05 20:03:10 +01:00
Clément Foucault
f9107c4f25 DRW: Remove legacy instance buffers
No functional change expected.
2024-12-05 20:03:10 +01:00
Clément Foucault
7271a6d7f9 DRW: Remove draw_manager_exec.cc
This moves the state reset to be done by
the `StateSet` command.
2024-12-05 20:03:10 +01:00
Clément Foucault
bcf297d971 Cleanup: DRW: Remove unused code 2024-12-05 20:03:10 +01:00
Clément Foucault
d8ca7dc743 DRW: Remove legacy DRWView
No functional change expected.
2024-12-05 20:03:10 +01:00
Clément Foucault
490cc5d011 DRW: Remove legacy clipping API
No functional change expected.
2024-12-05 20:03:10 +01:00
Clément Foucault
2a2c125301 DRW: Fix memory leak 2024-12-05 20:03:10 +01:00
Clément Foucault
ad770b0359 DRW: Remove more DRWView getters
No functional change expected.
2024-12-05 20:03:10 +01:00
Clément Foucault
1f9ecca872 DRW: Remove DRW_view_*mat_get
No functional change expected.
2024-12-05 20:03:10 +01:00
Clément Foucault
880d7170a2 DRW: Remove DRW_view_default_set/get and DRW_view_set/get_active
No functional change expected. But rendering is likely broken since
default view is not set the same way.
2024-12-05 20:03:10 +01:00
Clément Foucault
6e12cce8a6 DRW: Move offset data computation to View to use it with select_engine
This avoid code duplication.
2024-12-05 20:03:10 +01:00
Miguel Pozo
72aaaa0c24 Fix: GPU: Errors and warnings for CPP shaders in MSVC
Pull Request: https://projects.blender.org/blender/blender/pulls/131332
2024-12-04 17:33:12 +01:00
Clément Foucault
5e4bba76d1 Fix #131363: Curves ignore Surface Object Setting
Depth only drawing was not always enabling the overlay engine
(now responsible for depth prepass). And the depth prepass
was not populated if overlays were turned off.
2024-12-04 17:05:03 +01:00
Hans Goudey
f9b627d29c Mesh: Move custom normals to a generic attribute
Move `CD_CUSTOMLOOPNORMAL` to the newly added
`CD_PROP_INT16_2D` generic attribute type. This is similar to
previous commits moving specific custom data types.

The attribute name is `custom_normal`. When the attribute with
that name is on the face corner domain, the code will interpret it
as stored in the existing deformation-invariant spherical coordinate
space.

The API remains the same, with the additional opportunity to edit
custom normal data as an attribute directly (which admittedly is fairly
unintuitive currently).

See #130484.

Pull Request: https://projects.blender.org/blender/blender/pulls/130689
2024-12-04 16:06:36 +01:00
Hans Goudey
e06acd302a Cleanup: Remove unused declarations in DRW_render.hh 2024-12-04 08:53:52 -05:00
Hans Goudey
504ac41ae7 Cleanup: Remove math include from two headers 2024-12-04 08:52:37 -05:00
Hans Goudey
024d7d12e2 Mesh: Move BVH storage to shared cache system
Avoid rebuilding BVH trees when meshes are copied.
Similar to the other uses of the shared cache system,
this can arbitrarily improve performance when meshes
are copied but not deformed and BVH building is the
main bottleneck. In a simple test file I got a 6x speedup.

The amount of code is also reduced and the system is
much simpler overall-- built out of common threading
patterns like `SharedCache` with its double-checked lock.
RAII is used in a few places to simplify memory management
too.

The downside is storing more `SharedCache` items in the
mesh runtime struct. That has a slight cost when copying
a small mesh many times, but we have ideas to improve that
in the future anyway (#104327).

Pull Request: https://projects.blender.org/blender/blender/pulls/130865
2024-12-04 00:17:17 +01:00
Clément Foucault
5a455a9988 Cleanup: DRW: Replace DRW_view_get_active by DRW_view_default_get 2024-12-03 19:50:26 +01:00
Clément Foucault
4a08cda62d Cleanup: DRW: Remove DRWShadingGroup and commands API 2024-12-03 19:32:03 +01:00
Clément Foucault
391bd5e823 Refactor: DRW: Use new API for curve refinement
Instead of allocating the pass globally, get it from the
currently bound viewport data.

Pull Request: https://projects.blender.org/blender/blender/pulls/131330
2024-12-03 19:20:09 +01:00
Hans Goudey
66e090dcb4 Cleanup: Remove unused function declarations 2024-12-03 10:21:45 -05:00
Hans Goudey
e5a1a61524 Cleanup: Remove unused sculpt drawing code
Unused after 62897317bd.
2024-12-03 10:21:45 -05:00
Clément Foucault
62897317bd DRW: Remove Basic engine
All remaining shaders were moved to overlay.

The basic engine is not used anymore since
all selection and depth picking happens inside
overlay engine.
2024-12-03 16:11:31 +01:00
Clément Foucault
01f1e9a2c4 GPU: Silence most GLSL C++ compilation warnings 2024-12-02 23:01:12 +01:00
Clément Foucault
2c3ccdf77a GPU: GLSL compilation as C++ for eevee static shaders
Rel #127983

Pull Request: https://projects.blender.org/blender/blender/pulls/130298
2024-12-02 21:26:15 +01:00
Clément Foucault
3d9ffa5085 Overlay: Remove legacy option and legacy code
This simply removes the old overlay engine.

Rel #102179

Pull Request: https://projects.blender.org/blender/blender/pulls/131155
2024-12-02 19:47:55 +01:00
Clément Foucault
a15a4c9c9a GPU: GLSL compilation as C++ for grease pencil shaders
Rel #127983
2024-12-02 13:21:12 +01:00
Clément Foucault
909b74e91f Fix: GPU: Assert due to new GPU requirements regarding wide lines
The formats was not using the correct attribute type.

Fixes assert in graph drawing and potential assert in cursor drawing
Fixes assert in sequencer and file browser
2024-11-28 12:42:17 +01:00