diff options
Diffstat (limited to 'source/blender/draw/intern')
-rw-r--r-- | source/blender/draw/intern/draw_cache.c | 80 | ||||
-rw-r--r-- | source/blender/draw/intern/draw_cache_extract_mesh.c | 2 | ||||
-rw-r--r-- | source/blender/draw/intern/draw_cache_impl_curve.c | 22 | ||||
-rw-r--r-- | source/blender/draw/intern/draw_cache_impl_lattice.c | 4 | ||||
-rw-r--r-- | source/blender/draw/intern/draw_cache_impl_mesh.c | 30 | ||||
-rw-r--r-- | source/blender/draw/intern/draw_cache_impl_metaball.c | 2 | ||||
-rw-r--r-- | source/blender/draw/intern/draw_cache_impl_particles.c | 8 | ||||
-rw-r--r-- | source/blender/draw/intern/draw_common.c | 4 | ||||
-rw-r--r-- | source/blender/draw/intern/draw_debug.c | 4 | ||||
-rw-r--r-- | source/blender/draw/intern/draw_hair.c | 10 | ||||
-rw-r--r-- | source/blender/draw/intern/draw_instance_data.c | 8 | ||||
-rw-r--r-- | source/blender/draw/intern/draw_manager_data.c | 4 | ||||
-rw-r--r-- | source/blender/draw/intern/draw_manager_exec.c | 6 | ||||
-rw-r--r-- | source/blender/draw/intern/draw_manager_profiling.c | 6 |
14 files changed, 95 insertions, 95 deletions
diff --git a/source/blender/draw/intern/draw_cache.c b/source/blender/draw/intern/draw_cache.c index 520932bc429..54c78fd583b 100644 --- a/source/blender/draw/intern/draw_cache.c +++ b/source/blender/draw/intern/draw_cache.c @@ -296,15 +296,15 @@ static GPUVertBuf *sphere_wire_vbo(const float rad) /* a single ring of vertices */ float p[NSEGMENTS][2]; - for (int i = 0; i < NSEGMENTS; ++i) { + for (int i = 0; i < NSEGMENTS; i++) { float angle = 2 * M_PI * ((float)i / (float)NSEGMENTS); p[i][0] = rad * cosf(angle); p[i][1] = rad * sinf(angle); } - for (int axis = 0; axis < 3; ++axis) { - for (int i = 0; i < NSEGMENTS; ++i) { - for (int j = 0; j < 2; ++j) { + for (int axis = 0; axis < 3; axis++) { + for (int i = 0; i < NSEGMENTS; i++) { + for (int j = 0; j < 2; j++) { float cv[2], v[3]; cv[0] = p[(i + j) % NSEGMENTS][0]; @@ -352,7 +352,7 @@ GPUBatch *DRW_cache_fullscreen_quad_get(void) GPUVertBuf *vbo = GPU_vertbuf_create_with_format(&format); GPU_vertbuf_data_alloc(vbo, 3); - for (int i = 0; i < 3; ++i) { + for (int i = 0; i < 3; i++) { GPU_vertbuf_attr_set(vbo, attr_id.pos, i, pos[i]); GPU_vertbuf_attr_set(vbo, attr_id.uvs, i, uvs[i]); } @@ -382,7 +382,7 @@ GPUBatch *DRW_cache_quad_get(void) GPUVertBuf *vbo = GPU_vertbuf_create_with_format(&format); GPU_vertbuf_data_alloc(vbo, 4); - for (int i = 0; i < 4; ++i) { + for (int i = 0; i < 4; i++) { GPU_vertbuf_attr_set(vbo, attr_id.pos, i, pos[i]); GPU_vertbuf_attr_set(vbo, attr_id.uvs, i, uvs[i]); } @@ -437,8 +437,8 @@ GPUBatch *DRW_cache_grid_get(void) GPU_vertbuf_data_alloc(vbo, 8 * 8 * 2 * 3); uint v_idx = 0; - for (int i = 0; i < 8; ++i) { - for (int j = 0; j < 8; ++j) { + for (int i = 0; i < 8; i++) { + for (int j = 0; j < 8; j++) { float pos0[2] = {(float)i / 8.0f, (float)j / 8.0f}; float pos1[2] = {(float)(i + 1) / 8.0f, (float)j / 8.0f}; float pos2[2] = {(float)i / 8.0f, (float)(j + 1) / 8.0f}; @@ -510,7 +510,7 @@ GPUBatch *DRW_cache_cube_get(void) GPUVertBuf *vbo = GPU_vertbuf_create_with_format(&format); GPU_vertbuf_data_alloc(vbo, 36); - for (int i = 0; i < 36; ++i) { + for (int i = 0; i < 36; i++) { GPU_vertbuf_attr_set(vbo, attr_id.pos, i, verts[indices[i]]); } @@ -549,7 +549,7 @@ GPUBatch *DRW_cache_empty_cube_get(void) GPUVertBuf *vbo = GPU_vertbuf_create_with_format(&format); GPU_vertbuf_data_alloc(vbo, 24); - for (int i = 0; i < 24; ++i) { + for (int i = 0; i < 24; i++) { GPU_vertbuf_attr_set(vbo, attr_id.pos, i, verts[indices[i]]); } @@ -751,7 +751,7 @@ GPUBatch *DRW_cache_gpencil_axes_get(void) } /* draw cube */ - for (int i = 0; i < 24; ++i) { + for (int i = 0; i < 24; i++) { GPU_vertbuf_attr_set(vbo, pos_id, i + 6, verts[indices[i]]); } @@ -982,7 +982,7 @@ GPUBatch *DRW_cache_empty_cone_get(void) if (!SHC.drw_empty_cone) { /* a single ring of vertices */ float p[NSEGMENTS][2]; - for (int i = 0; i < NSEGMENTS; ++i) { + for (int i = 0; i < NSEGMENTS; i++) { float angle = 2 * M_PI * ((float)i / (float)NSEGMENTS); p[i][0] = cosf(angle); p[i][1] = sinf(angle); @@ -1000,7 +1000,7 @@ GPUBatch *DRW_cache_empty_cone_get(void) GPUVertBuf *vbo = GPU_vertbuf_create_with_format(&format); GPU_vertbuf_data_alloc(vbo, NSEGMENTS * 4); - for (int i = 0; i < NSEGMENTS; ++i) { + for (int i = 0; i < NSEGMENTS; i++) { float cv[2], v[3]; cv[0] = p[(i) % NSEGMENTS][0]; cv[1] = p[(i) % NSEGMENTS][1]; @@ -1032,7 +1032,7 @@ GPUBatch *DRW_cache_empty_cylinder_get(void) if (!SHC.drw_empty_cylinder) { /* a single ring of vertices */ float p[NSEGMENTS][2]; - for (int i = 0; i < NSEGMENTS; ++i) { + for (int i = 0; i < NSEGMENTS; i++) { float angle = 2 * M_PI * ((float)i / (float)NSEGMENTS); p[i][0] = cosf(angle); p[i][1] = sinf(angle); @@ -1050,7 +1050,7 @@ GPUBatch *DRW_cache_empty_cylinder_get(void) GPUVertBuf *vbo = GPU_vertbuf_create_with_format(&format); GPU_vertbuf_data_alloc(vbo, NSEGMENTS * 6); - for (int i = 0; i < NSEGMENTS; ++i) { + for (int i = 0; i < NSEGMENTS; i++) { float cv[2], pv[2], v[3]; cv[0] = p[(i) % NSEGMENTS][0]; cv[1] = p[(i) % NSEGMENTS][1]; @@ -1121,7 +1121,7 @@ GPUBatch *DRW_cache_empty_capsule_cap_get(void) if (!SHC.drw_empty_capsule_cap) { /* a single ring of vertices */ float p[NSEGMENTS][2]; - for (int i = 0; i < NSEGMENTS; ++i) { + for (int i = 0; i < NSEGMENTS; i++) { float angle = 2 * M_PI * ((float)i / (float)NSEGMENTS); p[i][0] = cosf(angle); p[i][1] = sinf(angle); @@ -1141,7 +1141,7 @@ GPUBatch *DRW_cache_empty_capsule_cap_get(void) /* Base circle */ int vidx = 0; - for (int i = 0; i < NSEGMENTS; ++i) { + for (int i = 0; i < NSEGMENTS; i++) { float v[3] = {0.0f, 0.0f, 0.0f}; copy_v2_v2(v, p[(i) % NSEGMENTS]); GPU_vertbuf_attr_set(vbo, attr_id.pos, vidx++, v); @@ -1149,7 +1149,7 @@ GPUBatch *DRW_cache_empty_capsule_cap_get(void) GPU_vertbuf_attr_set(vbo, attr_id.pos, vidx++, v); } - for (int i = 0; i < NSEGMENTS / 2; ++i) { + for (int i = 0; i < NSEGMENTS / 2; i++) { float v[3] = {0.0f, 0.0f, 0.0f}; int ci = i % NSEGMENTS; int pi = (i + 1) % NSEGMENTS; @@ -1690,7 +1690,7 @@ GPUBatch *DRW_cache_light_spot_get(void) float n[NSEGMENTS][3]; float neg[NSEGMENTS][3]; float half_angle = 2 * M_PI / ((float)NSEGMENTS * 2); - for (int i = 0; i < NSEGMENTS; ++i) { + for (int i = 0; i < NSEGMENTS; i++) { float angle = 2 * M_PI * ((float)i / (float)NSEGMENTS); p[i][0] = cosf(angle); p[i][1] = sinf(angle); @@ -1715,7 +1715,7 @@ GPUBatch *DRW_cache_light_spot_get(void) GPUVertBuf *vbo = GPU_vertbuf_create_with_format(&format); GPU_vertbuf_data_alloc(vbo, NSEGMENTS * 4); - for (int i = 0; i < NSEGMENTS; ++i) { + for (int i = 0; i < NSEGMENTS; i++) { float cv[2], v[3]; cv[0] = p[i % NSEGMENTS][0]; cv[1] = p[i % NSEGMENTS][1]; @@ -1757,7 +1757,7 @@ GPUBatch *DRW_cache_light_spot_volume_get(void) if (!SHC.drw_light_spot_volume) { /* a single ring of vertices */ float p[NSEGMENTS][2]; - for (int i = 0; i < NSEGMENTS; ++i) { + for (int i = 0; i < NSEGMENTS; i++) { float angle = 2 * M_PI * ((float)i / (float)NSEGMENTS); p[i][0] = cosf(angle); p[i][1] = sinf(angle); @@ -1775,7 +1775,7 @@ GPUBatch *DRW_cache_light_spot_volume_get(void) GPU_vertbuf_data_alloc(vbo, NSEGMENTS * 3); uint v_idx = 0; - for (int i = 0; i < NSEGMENTS; ++i) { + for (int i = 0; i < NSEGMENTS; i++) { float cv[2], v[3]; ARRAY_SET_ITEMS(v, 0.0f, 0.0f, 0.0f); @@ -1824,7 +1824,7 @@ GPUBatch *DRW_cache_light_spot_square_get(void) GPU_vertbuf_data_alloc(vbo, 16); /* piramid sides */ - for (int i = 1; i <= 4; ++i) { + for (int i = 1; i <= 4; i++) { GPU_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, p[0]); GPU_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, p[i]); @@ -1863,7 +1863,7 @@ GPUBatch *DRW_cache_light_spot_square_volume_get(void) GPU_vertbuf_data_alloc(vbo, 12); /* piramid sides */ - for (int i = 1; i <= 4; ++i) { + for (int i = 1; i <= 4; i++) { GPU_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, p[0]); GPU_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, p[((i + 1) % 4) + 1]); GPU_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, p[(i % 4) + 1]); @@ -1974,7 +1974,7 @@ GPUBatch *DRW_cache_lightprobe_cube_get(void) GPUVertBuf *vbo = GPU_vertbuf_create_with_format(&format); GPU_vertbuf_data_alloc(vbo, (6 + 3) * 2); - for (int i = 0; i < 6; ++i) { + for (int i = 0; i < 6; i++) { GPU_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, v[i]); GPU_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, v[(i + 1) % 6]); } @@ -2021,7 +2021,7 @@ GPUBatch *DRW_cache_lightprobe_grid_get(void) GPUVertBuf *vbo = GPU_vertbuf_create_with_format(&format); GPU_vertbuf_data_alloc(vbo, (6 * 2 + 3) * 2); - for (int i = 0; i < 6; ++i) { + for (int i = 0; i < 6; i++) { float tmp_v1[3], tmp_v2[3], tmp_tr[3]; copy_v3_v3(tmp_v1, v[i]); copy_v3_v3(tmp_v2, v[(i + 1) % 6]); @@ -2029,7 +2029,7 @@ GPUBatch *DRW_cache_lightprobe_grid_get(void) GPU_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, tmp_v2); /* Internal wires. */ - for (int j = 1; j < 2; ++j) { + for (int j = 1; j < 2; j++) { mul_v3_v3fl(tmp_tr, v[(i / 2) * 2 + 1], -0.5f * j); add_v3_v3v3(tmp_v1, v[i], tmp_tr); add_v3_v3v3(tmp_v2, v[(i + 1) % 6], tmp_tr); @@ -2076,7 +2076,7 @@ GPUBatch *DRW_cache_lightprobe_planar_get(void) GPUVertBuf *vbo = GPU_vertbuf_create_with_format(&format); GPU_vertbuf_data_alloc(vbo, 4 * 2); - for (int i = 0; i < 4; ++i) { + for (int i = 0; i < 4; i++) { GPU_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, v[i]); GPU_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, v[(i + 1) % 4]); } @@ -2214,7 +2214,7 @@ GPUBatch *DRW_cache_bone_octahedral_get(void) GPU_vertbuf_data_alloc(vbo, 24); for (int i = 0; i < 8; i++) { - for (int j = 0; j < 3; ++j) { + for (int j = 0; j < 3; j++) { GPU_vertbuf_attr_set(vbo, attr_id.nor, v_idx, bone_octahedral_solid_normals[i]); GPU_vertbuf_attr_set(vbo, attr_id.snor, @@ -2710,7 +2710,7 @@ GPUBatch *DRW_cache_bone_stick_get(void) GPU_indexbuf_init_ex(&elb, GPU_PRIM_TRI_FAN, (CIRCLE_RESOL + 2) * 2 + 6 + 2, vcount); /* head/tail points */ - for (int i = 0; i < 2; ++i) { + for (int i = 0; i < 2; i++) { /* center vertex */ copy_v2_fl(pos, 0.0f); flag = (i == 0) ? POS_HEAD : POS_TAIL; @@ -2735,7 +2735,7 @@ GPUBatch *DRW_cache_bone_stick_get(void) /* Bone rectangle */ pos[0] = 0.0f; - for (int i = 0; i < 6; ++i) { + for (int i = 0; i < 6; i++) { pos[1] = (i == 0 || i == 3) ? 0.0f : ((i < 3) ? 1.0f : -1.0f); flag = ((i < 2 || i > 4) ? POS_HEAD : POS_TAIL) | ((i == 0 || i == 3) ? 0 : COL_WIRE) | COL_BONE | POS_BONE; @@ -2896,8 +2896,8 @@ GPUBatch *DRW_cache_bone_arrows_get(void) set_bone_axis_vert(vbo, attr_id.axis, attr_id.pos, attr_id.col, &v, &a, pos, c); /* Axis end marker */ - for (int j = 1; j < MARKER_FILL_LAYER + 1; ++j) { - for (int i = 0; i < MARKER_LEN; ++i) { + for (int j = 1; j < MARKER_FILL_LAYER + 1; j++) { + for (int i = 0; i < MARKER_LEN; i++) { float tmp[2]; mul_v2_v2fl(tmp, axis_marker[i], j / (float)MARKER_FILL_LAYER); set_bone_axis_vert(vbo, attr_id.axis, attr_id.pos, attr_id.col, &v, &a, tmp, c); @@ -2924,8 +2924,8 @@ GPUBatch *DRW_cache_bone_arrows_get(void) /* Axis name shadows */ copy_v3_fl(c, 0.0f); c[axis] = 0.3f; - for (int j = 0; j < SHADOW_RES; ++j) { - for (int i = 0; i < axis_v_len; ++i) { + for (int j = 0; j < SHADOW_RES; j++) { + for (int i = 0; i < axis_v_len; i++) { float tmp[2]; add_v2_v2v2(tmp, axis_verts[i], axis_name_shadow[j]); set_bone_axis_vert(vbo, attr_id.axis, attr_id.pos, attr_id.col, &v, &a, tmp, c); @@ -2935,7 +2935,7 @@ GPUBatch *DRW_cache_bone_arrows_get(void) /* Axis name */ copy_v3_fl(c, 0.1f); c[axis] = 1.0f; - for (int i = 0; i < axis_v_len; ++i) { + for (int i = 0; i < axis_v_len; i++) { set_bone_axis_vert(vbo, attr_id.axis, attr_id.pos, attr_id.col, &v, &a, axis_verts[i], c); } } @@ -2990,12 +2990,12 @@ GPUBatch *DRW_cache_bone_dof_sphere_get(void) GPU_vertbuf_data_alloc(vbo, n * n * 6 * 4); uint v = 0; - for (q = 0; q < 4; ++q) { + for (q = 0; q < 4; q++) { pz = 0.0f; - for (i = 1; i < n; ++i) { + for (i = 1; i < n; i++) { z = staticSine[i]; px = 0.0f; - for (j = 1; j <= (n - i); ++j) { + for (j = 1; j <= (n - i); j++) { x = staticSine[j]; if (j == n - i) { set_vert(px, z, q); @@ -3937,7 +3937,7 @@ GPUBatch *DRW_cache_cursor_get(bool crosshair_lines) GPU_vertbuf_data_alloc(vbo, vert_len); int v = 0; - for (int i = 0; i < segments; ++i) { + for (int i = 0; i < segments; i++) { float angle = (float)(2 * M_PI) * ((float)i / (float)segments); float x = f10 * cosf(angle); float y = f10 * sinf(angle); diff --git a/source/blender/draw/intern/draw_cache_extract_mesh.c b/source/blender/draw/intern/draw_cache_extract_mesh.c index 2518cfb399d..48c28496584 100644 --- a/source/blender/draw/intern/draw_cache_extract_mesh.c +++ b/source/blender/draw/intern/draw_cache_extract_mesh.c @@ -523,7 +523,7 @@ static void extract_tris_finish(const MeshRenderData *mr, void *ibo, void *_data /* HACK Create ibo subranges and assign them to each GPUBatch. */ if (mr->use_final_mesh && mr->cache->surface_per_mat && mr->cache->surface_per_mat[0]) { BLI_assert(mr->cache->surface_per_mat[0]->elem == ibo); - for (int i = 0; i < mr->mat_len; ++i) { + for (int i = 0; i < mr->mat_len; i++) { /* Multiply by 3 because these are triangle indices. */ int start = data->tri_mat_start[i] * 3; int len = data->tri_mat_end[i] * 3 - data->tri_mat_start[i] * 3; diff --git a/source/blender/draw/intern/draw_cache_impl_curve.c b/source/blender/draw/intern/draw_cache_impl_curve.c index 241cd68bc3a..c0cbe3266cb 100644 --- a/source/blender/draw/intern/draw_cache_impl_curve.c +++ b/source/blender/draw/intern/draw_cache_impl_curve.c @@ -464,7 +464,7 @@ static void curve_batch_cache_init(Curve *cu) cache->surf_per_mat = MEM_mallocN(sizeof(*cache->surf_per_mat) * cache->mat_len, __func__); /* TODO Might be wiser to alloc in one chunk. */ - for (int i = 0; i < cache->mat_len; ++i) { + for (int i = 0; i < cache->mat_len; i++) { cache->surf_per_mat_tris[i] = MEM_callocN(sizeof(GPUIndexBuf), "GPUIndexBuf"); cache->surf_per_mat[i] = MEM_callocN(sizeof(GPUBatch), "GPUBatch"); } @@ -516,24 +516,24 @@ static void curve_batch_cache_clear(Curve *cu) return; } - for (int i = 0; i < sizeof(cache->ordered) / sizeof(void *); ++i) { + for (int i = 0; i < sizeof(cache->ordered) / sizeof(void *); i++) { GPUVertBuf **vbo = (GPUVertBuf **)&cache->ordered; GPU_VERTBUF_DISCARD_SAFE(vbo[i]); } - for (int i = 0; i < sizeof(cache->edit) / sizeof(void *); ++i) { + for (int i = 0; i < sizeof(cache->edit) / sizeof(void *); i++) { GPUVertBuf **vbo = (GPUVertBuf **)&cache->edit; GPU_VERTBUF_DISCARD_SAFE(vbo[i]); } - for (int i = 0; i < sizeof(cache->ibo) / sizeof(void *); ++i) { + for (int i = 0; i < sizeof(cache->ibo) / sizeof(void *); i++) { GPUIndexBuf **ibo = (GPUIndexBuf **)&cache->ibo; GPU_INDEXBUF_DISCARD_SAFE(ibo[i]); } - for (int i = 0; i < sizeof(cache->batch) / sizeof(void *); ++i) { + for (int i = 0; i < sizeof(cache->batch) / sizeof(void *); i++) { GPUBatch **batch = (GPUBatch **)&cache->batch; GPU_BATCH_DISCARD_SAFE(batch[i]); } - for (int i = 0; i < cache->mat_len; ++i) { + for (int i = 0; i < cache->mat_len; i++) { GPU_INDEXBUF_DISCARD_SAFE(cache->surf_per_mat_tris[i]); GPU_BATCH_DISCARD_SAFE(cache->surf_per_mat[i]); } @@ -891,7 +891,7 @@ GPUBatch **DRW_curve_batch_cache_get_surface_shaded(struct Curve *cu, curve_cd_calc_used_gpu_layers(&cache->cd_needed, gpumat_array, gpumat_array_len); - for (int i = 0; i < cache->mat_len; ++i) { + for (int i = 0; i < cache->mat_len; i++) { DRW_batch_request(&cache->surf_per_mat[i]); } return cache->surf_per_mat; @@ -929,7 +929,7 @@ void DRW_curve_batch_cache_create_requested(Object *ob) /* Verify that all surface batches have needed attribute layers. */ /* TODO(fclem): We could be a bit smarter here and only do it per material. */ - for (int i = 0; i < cache->mat_len; ++i) { + for (int i = 0; i < cache->mat_len; i++) { if ((cache->cd_used & cache->cd_needed) != cache->cd_needed) { /* We can't discard batches at this point as they have been * referenced for drawing. Just clear them in place. */ @@ -979,7 +979,7 @@ void DRW_curve_batch_cache_create_requested(Object *ob) if (DRW_batch_requested(cache->batch.edit_normals, GPU_PRIM_LINES)) { DRW_vbo_request(cache->batch.edit_normals, &cache->edit.curves_nor); } - for (int i = 0; i < cache->mat_len; ++i) { + for (int i = 0; i < cache->mat_len; i++) { if (DRW_batch_requested(cache->surf_per_mat[i], GPU_PRIM_TRIS)) { if (cache->mat_len > 1) { DRW_ibo_request(cache->surf_per_mat[i], &cache->surf_per_mat_tris[i]); @@ -1014,7 +1014,7 @@ void DRW_curve_batch_cache_create_requested(Object *ob) DRW_ADD_FLAG_FROM_IBO_REQUEST(mr_flag, cache->ibo.edit_verts_points, CU_DATATYPE_OVERLAY); DRW_ADD_FLAG_FROM_IBO_REQUEST(mr_flag, cache->ibo.edit_lines, CU_DATATYPE_OVERLAY); - for (int i = 0; i < cache->mat_len; ++i) { + for (int i = 0; i < cache->mat_len; i++) { DRW_ADD_FLAG_FROM_IBO_REQUEST(mr_flag, cache->surf_per_mat_tris[i], CU_DATATYPE_SURFACE); } @@ -1080,7 +1080,7 @@ void DRW_curve_batch_cache_create_requested(Object *ob) #ifdef DEBUG /* Make sure all requested batches have been setup. */ - for (int i = 0; i < sizeof(cache->batch) / sizeof(void *); ++i) { + for (int i = 0; i < sizeof(cache->batch) / sizeof(void *); i++) { BLI_assert(!DRW_batch_requested(((GPUBatch **)&cache->batch)[i], 0)); } #endif diff --git a/source/blender/draw/intern/draw_cache_impl_lattice.c b/source/blender/draw/intern/draw_cache_impl_lattice.c index 8b3864684b5..01cd2b52ae3 100644 --- a/source/blender/draw/intern/draw_cache_impl_lattice.c +++ b/source/blender/draw/intern/draw_cache_impl_lattice.c @@ -420,7 +420,7 @@ static GPUVertBuf *lattice_batch_cache_get_pos(LatticeRenderData *rdata, cache->pos = GPU_vertbuf_create_with_format(&format); GPU_vertbuf_data_alloc(cache->pos, vert_len); - for (int i = 0; i < vert_len; ++i) { + for (int i = 0; i < vert_len; i++) { const BPoint *bp = lattice_render_data_vert_bpoint(rdata, i); GPU_vertbuf_attr_set(cache->pos, attr_id.pos, i, bp->vec); @@ -516,7 +516,7 @@ static void lattice_batch_cache_create_overlay_batches(Lattice *lt) GPUVertBuf *vbo = GPU_vertbuf_create_with_format(&format); GPU_vertbuf_data_alloc(vbo, vert_len); - for (int i = 0; i < vert_len; ++i) { + for (int i = 0; i < vert_len; i++) { const BPoint *bp = lattice_render_data_vert_bpoint(rdata, i); char vflag = 0; diff --git a/source/blender/draw/intern/draw_cache_impl_mesh.c b/source/blender/draw/intern/draw_cache_impl_mesh.c index 96c677dc184..f0afbe2afe5 100644 --- a/source/blender/draw/intern/draw_cache_impl_mesh.c +++ b/source/blender/draw/intern/draw_cache_impl_mesh.c @@ -603,14 +603,14 @@ static void mesh_batch_cache_clear(Mesh *me) { GPUVertBuf **vbos = (GPUVertBuf **)&mbufcache->vbo; GPUIndexBuf **ibos = (GPUIndexBuf **)&mbufcache->ibo; - for (int i = 0; i < sizeof(mbufcache->vbo) / sizeof(void *); ++i) { + for (int i = 0; i < sizeof(mbufcache->vbo) / sizeof(void *); i++) { GPU_VERTBUF_DISCARD_SAFE(vbos[i]); } - for (int i = 0; i < sizeof(mbufcache->ibo) / sizeof(void *); ++i) { + for (int i = 0; i < sizeof(mbufcache->ibo) / sizeof(void *); i++) { GPU_INDEXBUF_DISCARD_SAFE(ibos[i]); } } - for (int i = 0; i < sizeof(cache->batch) / sizeof(void *); ++i) { + for (int i = 0; i < sizeof(cache->batch) / sizeof(void *); i++) { GPUBatch **batch = (GPUBatch **)&cache->batch; GPU_BATCH_DISCARD_SAFE(batch[i]); } @@ -756,7 +756,7 @@ GPUBatch **DRW_mesh_batch_cache_get_surface_shaded(Mesh *me, *auto_layer_is_srgb = cache->auto_layer_is_srgb; *auto_layer_count = cache->auto_layer_len; } - for (int i = 0; i < cache->mat_len; ++i) { + for (int i = 0; i < cache->mat_len; i++) { DRW_batch_request(&cache->surface_per_mat[i]); } return cache->surface_per_mat; @@ -767,7 +767,7 @@ GPUBatch **DRW_mesh_batch_cache_get_surface_texpaint(Mesh *me) MeshBatchCache *cache = mesh_batch_cache_get(me); mesh_batch_cache_add_request(cache, MBC_SURF_PER_MAT); texpaint_request_active_uv(cache, me); - for (int i = 0; i < cache->mat_len; ++i) { + for (int i = 0; i < cache->mat_len; i++) { DRW_batch_request(&cache->surface_per_mat[i]); } return cache->surface_per_mat; @@ -1054,7 +1054,7 @@ void DRW_mesh_batch_cache_create_requested( * This is only if the cd_needed changes so it is ok to keep them.*/ if (cache->surface_per_mat[0] && cache->surface_per_mat[0]->elem) { saved_elem_ranges = MEM_callocN(sizeof(saved_elem_ranges) * cache->mat_len, __func__); - for (int i = 0; i < cache->mat_len; ++i) { + for (int i = 0; i < cache->mat_len; i++) { saved_elem_ranges[i] = cache->surface_per_mat[i]->elem; /* Avoid deletion as the batch is owner. */ cache->surface_per_mat[i]->elem = NULL; @@ -1063,7 +1063,7 @@ void DRW_mesh_batch_cache_create_requested( } /* We can't discard batches at this point as they have been * referenced for drawing. Just clear them in place. */ - for (int i = 0; i < cache->mat_len; ++i) { + for (int i = 0; i < cache->mat_len; i++) { GPU_BATCH_CLEAR_SAFE(cache->surface_per_mat[i]); } GPU_BATCH_CLEAR_SAFE(cache->batch.surface); @@ -1181,7 +1181,7 @@ void DRW_mesh_batch_cache_create_requested( } /* Per Material */ - for (int i = 0; i < cache->mat_len; ++i) { + for (int i = 0; i < cache->mat_len; i++) { if (DRW_batch_requested(cache->surface_per_mat[i], GPU_PRIM_TRIS)) { if (saved_elem_ranges && saved_elem_ranges[i]) { /* XXX assign old element buffer range (it did not change).*/ @@ -1325,25 +1325,25 @@ void DRW_mesh_batch_cache_create_requested( #ifdef DEBUG check: /* Make sure all requested batches have been setup. */ - for (int i = 0; i < sizeof(cache->batch) / sizeof(void *); ++i) { + for (int i = 0; i < sizeof(cache->batch) / sizeof(void *); i++) { BLI_assert(!DRW_batch_requested(((GPUBatch **)&cache->batch)[i], 0)); } - for (int i = 0; i < sizeof(cache->final.vbo) / sizeof(void *); ++i) { + for (int i = 0; i < sizeof(cache->final.vbo) / sizeof(void *); i++) { BLI_assert(!DRW_vbo_requested(((GPUVertBuf **)&cache->final.vbo)[i])); } - for (int i = 0; i < sizeof(cache->final.ibo) / sizeof(void *); ++i) { + for (int i = 0; i < sizeof(cache->final.ibo) / sizeof(void *); i++) { BLI_assert(!DRW_ibo_requested(((GPUIndexBuf **)&cache->final.ibo)[i])); } - for (int i = 0; i < sizeof(cache->cage.vbo) / sizeof(void *); ++i) { + for (int i = 0; i < sizeof(cache->cage.vbo) / sizeof(void *); i++) { BLI_assert(!DRW_vbo_requested(((GPUVertBuf **)&cache->cage.vbo)[i])); } - for (int i = 0; i < sizeof(cache->cage.ibo) / sizeof(void *); ++i) { + for (int i = 0; i < sizeof(cache->cage.ibo) / sizeof(void *); i++) { BLI_assert(!DRW_ibo_requested(((GPUIndexBuf **)&cache->cage.ibo)[i])); } - for (int i = 0; i < sizeof(cache->uv_cage.vbo) / sizeof(void *); ++i) { + for (int i = 0; i < sizeof(cache->uv_cage.vbo) / sizeof(void *); i++) { BLI_assert(!DRW_vbo_requested(((GPUVertBuf **)&cache->uv_cage.vbo)[i])); } - for (int i = 0; i < sizeof(cache->uv_cage.ibo) / sizeof(void *); ++i) { + for (int i = 0; i < sizeof(cache->uv_cage.ibo) / sizeof(void *); i++) { BLI_assert(!DRW_ibo_requested(((GPUIndexBuf **)&cache->uv_cage.ibo)[i])); } #endif diff --git a/source/blender/draw/intern/draw_cache_impl_metaball.c b/source/blender/draw/intern/draw_cache_impl_metaball.c index 60f15338412..e3bfcbde3ef 100644 --- a/source/blender/draw/intern/draw_cache_impl_metaball.c +++ b/source/blender/draw/intern/draw_cache_impl_metaball.c @@ -212,7 +212,7 @@ GPUBatch **DRW_metaball_batch_cache_get_surface_shaded(Object *ob, cache->shaded_triangles = MEM_callocN(sizeof(*cache->shaded_triangles) * cache->mat_len, __func__); cache->shaded_triangles[0] = DRW_metaball_batch_cache_get_triangles_with_normals(ob); - for (int i = 1; i < cache->mat_len; ++i) { + for (int i = 1; i < cache->mat_len; i++) { cache->shaded_triangles[i] = NULL; } } diff --git a/source/blender/draw/intern/draw_cache_impl_particles.c b/source/blender/draw/intern/draw_cache_impl_particles.c index 6cd03d14bfd..3afdd77b6a7 100644 --- a/source/blender/draw/intern/draw_cache_impl_particles.c +++ b/source/blender/draw/intern/draw_cache_impl_particles.c @@ -190,18 +190,18 @@ static void particle_batch_cache_clear_hair(ParticleHairCache *hair_cache) DRW_TEXTURE_FREE_SAFE(hair_cache->strand_tex); DRW_TEXTURE_FREE_SAFE(hair_cache->strand_seg_tex); - for (int i = 0; i < MAX_MTFACE; ++i) { + for (int i = 0; i < MAX_MTFACE; i++) { GPU_VERTBUF_DISCARD_SAFE(hair_cache->proc_uv_buf[i]); DRW_TEXTURE_FREE_SAFE(hair_cache->uv_tex[i]); } - for (int i = 0; i < MAX_MCOL; ++i) { + for (int i = 0; i < MAX_MCOL; i++) { GPU_VERTBUF_DISCARD_SAFE(hair_cache->proc_col_buf[i]); DRW_TEXTURE_FREE_SAFE(hair_cache->col_tex[i]); } - for (int i = 0; i < MAX_HAIR_SUBDIV; ++i) { + for (int i = 0; i < MAX_HAIR_SUBDIV; i++) { GPU_VERTBUF_DISCARD_SAFE(hair_cache->final[i].proc_buf); DRW_TEXTURE_FREE_SAFE(hair_cache->final[i].proc_tex); - for (int j = 0; j < MAX_THICKRES; ++j) { + for (int j = 0; j < MAX_THICKRES; j++) { GPU_BATCH_DISCARD_SAFE(hair_cache->final[i].proc_hairs[j]); } } diff --git a/source/blender/draw/intern/draw_common.c b/source/blender/draw/intern/draw_common.c index 096e1c2aeca..8e0f713add6 100644 --- a/source/blender/draw/intern/draw_common.c +++ b/source/blender/draw/intern/draw_common.c @@ -296,13 +296,13 @@ static struct { void DRW_globals_free(void) { struct GPUVertFormat **format = &g_formats.instance_screenspace; - for (int i = 0; i < sizeof(g_formats) / sizeof(void *); ++i, ++format) { + for (int i = 0; i < sizeof(g_formats) / sizeof(void *); i++, format++) { MEM_SAFE_FREE(*format); } for (int j = 0; j < GPU_SHADER_CFG_LEN; j++) { struct GPUShader **shader = &g_shaders[j].shape_outline; - for (int i = 0; i < sizeof(g_shaders[j]) / sizeof(void *); ++i, ++shader) { + for (int i = 0; i < sizeof(g_shaders[j]) / sizeof(void *); i++, shader++) { DRW_SHADER_FREE_SAFE(*shader); } } diff --git a/source/blender/draw/intern/draw_debug.c b/source/blender/draw/intern/draw_debug.c index 9681ffd9d3d..6b05bb07c0f 100644 --- a/source/blender/draw/intern/draw_debug.c +++ b/source/blender/draw/intern/draw_debug.c @@ -63,7 +63,7 @@ void DRW_debug_polygon_v3(const float (*v)[3], const int vert_len, const float c { BLI_assert(vert_len > 1); - for (int i = 0; i < vert_len; ++i) { + for (int i = 0; i < vert_len; i++) { DRW_debug_line_v3v3(v[i], v[(i + 1) % vert_len], color); } } @@ -117,7 +117,7 @@ void DRW_debug_m4_as_bbox(const float m[4][4], const float color[4], const bool } BKE_boundbox_init_from_minmax(&bb, min, max); - for (int i = 0; i < 8; ++i) { + for (int i = 0; i < 8; i++) { mul_project_m4_v3(project_matrix, bb.vec[i]); } DRW_debug_bbox(&bb, color); diff --git a/source/blender/draw/intern/draw_hair.c b/source/blender/draw/intern/draw_hair.c index 44ed01c47aa..f77243ca9f1 100644 --- a/source/blender/draw/intern/draw_hair.c +++ b/source/blender/draw/intern/draw_hair.c @@ -151,13 +151,13 @@ static DRWShadingGroup *drw_shgroup_create_hair_procedural_ex(Object *object, } /* TODO optimize this. Only bind the ones GPUMaterial needs. */ - for (int i = 0; i < hair_cache->num_uv_layers; ++i) { - for (int n = 0; n < MAX_LAYER_NAME_CT && hair_cache->uv_layer_names[i][n][0] != '\0'; ++n) { + for (int i = 0; i < hair_cache->num_uv_layers; i++) { + for (int n = 0; n < MAX_LAYER_NAME_CT && hair_cache->uv_layer_names[i][n][0] != '\0'; n++) { DRW_shgroup_uniform_texture(shgrp, hair_cache->uv_layer_names[i][n], hair_cache->uv_tex[i]); } } - for (int i = 0; i < hair_cache->num_col_layers; ++i) { - for (int n = 0; n < MAX_LAYER_NAME_CT && hair_cache->col_layer_names[i][n][0] != '\0'; ++n) { + for (int i = 0; i < hair_cache->num_col_layers; i++) { + for (int n = 0; n < MAX_LAYER_NAME_CT && hair_cache->col_layer_names[i][n][0] != '\0'; n++) { DRW_shgroup_uniform_texture( shgrp, hair_cache->col_layer_names[i][n], hair_cache->col_tex[i]); } @@ -323,7 +323,7 @@ void DRW_hair_update(void) void DRW_hair_free(void) { - for (int i = 0; i < PART_REFINE_MAX_SHADER; ++i) { + for (int i = 0; i < PART_REFINE_MAX_SHADER; i++) { DRW_SHADER_FREE_SAFE(g_refine_shaders[i]); } } diff --git a/source/blender/draw/intern/draw_instance_data.c b/source/blender/draw/intern/draw_instance_data.c index 8f26cc72a02..69756203d66 100644 --- a/source/blender/draw/intern/draw_instance_data.c +++ b/source/blender/draw/intern/draw_instance_data.c @@ -298,7 +298,7 @@ void DRW_instance_data_list_free(DRWInstanceDataList *idatalist) { DRWInstanceData *idata, *next_idata; - for (int i = 0; i < MAX_INSTANCE_DATA_SIZE; ++i) { + for (int i = 0; i < MAX_INSTANCE_DATA_SIZE; i++) { for (idata = idatalist->idata_head[i]; idata; idata = next_idata) { next_idata = idata->next; DRW_instance_data_free(idata); @@ -319,7 +319,7 @@ void DRW_instance_data_list_reset(DRWInstanceDataList *idatalist) { DRWInstanceData *idata; - for (int i = 0; i < MAX_INSTANCE_DATA_SIZE; ++i) { + for (int i = 0; i < MAX_INSTANCE_DATA_SIZE; i++) { for (idata = idatalist->idata_head[i]; idata; idata = idata->next) { idata->used = false; } @@ -331,7 +331,7 @@ void DRW_instance_data_list_free_unused(DRWInstanceDataList *idatalist) DRWInstanceData *idata, *next_idata; /* Remove unused data blocks and sanitize each list. */ - for (int i = 0; i < MAX_INSTANCE_DATA_SIZE; ++i) { + for (int i = 0; i < MAX_INSTANCE_DATA_SIZE; i++) { idatalist->idata_tail[i] = NULL; for (idata = idatalist->idata_head[i]; idata; idata = next_idata) { next_idata = idata->next; @@ -360,7 +360,7 @@ void DRW_instance_data_list_resize(DRWInstanceDataList *idatalist) { DRWInstanceData *idata; - for (int i = 0; i < MAX_INSTANCE_DATA_SIZE; ++i) { + for (int i = 0; i < MAX_INSTANCE_DATA_SIZE; i++) { for (idata = idatalist->idata_head[i]; idata; idata = idata->next) { BLI_mempool_clear_ex(idata->mempool, BLI_mempool_len(idata->mempool)); } diff --git a/source/blender/draw/intern/draw_manager_data.c b/source/blender/draw/intern/draw_manager_data.c index 8b7cb9c1dad..cd174e899d4 100644 --- a/source/blender/draw/intern/draw_manager_data.c +++ b/source/blender/draw/intern/draw_manager_data.c @@ -787,7 +787,7 @@ void DRW_buffer_add_entry_array(DRWCallBuffer *callbuf, const void *attr[], uint GPU_vertbuf_data_resize(buf, count + DRW_BUFFER_VERTS_CHUNK); } - for (int i = 0; i < attr_len; ++i) { + for (int i = 0; i < attr_len; i++) { GPU_vertbuf_attr_set(buf, i, count, attr[i]); } @@ -939,7 +939,7 @@ GPUVertFormat *DRW_shgroup_instance_format_array(const DRWInstanceAttrFormat att { GPUVertFormat *format = MEM_callocN(sizeof(GPUVertFormat), "GPUVertFormat"); - for (int i = 0; i < arraysize; ++i) { + for (int i = 0; i < arraysize; i++) { GPU_vertformat_attr_add(format, attrs[i].name, (attrs[i].type == DRW_ATTR_INT) ? GPU_COMP_I32 : GPU_COMP_F32, diff --git a/source/blender/draw/intern/draw_manager_exec.c b/source/blender/draw/intern/draw_manager_exec.c index 0d19a257cfa..9732f36e293 100644 --- a/source/blender/draw/intern/draw_manager_exec.c +++ b/source/blender/draw/intern/draw_manager_exec.c @@ -301,12 +301,12 @@ void drw_state_set(DRWState state) int test; if ((test = CHANGED_TO(DRW_STATE_CLIP_PLANES))) { if (test == 1) { - for (int i = 0; i < DST.view_active->clip_planes_len; ++i) { + for (int i = 0; i < DST.view_active->clip_planes_len; i++) { glEnable(GL_CLIP_DISTANCE0 + i); } } else { - for (int i = 0; i < MAX_CLIP_PLANES; ++i) { + for (int i = 0; i < MAX_CLIP_PLANES; i++) { glDisable(GL_CLIP_DISTANCE0 + i); } } @@ -771,7 +771,7 @@ static bool ubo_bindings_validate(DRWShadingGroup *shgroup) glGetIntegerv(GL_CURRENT_PROGRAM, &program); glGetProgramiv(program, GL_ACTIVE_UNIFORM_BLOCKS, &active_blocks); - for (uint i = 0; i < active_blocks; ++i) { + for (uint i = 0; i < active_blocks; i++) { int binding = 0; int buffer = 0; diff --git a/source/blender/draw/intern/draw_manager_profiling.c b/source/blender/draw/intern/draw_manager_profiling.c index bab69cf7a57..76382132230 100644 --- a/source/blender/draw/intern/draw_manager_profiling.c +++ b/source/blender/draw/intern/draw_manager_profiling.c @@ -63,7 +63,7 @@ static struct DRWTimerPool { void DRW_stats_free(void) { if (DTP.timers != NULL) { - for (int i = 0; i < DTP.timer_count; ++i) { + for (int i = 0; i < DTP.timer_count; i++) { DRWTimer *timer = &DTP.timers[i]; glDeleteQueries(2, timer->query); } @@ -169,7 +169,7 @@ void DRW_stats_reset(void) GLuint64 lvl_time[MAX_NESTED_TIMER] = {0}; /* Swap queries for the next frame and sum up each lvl time. */ - for (int i = DTP.timer_increment - 1; i >= 0; --i) { + for (int i = DTP.timer_increment - 1; i >= 0; i--) { DRWTimer *timer = &DTP.timers[i]; SWAP(GLuint, timer->query[0], timer->query[1]); @@ -323,7 +323,7 @@ void DRW_stats_draw(const rcti *rect) BLI_strncpy(stat_string, "GPU Render Timings", sizeof(stat_string)); draw_stat(rect, 0, v++, stat_string, sizeof(stat_string)); - for (int i = 0; i < DTP.timer_increment; ++i) { + for (int i = 0; i < DTP.timer_increment; i++) { double time_ms, time_percent; DRWTimer *timer = &DTP.timers[i]; DRWTimer *timer_parent = (timer->lvl > 0) ? &DTP.timers[lvl_index[timer->lvl - 1]] : NULL; |