[Bf-blender-cvs] [cd454ab] GPU_data_request: state tracking API - reorder function args

Mike Erwin noreply at git.blender.org
Thu Apr 9 09:59:45 CEST 2015


Commit: cd454ab5b740164320adf12a82a40b1005649e07
Author: Mike Erwin
Date:   Thu Apr 9 03:54:01 2015 -0400
Branches: GPU_data_request
https://developer.blender.org/rBcd454ab5b740164320adf12a82a40b1005649e07

state tracking API - reorder function args

in order of importance.

Doing this early, before it’s used in more places.

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

M	source/blender/editors/space_view3d/drawobject.c
M	source/blender/gpu/GPUx_draw.h
M	source/blender/gpu/intern/gpux_draw.c

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

diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c
index a1c1168..7155ac5 100644
--- a/source/blender/editors/space_view3d/drawobject.c
+++ b/source/blender/editors/space_view3d/drawobject.c
@@ -2048,7 +2048,7 @@ static void drawcamera_new_new(Scene *scene, View3D *v3d, RegionView3D *rv3d, Ba
 		GPUx_set_line_vertices(elem, 2,  2,3);
 		GPUx_set_line_vertices(elem, 3,  3,0);
 
-		GPUx_draw_lines(NULL, NULL, verts, elem);
+		GPUx_draw_lines(verts, elem, NULL, NULL);
 
 		GPUx_element_list_discard(elem);
 		GPUx_vertex_buffer_discard(verts);
@@ -2096,7 +2096,7 @@ static void drawcamera_new_new(Scene *scene, View3D *v3d, RegionView3D *rv3d, Ba
 		GPUx_set_line_vertices(elem, 9,  6,7);
 		GPUx_set_line_vertices(elem, 10, 7,5);
 
-		GPUx_draw_lines(NULL, NULL, verts, elem);
+		GPUx_draw_lines(verts, elem, NULL, NULL);
 
 		GPUx_element_list_discard(elem);
 
@@ -2107,7 +2107,7 @@ static void drawcamera_new_new(Scene *scene, View3D *v3d, RegionView3D *rv3d, Ba
 			elem = GPUx_element_list_create(GL_TRIANGLES, 1, 7);
 			GPUx_set_triangle_vertices(elem, 0,  5,6,7);
 
-			GPUx_draw_triangles(NULL, NULL, verts, elem);
+			GPUx_draw_triangles(verts, elem, NULL, NULL);
 
 			GPUx_element_list_discard(elem);
 		}
@@ -4491,7 +4491,7 @@ static bool draw_mesh_object_new_new(Scene *scene, ARegion *ar, View3D *v3d, Reg
 			glShadeModel(GL_SMOOTH);
 
 			GPUx_vertex_buffer_prime(verts);
-			GPUx_draw_triangles(&common_state, &polygon_state, verts, elem);
+			GPUx_draw_triangles(verts, elem, &polygon_state, &common_state);
 
 			glShadeModel(GL_FLAT); /* restore default */
 		}
@@ -4508,7 +4508,7 @@ static bool draw_mesh_object_new_new(Scene *scene, ARegion *ar, View3D *v3d, Reg
 			}
 
 			GPUx_vertex_buffer_prime(verts);
-			GPUx_draw_lines(NULL, NULL, verts, elem);
+			GPUx_draw_lines(verts, elem, NULL, NULL);
 		}
 
 		if (elem)
diff --git a/source/blender/gpu/GPUx_draw.h b/source/blender/gpu/GPUx_draw.h
index 205de68..4941b42 100644
--- a/source/blender/gpu/GPUx_draw.h
+++ b/source/blender/gpu/GPUx_draw.h
@@ -8,12 +8,13 @@
 #include "GPUx_vbo.h"
 #include "GPUx_element.h"
 
-/* pass ElementList = NULL to draw all vertices from VertexBuffer in order */
-void GPUx_draw_points(const CommonDrawState*, const PointDrawState*, const VertexBuffer*, const ElementList*);
-void GPUx_draw_lines(const CommonDrawState*, const LineDrawState*, const VertexBuffer*, const ElementList*);
-void GPUx_draw_triangles(const CommonDrawState*, const PolygonDrawState*, const VertexBuffer*, const ElementList*);
+/* pass ElementList = NULL to draw all vertices from VertexBuffer in order
+ * pass NULL to either state arg to use defaults */
+void GPUx_draw_points(const VertexBuffer*, const ElementList*, const PointDrawState*, const CommonDrawState*);
+void GPUx_draw_lines(const VertexBuffer*, const ElementList*, const LineDrawState*, const CommonDrawState*);
+void GPUx_draw_triangles(const VertexBuffer*, const ElementList*, const PolygonDrawState*, const CommonDrawState*);
 
 /* generic version uses ElementList's primitive type */
-void GPUx_draw_primitives(const CommonDrawState*, const void *primitive_state, const VertexBuffer*, const ElementList*);
+void GPUx_draw_primitives(const VertexBuffer*, const ElementList*, const void *primitive_state, const CommonDrawState*);
 
 #endif /* BLENDER_GL_DRAW_PRIMITIVES */
diff --git a/source/blender/gpu/intern/gpux_draw.c b/source/blender/gpu/intern/gpux_draw.c
index c5d26b1..8c6af77 100644
--- a/source/blender/gpu/intern/gpux_draw.c
+++ b/source/blender/gpu/intern/gpux_draw.c
@@ -14,7 +14,7 @@ static unsigned chop_to_multiple(unsigned x, unsigned m)
 	return x - x % m;
 }
 
-void GPUx_draw_points(const CommonDrawState *common_state, const PointDrawState *point_state, const VertexBuffer *vbo, const ElementList *el)
+void GPUx_draw_points(const VertexBuffer *vbo, const ElementList *el, const PointDrawState *point_state, const CommonDrawState *common_state)
 {
 	GPUx_set_common_state(common_state);
 	GPUx_set_point_state(point_state);
@@ -38,7 +38,7 @@ void GPUx_draw_points(const CommonDrawState *common_state, const PointDrawState
 #endif /* REALLY_DRAW */
 }
 
-void GPUx_draw_lines(const CommonDrawState *common_state, const LineDrawState *line_state, const VertexBuffer *vbo, const ElementList *el)
+void GPUx_draw_lines(const VertexBuffer *vbo, const ElementList *el, const LineDrawState *line_state, const CommonDrawState *common_state)
 {
 	GPUx_set_common_state(common_state);
 	GPUx_set_line_state(line_state);
@@ -62,7 +62,7 @@ void GPUx_draw_lines(const CommonDrawState *common_state, const LineDrawState *l
 #endif /* REALLY_DRAW */
 }
 
-void GPUx_draw_triangles(const CommonDrawState *common_state, const PolygonDrawState *polygon_state, const VertexBuffer *vbo, const ElementList *el)
+void GPUx_draw_triangles(const VertexBuffer *vbo, const ElementList *el, const PolygonDrawState *polygon_state, const CommonDrawState *common_state)
 {
 	GPUx_set_common_state(common_state);
 	GPUx_set_polygon_state(polygon_state);
@@ -86,7 +86,7 @@ void GPUx_draw_triangles(const CommonDrawState *common_state, const PolygonDrawS
 #endif /* REALLY_DRAW */
 }
 
-void GPUx_draw_primitives(const CommonDrawState *common_state, const void *primitive_state, const VertexBuffer *vbo, const ElementList *el)
+void GPUx_draw_primitives(const VertexBuffer *vbo, const ElementList *el, const void *primitive_state, const CommonDrawState *common_state)
 {
 	int vert_per_prim = 0;




More information about the Bf-blender-cvs mailing list