[Bf-blender-cvs] [b5496c0] temp-modifier-deltamush-experimental: Minor edits, preparing for master
Campbell Barton
noreply at git.blender.org
Tue Mar 31 00:09:23 CEST 2015
Commit: b5496c09c2b9a1a0c1d6bfa02500a98fb9db97fb
Author: Campbell Barton
Date: Tue Mar 31 09:04:13 2015 +1100
Branches: temp-modifier-deltamush-experimental
https://developer.blender.org/rBb5496c09c2b9a1a0c1d6bfa02500a98fb9db97fb
Minor edits, preparing for master
===================================================================
M source/blender/modifiers/intern/MOD_correctivesmooth.c
D source/blender/modifiers/intern/MOD_deltamush.c.asm
===================================================================
diff --git a/source/blender/modifiers/intern/MOD_correctivesmooth.c b/source/blender/modifiers/intern/MOD_correctivesmooth.c
index 47b127d..eaef99f 100644
--- a/source/blender/modifiers/intern/MOD_correctivesmooth.c
+++ b/source/blender/modifiers/intern/MOD_correctivesmooth.c
@@ -18,12 +18,19 @@
* The Original Code is Copyright (C) 2015 by the Blender Foundation.
* All rights reserved.
*
-* Contributor(s): Jack Simpson
+* Contributor(s): Jack Simpson,
+* Campbell Barton
*
* ***** END GPL LICENSE BLOCK *****
*
*/
+/** \file blender/modifiers/intern/MOD_correctivesmooth.c
+ * \ingroup modifiers
+ *
+ * Method of smoothing deformation
+ */
+
#include "DNA_scene_types.h"
#include "DNA_meshdata_types.h"
#include "DNA_object_types.h"
@@ -186,7 +193,7 @@ static void smooth_iter__simple(
const MEdge *edges = dm->getEdgeArray(dm);
float *vertex_edge_count_div;
- struct SmoothingData {
+ struct SmoothingData_Simple {
float delta[3];
} *smooth_data = MEM_callocN((size_t)numVerts * sizeof(*smooth_data), __func__);
@@ -206,8 +213,8 @@ static void smooth_iter__simple(
while (iterations--) {
for (i = 0; i < numEdges; i++) {
- struct SmoothingData *sd_v1;
- struct SmoothingData *sd_v2;
+ struct SmoothingData_Simple *sd_v1;
+ struct SmoothingData_Simple *sd_v2;
float edge_dir[3];
float co1[3];
float co2[3];
@@ -227,7 +234,7 @@ static void smooth_iter__simple(
if (smooth_weights == NULL) {
/* fast-path */
for (i = 0; i < numVerts; i++) {
- struct SmoothingData *sd = &smooth_data[i];
+ struct SmoothingData_Simple *sd = &smooth_data[i];
mul_v3_v3fl(vertexCos[i], sd->delta, vertex_edge_count_div[i]);
/* zero for the next iteration (saves memset on entire array) */
memset(sd, 0, sizeof(*sd));
@@ -236,7 +243,7 @@ static void smooth_iter__simple(
else {
for (i = 0; i < numVerts; i++) {
- struct SmoothingData *sd = &smooth_data[i];
+ struct SmoothingData_Simple *sd = &smooth_data[i];
float lambda_w = lambda * smooth_weights[i];
mul_v3_fl(sd->delta, vertex_edge_count_div[i]);
@@ -253,7 +260,7 @@ static void smooth_iter__simple(
/* -------------------------------------------------------------------- */
-/* Simple Weighting
+/* Simple Weighted Smoothing
*
* (average of surrounding verts)
*/
@@ -271,9 +278,9 @@ static void smooth_iter__length_weight(
float *vertex_edge_count;
unsigned int i;
- struct SmoothingData {
+ struct SmoothingData_Weighted {
float delta[3];
- float edge_lengths;
+ float edge_length_sum;
} *smooth_data = MEM_callocN((size_t)numVerts * sizeof(*smooth_data), __func__);
@@ -290,8 +297,8 @@ static void smooth_iter__length_weight(
while (iterations--) {
for (i = 0; i < numEdges; i++) {
- struct SmoothingData *sd_v1;
- struct SmoothingData *sd_v2;
+ struct SmoothingData_Weighted *sd_v1;
+ struct SmoothingData_Weighted *sd_v2;
float edge_dir[3];
float edge_dist;
@@ -308,16 +315,16 @@ static void smooth_iter__length_weight(
add_v3_v3(sd_v1->delta, edge_dir);
sub_v3_v3(sd_v2->delta, edge_dir);
- sd_v1->edge_lengths += edge_dist;
- sd_v2->edge_lengths += edge_dist;
+ sd_v1->edge_length_sum += edge_dist;
+ sd_v2->edge_length_sum += edge_dist;
}
if (smooth_weights == NULL) {
/* fast-path */
for (i = 0; i < numVerts; i++) {
- struct SmoothingData *sd = &smooth_data[i];
+ struct SmoothingData_Weighted *sd = &smooth_data[i];
/* divide by sum of all neighbour distances (weighted) and amount of neighbours, (mean average) */
- const float div = sd->edge_lengths * vertex_edge_count[i];
+ const float div = sd->edge_length_sum * vertex_edge_count[i];
if (div > eps) {
#if 0
/* first calculate the new location */
@@ -335,8 +342,8 @@ static void smooth_iter__length_weight(
}
else {
for (i = 0; i < numVerts; i++) {
- struct SmoothingData *sd = &smooth_data[i];
- const float div = sd->edge_lengths * vertex_edge_count[i];
+ struct SmoothingData_Weighted *sd = &smooth_data[i];
+ const float div = sd->edge_length_sum * vertex_edge_count[i];
if (div > eps) {
const float lambda_w = lambda * smooth_weights[i];
madd_v3_v3fl(vertexCos[i], sd->delta, lambda_w / div);
diff --git a/source/blender/modifiers/intern/MOD_deltamush.c.asm b/source/blender/modifiers/intern/MOD_deltamush.c.asm
deleted file mode 100644
index db235e6..0000000
--- a/source/blender/modifiers/intern/MOD_deltamush.c.asm
+++ /dev/null
@@ -1,4639 +0,0 @@
- .file "MOD_deltamush.c"
- .section .text.unlikely,"ax", at progbits
-.LCOLDB1:
- .text
-.LHOTB1:
- .p2align 4,,15
- .type initData, @function
-initData:
-.LASANPC261:
-.LFB261:
- .cfi_startproc
- subq $24, %rsp
- .cfi_def_cfa_offset 32
- movq %fs:40, %rax
- movq %rax, 8(%rsp)
- xorl %eax, %eax
- leaq 190(%rdi), %rax
- movq %rax, %rdx
- shrq $3, %rdx
- movzbl 2147450880(%rdx), %edx
- testb %dl, %dl
- je .L2
- movq %rax, %rcx
- andl $7, %ecx
- addl $1, %ecx
- cmpb %dl, %cl
- jge .L42
-.L2:
- leaq 112(%rdi), %rax
- movl $8, %edx
- movw %dx, 190(%rdi)
- movq %rax, %rdx
- shrq $3, %rdx
- cmpb $0, 2147450880(%rdx)
- jne .L43
- leaq 192(%rdi), %rax
- movq $0, 112(%rdi)
- movq %rax, %rdx
- shrq $3, %rdx
- movzbl 2147450880(%rdx), %edx
- testb %dl, %dl
- je .L4
- movq %rax, %rcx
- andl $7, %ecx
- addl $3, %ecx
- cmpb %dl, %cl
- jge .L44
-.L4:
- leaq 200(%rdi), %rax
- movl $0, 192(%rdi)
- movq %rax, %rdx
- shrq $3, %rdx
- cmpb $0, 2147450880(%rdx)
- jne .L45
- leaq 120(%rdi), %rax
- movq $0, 200(%rdi)
- movq %rax, %rdx
- shrq $3, %rdx
- movzbl 2147450880(%rdx), %edx
- testb %dl, %dl
- je .L6
- movq %rax, %rcx
- andl $7, %ecx
- addl $3, %ecx
- cmpb %dl, %cl
- jge .L46
-.L6:
- leaq 188(%rdi), %rax
- movl $0x3f000000, 120(%rdi)
- movq %rax, %rdx
- shrq $3, %rdx
- movzbl 2147450880(%rdx), %edx
- testb %dl, %dl
- je .L7
- movq %rax, %rcx
- andl $7, %ecx
- addl $1, %ecx
- cmpb %dl, %cl
- jge .L47
-.L7:
- movl $5, %eax
- movw %ax, 188(%rdi)
- leaq 124(%rdi), %rax
- movq %rax, %rdx
- shrq $3, %rdx
- movzbl 2147450880(%rdx), %edx
- testb %dl, %dl
- je .L8
- movq %rax, %rcx
- andl $7, %ecx
- cmpb %cl, %dl
- jle .L48
-.L8:
- movq 8(%rsp), %rax
- xorq %fs:40, %rax
- movb $0, 124(%rdi)
- jne .L49
- addq $24, %rsp
- .cfi_remember_state
- .cfi_def_cfa_offset 8
- ret
-.L48:
- .cfi_restore_state
- movq %rax, %rdi
- call __asan_report_store1 at PLT
-.L47:
- movq %rax, %rdi
- call __asan_report_store2 at PLT
-.L46:
- movq %rax, %rdi
- call __asan_report_store4 at PLT
-.L44:
- movq %rax, %rdi
- call __asan_report_store4 at PLT
-.L42:
- movq %rax, %rdi
- call __asan_report_store2 at PLT
-.L49:
- call __stack_chk_fail at PLT
-.L45:
- movq %rax, %rdi
- call __asan_report_store8 at PLT
-.L43:
- movq %rax, %rdi
- call __asan_report_store8 at PLT
- .cfi_endproc
-.LFE261:
- .size initData, .-initData
- .section .text.unlikely
-.LCOLDE1:
- .text
-.LHOTE1:
- .section .text.unlikely
-.LCOLDB2:
- .text
-.LHOTB2:
- .p2align 4,,15
- .type requiredDataMask, @function
-requiredDataMask:
-.LASANPC265:
-.LFB265:
- .cfi_startproc
- leaq 124(%rsi), %rdi
- subq $24, %rsp
- .cfi_def_cfa_offset 32
- movq %fs:40, %rax
- movq %rax, 8(%rsp)
- xorl %eax, %eax
- movq %rdi, %rax
- shrq $3, %rax
- movzbl 2147450880(%rax), %eax
- testb %al, %al
- je .L51
- movq %rdi, %rdx
- andl $7, %edx
- cmpb %dl, %al
- jle .L62
-.L51:
- cmpb $1, 124(%rsi)
- sbbq %rax, %rax
- notq %rax
- andl $4, %eax
- movq 8(%rsp), %rcx
- xorq %fs:40, %rcx
- jne .L63
- addq $24, %rsp
- .cfi_remember_state
- .cfi_def_cfa_offset 8
- ret
-.L62:
- .cfi_restore_state
- call __asan_report_load1 at PLT
-.L63:
- call __stack_chk_fail at PLT
- .cfi_endproc
-.LFE265:
- .size requiredDataMask, .-requiredDataMask
- .section .text.unlikely
-.LCOLDE2:
- .text
-.LHOTE2:
- .section .text.unlikely
-.LCOLDB3:
- .text
-.LHOTB3:
- .p2align 4,,15
- .type copyData, @function
-copyData:
-.LASANPC262:
-.LFB262:
- .cfi_startproc
- pushq %rbp
- .cfi_def_cfa_offset 16
- .cfi_offset 6, -16
- pushq %rbx
- .cfi_def_cfa_offset 24
- .cfi_offset 3, -24
- movq %rdi, %rbx
- movq %rsi, %rbp
- subq $24, %rsp
- .cfi_def_cfa_offset 48
- movq %fs:40, %rax
- movq %rax, 8(%rsp)
- xorl %eax, %eax
- call modifier_copyData_generic at PLT
- leaq 112(%rbx), %rdi
- movq %rdi, %rax
- shrq $3, %rax
- cmpb $0, 2147450880(%rax)
- jne .L74
- movq 112(%rbx), %rdi
- testq %rdi, %rdi
- je .L64
- movq MEM_dupallocN at GOTPCREL(%rip), %rax
- movq %rax, %rdx
- shrq $3, %rdx
- cmpb $0, 2147450880(%rdx)
- jne .L75
- call *(%rax)
- leaq 112(%rbp), %rdi
- movq %rdi, %rdx
- shrq $3, %rdx
- cmpb $0, 2147450880(%rdx)
- jne .L76
- movq %rax, 112(%rbp)
-.L64:
- movq 8(%rsp), %rax
- xorq %fs:40, %rax
- jne .L77
- addq $24, %rsp
- .cfi_remember_state
- .cfi_def_cfa_offset 24
- popq %rbx
- .cfi_def_cfa_offset 16
- popq %rbp
- .cfi_def_cfa_offset 8
- ret
-.L77:
- .cfi_restore_state
- call __stack_chk_fail at PLT
-.L76:
- call __asan_report_store8 at PLT
-.L75:
- movq %rax, %rdi
- call __asan_report_load8 at PLT
-.L74:
- call __asan_report_load8 at PLT
- .cfi_endproc
-.LFE262:
- .size copyData, .-copyData
- .section .text.unlikely
-.LCOLDE3:
- .text
-.LHOTE3:
- .section .rodata
- .align 32
-.LC5:
- .string "delta mush boundary data"
- .zero 39
- .align 32
-.LC7:
- .string "delta mush smoothing data"
- .zero 38
- .align 32
-.LC9:
- .string "delta mush weight cache"
- .zero 40
- .section .text.unlikely
-.LCOLDB10:
- .text
-.LHOTB10:
- .p2align 4,,15
- .type smooth_verts, @function
-smooth_verts:
-.LASANPC269:
-.LFB269:
- .cfi_startproc
- pushq %r15
- .cfi_def_cfa_offset 16
- .cfi_offset 15, -16
- pushq %r14
- .cfi_def_cfa_offset 24
- .cfi_offset 14, -24
- pushq %r13
- .cfi_def_cfa_offset 32
- .cfi_offset 13, -32
- pushq %r12
- .cfi_def_cfa_offset 40
- .cfi_offset 12, -40
- movq %rdx, %r13
- pushq %rbp
- .cfi_def_cfa_offset 48
- .cfi_offset 6, -48
- pushq %rbx
- .cfi_def_cfa_offset 56
- .cfi_offset 3, -56
- movq %rsi, %r12
- movq %rdi, %rbx
- movq %r8, %rbp
- subq $120, %rsp
- .cfi_def_cfa_offset 176
- movq %fs:40, %rax
- movq %rax, 104(%rsp)
- xorl %eax, %eax
- testq %rdx, %rdx
- movl %ecx, 24(%rsp)
- movl %r9d, 52(%rsp)
- je .L553
- movq MEM_mallocN at GOTPCREL(%rip), %rax
- movq %rax, %rcx
- shrq $3, %rcx
- cmpb $0, 2147450880(%rcx)
- jne .L554
- movl 52(%rsp), %edi
- leaq .LC9(%rip), %rsi
- movq %rdi
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list