[Bf-blender-cvs] [f4cc9ba4c36] blender2.8: V3D: Vertex selection: Fix opengl error.

Clément Foucault noreply at git.blender.org
Mon Feb 26 20:10:18 CET 2018


Commit: f4cc9ba4c369dae29e37421bc2caee66b82b1b6f
Author: Clément Foucault
Date:   Mon Feb 26 20:07:39 2018 +0100
Branches: blender2.8
https://developer.blender.org/rBf4cc9ba4c369dae29e37421bc2caee66b82b1b6f

V3D: Vertex selection: Fix opengl error.

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

M	intern/gawain/gawain/gwn_batch.h
M	intern/gawain/src/gwn_batch.c
M	source/blender/editors/space_view3d/drawobject.c

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

diff --git a/intern/gawain/gawain/gwn_batch.h b/intern/gawain/gawain/gwn_batch.h
index 4f77ad9d65b..788202ff3d5 100644
--- a/intern/gawain/gawain/gwn_batch.h
+++ b/intern/gawain/gawain/gwn_batch.h
@@ -103,6 +103,7 @@ void GWN_batch_program_set(Gwn_Batch*, GLuint program, const Gwn_ShaderInterface
 void GWN_batch_program_use_begin(Gwn_Batch*); // call before Batch_Uniform (temp hack?)
 void GWN_batch_program_use_end(Gwn_Batch*);
 
+void GWN_batch_uniform_1ui(Gwn_Batch*, const char* name, int value);
 void GWN_batch_uniform_1i(Gwn_Batch*, const char* name, int value);
 void GWN_batch_uniform_1b(Gwn_Batch*, const char* name, bool value);
 void GWN_batch_uniform_1f(Gwn_Batch*, const char* name, float value);
diff --git a/intern/gawain/src/gwn_batch.c b/intern/gawain/src/gwn_batch.c
index 208740a4ef8..9dab2a4d7d9 100644
--- a/intern/gawain/src/gwn_batch.c
+++ b/intern/gawain/src/gwn_batch.c
@@ -429,6 +429,12 @@ void GWN_batch_program_use_end(Gwn_Batch* batch)
   #define GET_UNIFORM const Gwn_ShaderInput* uniform = GWN_shaderinterface_uniform(batch->interface, name);
 #endif
 
+void GWN_batch_uniform_1ui(Gwn_Batch* batch, const char* name, int value)
+	{
+	GET_UNIFORM
+	glUniform1ui(uniform->location, value);
+	}
+
 void GWN_batch_uniform_1i(Gwn_Batch* batch, const char* name, int value)
 	{
 	GET_UNIFORM
diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c
index 75c217c4f0c..896b24d3086 100644
--- a/source/blender/editors/space_view3d/drawobject.c
+++ b/source/blender/editors/space_view3d/drawobject.c
@@ -9623,7 +9623,7 @@ static void bbs_mesh_face(BMEditMesh *em, DerivedMesh *UNUSED(dm), const bool us
 		GPU_select_index_get(0, &selcol);
 		batch = DRW_mesh_batch_cache_get_triangles_with_select_mask(me, true);
 		GWN_batch_program_set_builtin(batch, GPU_SHADER_3D_UNIFORM_COLOR_U32);
-		GWN_batch_uniform_1i(batch, "color", selcol);
+		GWN_batch_uniform_1ui(batch, "color", selcol);
 		GWN_batch_draw(batch);
 	}
 }
@@ -9753,7 +9753,7 @@ static void bbs_mesh_solid_verts(const EvaluationContext *UNUSED(eval_ctx), Scen
 		GPU_select_index_get(0, &selcol);
 		batch = DRW_mesh_batch_cache_get_triangles_with_select_mask(me, true);
 		GWN_batch_program_set_builtin(batch, GPU_SHADER_3D_UNIFORM_COLOR_U32);
-		GWN_batch_uniform_1i(batch, "color", selcol);
+		GWN_batch_uniform_1ui(batch, "color", selcol);
 		GWN_batch_draw(batch);
 	}



More information about the Bf-blender-cvs mailing list