[Bf-blender-cvs] [a728572] temp_display_optimization: Merge branch 'master' into HEAD

Antony Ryakiotakis noreply at git.blender.org
Fri Mar 11 22:20:55 CET 2016


Commit: a728572ce6e1d3c20e282231f48a7078f264d743
Author: Antony Ryakiotakis
Date:   Fri Mar 11 22:15:23 2016 +0100
Branches: temp_display_optimization
https://developer.blender.org/rBa728572ce6e1d3c20e282231f48a7078f264d743

Merge branch 'master' into HEAD

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



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

diff --cc source/blender/blenkernel/intern/editderivedmesh.c
index 40867a9,96bdfe8..05cac25
--- a/source/blender/blenkernel/intern/editderivedmesh.c
+++ b/source/blender/blenkernel/intern/editderivedmesh.c
@@@ -979,12 -887,10 +1140,11 @@@ static void emDM_drawMappedFaces
  	BMEditMesh *em = bmdm->em;
  	BMesh *bm = em->bm;
  	BMFace *efa;
 +	bool skip_hidden = (flag & DM_DRAW_SKIP_HIDDEN) != 0;
  	struct BMLoop *(*looptris)[3] = bmdm->em->looptris;
  	const int tottri = bmdm->em->tottri;
- 	const int lasttri = tottri - 1; /* compare agasint this a lot */
  	DMDrawOption draw_option;
- 	int i, flush;
+ 	int i;
  	const int skip_normals = !(flag & DM_DRAW_NEED_NORMALS);
  	const float (*lnors)[3] = dm->getLoopDataArray(dm, CD_NORMAL);
  	MLoopCol *lcol[3] = {NULL} /* , dummylcol = {0} */;
diff --cc source/blender/gpu/intern/gpu_buffers.c
index 96ea244,072ff52..c55554c
--- a/source/blender/gpu/intern/gpu_buffers.c
+++ b/source/blender/gpu/intern/gpu_buffers.c
@@@ -583,25 -579,24 +584,26 @@@ static GPUBuffer **gpu_drawobject_buffe
  /* get the amount of space to allocate for a buffer of a particular type */
  static size_t gpu_buffer_size_from_type(DerivedMesh *dm, GPUBufferType type)
  {
+ 	const int components = gpu_buffer_type_settings[type].num_components;
  	switch (type) {
  		case GPU_BUFFER_VERTEX:
- 			return sizeof(float) * gpu_buffer_type_settings[type].num_components * (dm->drawObject->tot_loop_verts + dm->drawObject->tot_loose_point);
+ 			return sizeof(float) * components * (dm->drawObject->tot_loop_verts + dm->drawObject->tot_loose_point);
  		case GPU_BUFFER_NORMAL:
- 			return sizeof(short) * gpu_buffer_type_settings[type].num_components * dm->drawObject->tot_loop_verts;
+ 			return sizeof(short) * components * dm->drawObject->tot_loop_verts;
  		case GPU_BUFFER_COLOR:
- 			return sizeof(char) * gpu_buffer_type_settings[type].num_components * dm->drawObject->tot_loop_verts;
 -			return sizeof(char) * components * dm->drawObject->tot_loop_verts;
++            return sizeof(char) * components * dm->drawObject->tot_loop_verts;
 +		case GPU_BUFFER_EDITFACE_COLORS:
- 			return sizeof(char) * gpu_buffer_type_settings[type].num_components * dm->drawObject->tot_loop_verts;
++            return sizeof(char) * components * dm->drawObject->tot_loop_verts;
  		case GPU_BUFFER_UV:
- 			return sizeof(float) * gpu_buffer_type_settings[type].num_components * dm->drawObject->tot_loop_verts;
+ 			return sizeof(float) * components * dm->drawObject->tot_loop_verts;
  		case GPU_BUFFER_UV_TEXPAINT:
- 			return sizeof(float) * gpu_buffer_type_settings[type].num_components * dm->drawObject->tot_loop_verts;
+ 			return sizeof(float) * components * dm->drawObject->tot_loop_verts;
  		case GPU_BUFFER_EDGE:
- 			return sizeof(int) * gpu_buffer_type_settings[type].num_components * dm->drawObject->totedge;
+ 			return sizeof(int) * components * dm->drawObject->totedge;
  		case GPU_BUFFER_UVEDGE:
- 			return sizeof(int) * gpu_buffer_type_settings[type].num_components * dm->drawObject->tot_loop_verts;
+ 			return sizeof(int) * components * dm->drawObject->tot_loop_verts;
  		case GPU_BUFFER_TRIANGLES:
- 			return sizeof(int) * gpu_buffer_type_settings[type].num_components * dm->drawObject->tot_triangle_point;
+ 			return sizeof(int) * components * dm->drawObject->tot_triangle_point;
  		default:
  			return -1;
  	}




More information about the Bf-blender-cvs mailing list