[Bf-blender-cvs] [3ac342dc6d8] master: Cleanup: clang format

Philipp Oeser noreply at git.blender.org
Fri Sep 24 10:48:02 CEST 2021


Commit: 3ac342dc6d8024024de095dadb7b2a1e7b53583d
Author: Philipp Oeser
Date:   Fri Sep 24 10:45:36 2021 +0200
Branches: master
https://developer.blender.org/rB3ac342dc6d8024024de095dadb7b2a1e7b53583d

Cleanup: clang format

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

M	intern/cycles/blender/blender_curves.cpp
M	intern/cycles/render/nodes.cpp
M	source/blender/blenloader/intern/versioning_300.c
M	source/blender/draw/engines/eevee/eevee_materials.c
M	source/blender/draw/intern/draw_cache_impl_hair.c
M	source/blender/draw/intern/draw_cache_impl_particles.c
M	source/blender/draw/intern/draw_hair.c
M	source/blender/gpu/intern/gpu_codegen.c

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

diff --git a/intern/cycles/blender/blender_curves.cpp b/intern/cycles/blender/blender_curves.cpp
index c7851e40543..b6b4f206620 100644
--- a/intern/cycles/blender/blender_curves.cpp
+++ b/intern/cycles/blender/blender_curves.cpp
@@ -339,8 +339,7 @@ static void ExportCurveSegments(Scene *scene, Hair *hair, ParticleCurveData *CDa
         num_curve_keys++;
       }
 
-      if (attr_length != NULL)
-      {
+      if (attr_length != NULL) {
         attr_length->add(CData->curve_length[curve]);
       }
 
@@ -671,8 +670,7 @@ static void export_hair_curves(Scene *scene, Hair *hair, BL::Hair b_hair)
   if (hair->need_attribute(scene, ATTR_STD_CURVE_INTERCEPT)) {
     attr_intercept = hair->attributes.add(ATTR_STD_CURVE_INTERCEPT);
   }
-  if (hair->need_attribute(scene, ATTR_STD_CURVE_LENGTH))
-  {
+  if (hair->need_attribute(scene, ATTR_STD_CURVE_LENGTH)) {
     attr_length = hair->attributes.add(ATTR_STD_CURVE_LENGTH);
   }
   if (hair->need_attribute(scene, ATTR_STD_CURVE_RANDOM)) {
@@ -727,8 +725,7 @@ static void export_hair_curves(Scene *scene, Hair *hair, BL::Hair b_hair)
       }
     }
 
-  	if (attr_length) 
-    {
+    if (attr_length) {
       attr_length->add(length);
     }
 
diff --git a/intern/cycles/render/nodes.cpp b/intern/cycles/render/nodes.cpp
index e5071c25730..90f70cf19ec 100644
--- a/intern/cycles/render/nodes.cpp
+++ b/intern/cycles/render/nodes.cpp
@@ -4391,7 +4391,7 @@ void HairInfoNode::attributes(Shader *shader, AttributeRequestSet *attributes)
     if (!intercept_out->links.empty())
       attributes->add(ATTR_STD_CURVE_INTERCEPT);
 
-  	if (!output("Length")->links.empty())
+    if (!output("Length")->links.empty())
       attributes->add(ATTR_STD_CURVE_LENGTH);
 
     if (!output("Random")->links.empty())
diff --git a/source/blender/blenloader/intern/versioning_300.c b/source/blender/blenloader/intern/versioning_300.c
index 0d333ac2edc..88df4f73d45 100644
--- a/source/blender/blenloader/intern/versioning_300.c
+++ b/source/blender/blenloader/intern/versioning_300.c
@@ -536,8 +536,9 @@ void do_versions_after_linking_300(Main *bmain, ReportList *UNUSED(reports))
       }
     }
     LISTBASE_FOREACH (Brush *, brush, &bmain->brushes) {
-      if (brush->clone.image != NULL && ELEM(brush->clone.image->type, IMA_TYPE_R_RESULT,
-                                             IMA_TYPE_COMPOSITE)) { brush->clone.image = NULL;
+      if (brush->clone.image != NULL &&
+          ELEM(brush->clone.image->type, IMA_TYPE_R_RESULT, IMA_TYPE_COMPOSITE)) {
+        brush->clone.image = NULL;
       }
     }
   }
diff --git a/source/blender/draw/engines/eevee/eevee_materials.c b/source/blender/draw/engines/eevee/eevee_materials.c
index 5f45e2184aa..a627bcd9488 100644
--- a/source/blender/draw/engines/eevee/eevee_materials.c
+++ b/source/blender/draw/engines/eevee/eevee_materials.c
@@ -773,7 +773,8 @@ static void eevee_hair_cache_populate(EEVEE_Data *vedata,
     DRW_shgroup_add_material_resources(*matcache.depth_grp_p, matcache.shading_gpumat);
   }
   if (matcache.shading_grp) {
-    *matcache.shading_grp_p = DRW_shgroup_hair_create_sub(ob, psys, md, matcache.shading_grp, matcache.shading_gpumat);
+    *matcache.shading_grp_p = DRW_shgroup_hair_create_sub(
+        ob, psys, md, matcache.shading_grp, matcache.shading_gpumat);
     DRW_shgroup_add_material_resources(*matcache.shading_grp_p, matcache.shading_gpumat);
   }
   if (matcache.shadow_grp) {
diff --git a/source/blender/draw/intern/draw_cache_impl_hair.c b/source/blender/draw/intern/draw_cache_impl_hair.c
index 82af32c4c9f..41a0cca8a8f 100644
--- a/source/blender/draw/intern/draw_cache_impl_hair.c
+++ b/source/blender/draw/intern/draw_cache_impl_hair.c
@@ -27,10 +27,10 @@
 
 #include "MEM_guardedalloc.h"
 
+#include "BLI_listbase.h"
 #include "BLI_math_base.h"
 #include "BLI_math_vector.h"
 #include "BLI_utildefines.h"
-#include "BLI_listbase.h"
 
 #include "DNA_hair_types.h"
 #include "DNA_object_types.h"
@@ -38,8 +38,8 @@
 #include "BKE_hair.h"
 
 #include "GPU_batch.h"
-#include "GPU_texture.h"
 #include "GPU_material.h"
+#include "GPU_texture.h"
 
 #include "draw_cache_impl.h"   /* own include */
 #include "draw_hair_private.h" /* own include */
@@ -143,7 +143,9 @@ static void ensure_seg_pt_count(Hair *hair, ParticleHairCache *hair_cache)
   }
 }
 
-static void hair_batch_cache_fill_segments_proc_pos(Hair *hair, GPUVertBufRaw *attr_step, GPUVertBufRaw *length_step)
+static void hair_batch_cache_fill_segments_proc_pos(Hair *hair,
+                                                    GPUVertBufRaw *attr_step,
+                                                    GPUVertBufRaw *length_step)
 {
   /* TODO: use hair radius layer if available. */
   HairCurve *curve = hair->curves;
@@ -165,7 +167,7 @@ static void hair_batch_cache_fill_segments_proc_pos(Hair *hair, GPUVertBufRaw *a
       co_prev = curve_co[j];
     }
     /* Assign length value*/
-    *(float *)GPU_vertbuf_raw_step(length_step) = total_len; 
+    *(float *)GPU_vertbuf_raw_step(length_step) = total_len;
     if (total_len > 0.0f) {
       /* Divide by total length to have a [0-1] number. */
       for (int j = 0; j < curve->numpoints; j++, seg_data_first += 4) {
diff --git a/source/blender/draw/intern/draw_cache_impl_particles.c b/source/blender/draw/intern/draw_cache_impl_particles.c
index 387c43741f7..087d88f4b1f 100644
--- a/source/blender/draw/intern/draw_cache_impl_particles.c
+++ b/source/blender/draw/intern/draw_cache_impl_particles.c
@@ -1697,9 +1697,11 @@ bool particles_ensure_procedural_data(Object *object,
   (*r_hair_cache)->final[subdiv].strands_res = 1 << (part->draw_step + subdiv);
 
   /* Refreshed on combing and simulation. */
-  if ((*r_hair_cache)->proc_point_buf == NULL || (gpu_material && (*r_hair_cache)->length_tex == NULL)) {
+  if ((*r_hair_cache)->proc_point_buf == NULL ||
+      (gpu_material && (*r_hair_cache)->length_tex == NULL)) {
     ensure_seg_pt_count(source.edit, source.psys, &cache->hair);
-    particle_batch_cache_ensure_procedural_pos(source.edit, source.psys, &cache->hair, gpu_material);
+    particle_batch_cache_ensure_procedural_pos(
+        source.edit, source.psys, &cache->hair, gpu_material);
     need_ft_update = true;
   }
 
diff --git a/source/blender/draw/intern/draw_hair.c b/source/blender/draw/intern/draw_hair.c
index 75bef12285b..6a23eb8695e 100644
--- a/source/blender/draw/intern/draw_hair.c
+++ b/source/blender/draw/intern/draw_hair.c
@@ -38,10 +38,10 @@
 #include "GPU_batch.h"
 #include "GPU_capabilities.h"
 #include "GPU_compute.h"
+#include "GPU_material.h"
 #include "GPU_shader.h"
 #include "GPU_texture.h"
 #include "GPU_vertex_buffer.h"
-#include "GPU_material.h"
 
 #include "draw_hair_private.h"
 #include "draw_shader.h"
@@ -173,14 +173,19 @@ static void drw_hair_particle_cache_update_transform_feedback(ParticleHairCache
   }
 }
 
-static ParticleHairCache *drw_hair_particle_cache_get(
-    Object *object, ParticleSystem *psys, ModifierData *md, GPUMaterial* gpu_material, int subdiv, int thickness_res)
+static ParticleHairCache *drw_hair_particle_cache_get(Object *object,
+                                                      ParticleSystem *psys,
+                                                      ModifierData *md,
+                                                      GPUMaterial *gpu_material,
+                                                      int subdiv,
+                                                      int thickness_res)
 {
   bool update;
   ParticleHairCache *cache;
   if (psys) {
     /* Old particle hair. */
-    update = particles_ensure_procedural_data(object, psys, md, &cache, gpu_material, subdiv, thickness_res);
+    update = particles_ensure_procedural_data(
+        object, psys, md, &cache, gpu_material, subdiv, thickness_res);
   }
   else {
     /* New hair object. */
@@ -207,7 +212,8 @@ GPUVertBuf *DRW_hair_pos_buffer_get(Object *object, ParticleSystem *psys, Modifi
   int subdiv = scene->r.hair_subdiv;
   int thickness_res = (scene->r.hair_type == SCE_HAIR_SHAPE_STRAND) ? 1 : 2;
 
-  ParticleHairCache *cache = drw_hair_particle_cache_get(object, psys, md, NULL, subdiv, thickness_res);
+  ParticleHairCache *cache = drw_hair_particle_cache_get(
+      object, psys, md, NULL, subdiv, thickness_res);
 
   return cache->final[subdiv].proc_buf;
 }
@@ -250,7 +256,7 @@ DRWShadingGroup *DRW_shgroup_hair_create_sub(Object *object,
                                              ParticleSystem *psys,
                                              ModifierData *md,
                                              DRWShadingGroup *shgrp_parent,
-                                             GPUMaterial* gpu_material)
+                                             GPUMaterial *gpu_material)
 {
   const DRWContextState *draw_ctx = DRW_context_state_get();
   Scene *scene = draw_ctx->scene;
diff --git a/source/blender/gpu/intern/gpu_codegen.c b/source/blender/gpu/intern/gpu_codegen.c
index bbe939b546b..6cc8d7d9d05 100644
--- a/source/blender/gpu/intern/gpu_codegen.c
+++ b/source/blender/gpu/intern/gpu_codegen.c
@@ -718,8 +718,7 @@ static char *code_generate_vertex(GPUNodeGraph *graph,
       BLI_dynstr_append(ds, datatoc_gpu_shader_common_obinfos_lib_glsl);
       BLI_dynstr_append(ds, "DEFINE_ATTR(vec4, orco);\n");
     }
-    if (attr->type == CD_HAIRLENGTH)
-    {
+    if (attr->type == CD_HAIRLENGTH) {
       BLI_dynstr_append(ds, datatoc_gpu_shader_common_obinfos_lib_glsl);
       BLI_dynstr_append(ds, "DEFINE_ATTR(float, hairLen);\n");
     }
@@ -768,8 +767,7 @@ static char *code_generate_vertex(GPUNodeGraph *graph,
           ds, "  var%d = orco_get(position, modelmatinv, OrcoTexCoFactors, orco);\n", attr->id);
     }
     else if (attr->type == CD_HAIRLENGTH) {
-      BLI_dynstr_appendf(
-          ds, "  var%d = hair_len_get(hair_get_strand_id(), hairLen);\n", attr->id);
+      BLI_dynstr_appendf(ds, "  var%d = hair_len_get(hair_get_strand_id(), hairLen);\n", attr->id);
     }
     else {
       const char *type_str = gpu_data_type_to_string(attr->gputype);



More information about the Bf-blender-cvs mailing list