Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeroen Bakker <jeroen@blender.org>2021-08-13 10:37:38 +0300
committerJeroen Bakker <jeroen@blender.org>2021-08-13 10:37:38 +0300
commit5f6033e0919a9a6bfd00a8a977d28fa60fe7f079 (patch)
tree74253afff8448a04d259078795b81d0baecd9997 /source/blender/editors/include/ED_keyframes_draw.h
parent7b5acc80091d8d92869d83f1308f5af24b45ce9a (diff)
Keyframe: Reduce GPU context switches.
This change reduces the GPU context switches when drawing keyframes. In the previous situation the keyframe blocks and keyframe keys were drawn per channel. With this patch first all the keyframe blocks are drawn for all channels and after that the keyframe keys are collected for all channels and send to the GPU in a single draw call.
Diffstat (limited to 'source/blender/editors/include/ED_keyframes_draw.h')
-rw-r--r--source/blender/editors/include/ED_keyframes_draw.h14
1 files changed, 9 insertions, 5 deletions
diff --git a/source/blender/editors/include/ED_keyframes_draw.h b/source/blender/editors/include/ED_keyframes_draw.h
index 50823045936..61e37f20b1b 100644
--- a/source/blender/editors/include/ED_keyframes_draw.h
+++ b/source/blender/editors/include/ED_keyframes_draw.h
@@ -43,6 +43,14 @@ struct bGPDlayer;
/* draw simple diamond-shape keyframe */
/* caller should set up vertex format, bind GPU_SHADER_KEYFRAME_DIAMOND,
* immBegin(GPU_PRIM_POINTS, n), then call this n times */
+typedef struct KeyframeShaderBindings {
+ uint pos_id;
+ uint size_id;
+ uint color_id;
+ uint outline_color_id;
+ uint flags_id;
+} KeyframeShaderBindings;
+
void draw_keyframe_shape(float x,
float y,
float size,
@@ -50,11 +58,7 @@ void draw_keyframe_shape(float x,
short key_type,
short mode,
float alpha,
- unsigned int pos_id,
- unsigned int size_id,
- unsigned int color_id,
- unsigned int outline_color_id,
- unsigned int flags_id,
+ const KeyframeShaderBindings *sh_bindings,
short handle_type,
short extreme_type);