diff options
author | mano-wii <germano.costa@ig.com.br> | 2019-03-15 22:02:55 +0300 |
---|---|---|
committer | mano-wii <germano.costa@ig.com.br> | 2019-03-15 23:02:48 +0300 |
commit | 681661dbed121c7b81e9129c57df5eadb03c1009 (patch) | |
tree | 8802195c72af13e1bb7324131024cc98fb5971a7 /source/blender/editors/include/ED_view3d.h | |
parent | 4510f88d00a721a3d4ad3aa675050723eec2292c (diff) |
GPU: Simplify select shaders.
The shaders are: `GPU_SHADER_3D_FLAT_SELECT_ID` and `GPU_SHADER_3D_UNIFORM_SELECT_ID`.
This commit allows the drawing of the mesh select ids to be done on a 32UI format texture.
This simplifies the shader that previously acted on the backbuffer and had to do an uint to rgba conversion.
Differential Revision: https://developer.blender.org/D4350
Diffstat (limited to 'source/blender/editors/include/ED_view3d.h')
-rw-r--r-- | source/blender/editors/include/ED_view3d.h | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/source/blender/editors/include/ED_view3d.h b/source/blender/editors/include/ED_view3d.h index 131069bfb5f..e8cd6ebf5f3 100644 --- a/source/blender/editors/include/ED_view3d.h +++ b/source/blender/editors/include/ED_view3d.h @@ -348,16 +348,24 @@ float ED_view3d_radius_to_dist( void imm_drawcircball(const float cent[3], float rad, const float tmat[4][4], unsigned pos); /* backbuffer select and draw support */ -void ED_view3d_backbuf_validate_with_select_mode(struct ViewContext *vc, short select_mode); -void ED_view3d_backbuf_validate(struct ViewContext *vc); -struct ImBuf *ED_view3d_backbuf_read( - struct ViewContext *vc, int xmin, int ymin, int xmax, int ymax); -unsigned int ED_view3d_backbuf_sample_rect( - struct ViewContext *vc, const int mval[2], int size, - unsigned int min, unsigned int max, float *r_dist); -int ED_view3d_backbuf_sample_size_clamp(struct ARegion *ar, const float dist); -unsigned int ED_view3d_backbuf_sample( +void ED_view3d_backbuf_depth_validate(struct ViewContext *vc); +int ED_view3d_backbuf_sample_size_clamp(struct ARegion *ar, const float dist); + +void ED_view3d_select_id_validate(struct ViewContext *vc); +void ED_view3d_select_id_validate_with_select_mode( + struct ViewContext *vc, short select_mode); + +uint ED_view3d_select_id_sample( struct ViewContext *vc, int x, int y); +uint *ED_view3d_select_id_read( + struct ViewContext *vc, + int xmin, int ymin, int xmax, int ymax, + uint *r_buf_len); +uint *ED_view3d_select_id_read_rect( + struct ViewContext *vc, const struct rcti *rect, uint *r_buf_len); +uint ED_view3d_select_id_read_nearest( + struct ViewContext *vc, const int mval[2], + const uint min, const uint max, uint *r_dist); bool ED_view3d_autodist( struct Depsgraph *depsgraph, struct ARegion *ar, struct View3D *v3d, |