Commit: b104057d001d2472cc55c7fa51cff3275e331523
Author: Mike Erwin
Date:   Sun Feb 12 01:56:08 2017 -0500
Branches: blender2.8
https://developer.blender.org/rBb104057d001d2472cc55c7fa51cff3275e331523

OpenGL: enable program point size for keyframes

Allows vertex shader to determine how large to rasterize each point sprite. 
Forgot to do this before.

===================================================================

M       source/blender/editors/animation/keyframes_draw.c
M       source/blender/editors/interface/interface_icons.c
M       source/blender/editors/space_clip/clip_dopesheet_draw.c
M       source/blender/editors/space_nla/nla_draw.c

===================================================================

diff --git a/source/blender/editors/animation/keyframes_draw.c 
b/source/blender/editors/animation/keyframes_draw.c
index 3c5f626fac..c8d141eab0 100644
--- a/source/blender/editors/animation/keyframes_draw.c
+++ b/source/blender/editors/animation/keyframes_draw.c
@@ -52,6 +52,7 @@
 
 #include "BKE_fcurve.h"
 
+#include "GPU_draw.h"
 #include "GPU_immediate.h"
 
 #include "UI_resources.h"
@@ -623,6 +624,7 @@ static void draw_keylist(View2D *v2d, DLRBT_Tree *keys, 
DLRBT_Tree *blocks, floa
                        unsigned int color_id = add_attrib(format, "color", 
COMP_U8, 4, NORMALIZE_INT_TO_FLOAT);
                        unsigned int outline_color_id = add_attrib(format, 
"outlineColor", COMP_U8, 4, NORMALIZE_INT_TO_FLOAT);
                        immBindBuiltinProgram(GPU_SHADER_KEYFRAME_DIAMOND);
+                       GPU_enable_program_point_size();
                        immBegin(PRIM_POINTS, key_ct);
 
                        for (ActKeyColumn *ak = keys->first; ak; ak = ak->next) 
{
@@ -633,6 +635,7 @@ static void draw_keylist(View2D *v2d, DLRBT_Tree *keys, 
DLRBT_Tree *blocks, floa
                        }
 
                        immEnd();
+                       GPU_disable_program_point_size();
                        immUnbindProgram();
                }
        }
diff --git a/source/blender/editors/interface/interface_icons.c 
b/source/blender/editors/interface/interface_icons.c
index b7eab9f2a5..a9cdb34f63 100644
--- a/source/blender/editors/interface/interface_icons.c
+++ b/source/blender/editors/interface/interface_icons.c
@@ -35,6 +35,7 @@
 
 #include "GPU_extensions.h"
 #include "GPU_basic_shader.h"
+#include "GPU_draw.h"
 #include "GPU_immediate.h"
 
 #include "BLI_blenlib.h"
@@ -60,7 +61,6 @@
 #include "IMB_imbuf_types.h"
 #include "IMB_thumbs.h"
 
-#include "BIF_gl.h"
 #include "BIF_glutil.h"
 
 #include "ED_datafiles.h"
@@ -262,6 +262,7 @@ static void vicon_keytype_draw_wrapper(int x, int y, int w, 
int h, float alpha,
        unsigned int outline_color_id = add_attrib(format, "outlineColor", 
COMP_U8, 4, NORMALIZE_INT_TO_FLOAT);
 
        immBindBuiltinProgram(GPU_SHADER_KEYFRAME_DIAMOND);
+       GPU_enable_program_point_size();
        immBegin(PRIM_POINTS, 1);
        
        /* draw keyframe
@@ -272,6 +273,7 @@ static void vicon_keytype_draw_wrapper(int x, int y, int w, 
int h, float alpha,
                            pos_id, size_id, color_id, outline_color_id);
 
        immEnd();
+       GPU_disable_program_point_size();
        immUnbindProgram();
 
        UI_Theme_Restore(&theme_state);
diff --git a/source/blender/editors/space_clip/clip_dopesheet_draw.c 
b/source/blender/editors/space_clip/clip_dopesheet_draw.c
index c381a58ba1..872e62dbc9 100644
--- a/source/blender/editors/space_clip/clip_dopesheet_draw.c
+++ b/source/blender/editors/space_clip/clip_dopesheet_draw.c
@@ -42,8 +42,6 @@
 #include "ED_screen.h"
 #include "ED_clip.h"
 
-#include "BIF_gl.h"
-
 #include "WM_types.h"
 
 #include "UI_interface.h"
@@ -54,6 +52,7 @@
 
 #include "RNA_access.h"
 
+#include "GPU_draw.h"
 #include "GPU_immediate.h"
 
 #include "clip_intern.h"  /* own include */
@@ -221,7 +220,7 @@ void clip_draw_dopesheet_main(SpaceClip *sc, ARegion *ar, 
Scene *scene)
                        unsigned int outline_color_id = add_attrib(format, 
"outlineColor", COMP_U8, 4, NORMALIZE_INT_TO_FLOAT);
 
                        immBindBuiltinProgram(GPU_SHADER_KEYFRAME_DIAMOND);
-
+                       GPU_enable_program_point_size();
                        immBegin(PRIM_POINTS, keyframe_ct);
 
                        /* all same size with black outline */
@@ -276,6 +275,7 @@ void clip_draw_dopesheet_main(SpaceClip *sc, ARegion *ar, 
Scene *scene)
                        }
 
                        immEnd();
+                       GPU_disable_program_point_size();
                        immUnbindProgram();
                }
 
diff --git a/source/blender/editors/space_nla/nla_draw.c 
b/source/blender/editors/space_nla/nla_draw.c
index 86eae70c0f..e744a39fde 100644
--- a/source/blender/editors/space_nla/nla_draw.c
+++ b/source/blender/editors/space_nla/nla_draw.c
@@ -146,6 +146,7 @@ static void nla_action_draw_keyframes(AnimData *adt, 
bAction *act, float y, floa
                unsigned int color_id = add_attrib(format, "color", COMP_U8, 4, 
NORMALIZE_INT_TO_FLOAT);
                unsigned int outline_color_id = add_attrib(format, 
"outlineColor", COMP_U8, 4, NORMALIZE_INT_TO_FLOAT);
                immBindBuiltinProgram(GPU_SHADER_KEYFRAME_DIAMOND);
+               GPU_enable_program_point_size();
                immBegin(PRIM_POINTS, key_ct);
 
                /* - disregard the selection status of keyframes so they draw a 
certain way
@@ -157,6 +158,7 @@ static void nla_action_draw_keyframes(AnimData *adt, 
bAction *act, float y, floa
                }
 
                immEnd();
+               GPU_disable_program_point_size();
                immUnbindProgram();
        }

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to