Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Oeser <info@graphics-engineer.com>2021-09-24 11:45:36 +0300
committerPhilipp Oeser <info@graphics-engineer.com>2021-09-24 11:45:36 +0300
commit3ac342dc6d8024024de095dadb7b2a1e7b53583d (patch)
tree16555815f52cb03ccd519aa506b9a513c311214c /source/blender/draw/intern
parent9a45a4c52597fbdc1cc5871329fdbc4db3b4357f (diff)
Cleanup: clang format
Diffstat (limited to 'source/blender/draw/intern')
-rw-r--r--source/blender/draw/intern/draw_cache_impl_hair.c10
-rw-r--r--source/blender/draw/intern/draw_cache_impl_particles.c6
-rw-r--r--source/blender/draw/intern/draw_hair.c18
3 files changed, 22 insertions, 12 deletions
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;