[Bf-blender-cvs] [b1b5ded37f] blender2.8: Fix shaders in some immBindBuiltinProgram calls

Luca Rood noreply at git.blender.org
Fri Feb 3 02:21:55 CET 2017


Commit: b1b5ded37f9e2967fb1e2b33c6aef89c233750ed
Author: Luca Rood
Date:   Thu Feb 2 23:17:22 2017 -0200
Branches: blender2.8
https://developer.blender.org/rBb1b5ded37f9e2967fb1e2b33c6aef89c233750ed

Fix shaders in some immBindBuiltinProgram calls

Had mistakenly used 3D shaders for some 2D drawings...
Replaced those now.

Part of T49043

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

M	source/blender/editors/space_graph/space_graph.c
M	source/blender/editors/space_view3d/view3d_ruler.c
M	source/blender/editors/transform/transform_snap.c

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

diff --git a/source/blender/editors/space_graph/space_graph.c b/source/blender/editors/space_graph/space_graph.c
index 3a9a4b1884..70d3fad955 100644
--- a/source/blender/editors/space_graph/space_graph.c
+++ b/source/blender/editors/space_graph/space_graph.c
@@ -269,7 +269,7 @@ static void graph_main_region_draw(const bContext *C, ARegion *ar)
 	if (((sipo->flag & SIPO_NODRAWCURSOR) == 0) || (sipo->mode == SIPO_MODE_DRIVERS)) {
 		unsigned pos = add_attrib(immVertexFormat(), "pos", GL_FLOAT, 2, KEEP_FLOAT);
 
-		immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR);
+		immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
 
 		/* horizontal component of value-cursor (value line before the current frame line) */
 		if ((sipo->flag & SIPO_NODRAWCURSOR) == 0) {
diff --git a/source/blender/editors/space_view3d/view3d_ruler.c b/source/blender/editors/space_view3d/view3d_ruler.c
index dde3ef75a8..482fe356b4 100644
--- a/source/blender/editors/space_view3d/view3d_ruler.c
+++ b/source/blender/editors/space_view3d/view3d_ruler.c
@@ -461,7 +461,7 @@ static void ruler_info_draw_pixel(const struct bContext *C, ARegion *ar, void *a
 		if (ruler_item->flag & RULERITEM_USE_ANGLE) {
 			unsigned pos = add_attrib(immVertexFormat(), "pos", GL_FLOAT, 2, KEEP_FLOAT);
 
-			immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR);
+			immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
 			imm_cpack(is_act ? color_act : color_base);
 
 			immBegin(GL_LINE_STRIP, 3);
@@ -603,7 +603,7 @@ static void ruler_info_draw_pixel(const struct bContext *C, ARegion *ar, void *a
 		else {
 			unsigned pos = add_attrib(immVertexFormat(), "pos", GL_FLOAT, 2, KEEP_FLOAT);
 
-			immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR);
+			immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
 			imm_cpack(is_act ? color_act : color_base);
 
 			immBegin(GL_LINE_STRIP, 2);
@@ -706,7 +706,7 @@ static void ruler_info_draw_pixel(const struct bContext *C, ARegion *ar, void *a
 
 			unsigned pos = add_attrib(immVertexFormat(), "pos", GL_FLOAT, 2, KEEP_FLOAT);
 
-			immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR);
+			immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
 			imm_cpack(color_act);
 
 			imm_draw_lined_circle(pos, co_ss[0], co_ss[1], size * U.pixelsize, 32);
diff --git a/source/blender/editors/transform/transform_snap.c b/source/blender/editors/transform/transform_snap.c
index 6ca963bc0e..81f7af5a2c 100644
--- a/source/blender/editors/transform/transform_snap.c
+++ b/source/blender/editors/transform/transform_snap.c
@@ -249,7 +249,7 @@ void drawSnapping(const struct bContext *C, TransInfo *t)
 			
 			unsigned pos = add_attrib(immVertexFormat(), "pos", GL_FLOAT, 2, KEEP_FLOAT);
 
-			immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR);
+			immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
 
 			for (p = t->tsnap.points.first; p; p = p->next) {
 				if (p == t->tsnap.selectedPoint) {




More information about the Bf-blender-cvs mailing list