diff options
author | Germano Cavalcante <mano-wii> | 2021-11-02 18:33:28 +0300 |
---|---|---|
committer | Germano Cavalcante <germano.costa@ig.com.br> | 2021-11-03 18:10:37 +0300 |
commit | aa0ac0035a0d3601672a0c732e3f8f932a36fc04 (patch) | |
tree | 6eca1da9c1cf3e0e28d17d8e6ed9d3ce8a4e1603 /source/blender/editors/include | |
parent | 8b516d8712024af9380fe3f7559c336042d612f5 (diff) |
GPencil and Annotation: Use cached depth to perform depth testing operations
Operations such as erasing with occlusion and drawing on the surface
require reading the depth buffer.
However, this is being done with minimal efficiency.
Currently, to read the depth corresponding to each point of the new stroke,
a ReadPixel is called to send a message to the GPU and read the depth of
the corresponding pixel in the VRAM.
The communication between GPU and CPU is known to be a slow operation so
it is good to be avoided.
Therefore, save the entire depth buffer in a cache to be read directly
from the RAM.
(Also the `ED_view3d_autodist_depth` and `ED_view3d_autodist_depth_seg` have
been removed since they are no longer used).
Reviewed By: antoniov, fclem
Differential Revision: https://developer.blender.org/D10894
Diffstat (limited to 'source/blender/editors/include')
-rw-r--r-- | source/blender/editors/include/ED_view3d.h | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/source/blender/editors/include/ED_view3d.h b/source/blender/editors/include/ED_view3d.h index ebf3316a509..f9ccd916327 100644 --- a/source/blender/editors/include/ED_view3d.h +++ b/source/blender/editors/include/ED_view3d.h @@ -609,12 +609,8 @@ bool ED_view3d_autodist_simple(struct ARegion *region, float mouse_worldloc[3], int margin, const float *force_depth); -bool ED_view3d_autodist_depth(struct ARegion *region, const int mval[2], int margin, float *depth); -bool ED_view3d_autodist_depth_seg(struct ARegion *region, - const int mval_sta[2], - const int mval_end[2], - int margin, - float *depth); +bool ED_view3d_depth_read_cached_seg( + const ViewDepths *vd, const int mval_sta[2], const int mval_end[2], int margin, float *depth); /* select */ #define MAXPICKELEMS 2500 |