[Bf-blender-cvs] [b77c10b45c3] master: Merge branch 'blender2.7'
Brecht Van Lommel
noreply at git.blender.org
Thu Apr 25 14:34:32 CEST 2019
Commit: b77c10b45c3f46320977e2c64116aca5ac979fdb
Author: Brecht Van Lommel
Date: Thu Apr 25 14:31:45 2019 +0200
Branches: master
https://developer.blender.org/rBb77c10b45c3f46320977e2c64116aca5ac979fdb
Merge branch 'blender2.7'
===================================================================
===================================================================
diff --cc intern/cycles/render/attribute.cpp
index dad6cb4fe6d,57c74067dbf..f1341d50b9d
--- a/intern/cycles/render/attribute.cpp
+++ b/intern/cycles/render/attribute.cpp
@@@ -223,40 -224,45 +223,43 @@@ size_t Attribute::buffer_size(Mesh *mes
bool Attribute::same_storage(TypeDesc a, TypeDesc b)
{
- if(a == b)
- return true;
+ if (a == b)
+ return true;
- if(a == TypeDesc::TypeColor || a == TypeDesc::TypePoint ||
- a == TypeDesc::TypeVector || a == TypeDesc::TypeNormal)
- {
- if(b == TypeDesc::TypeColor || b == TypeDesc::TypePoint ||
- b == TypeDesc::TypeVector || b == TypeDesc::TypeNormal)
- {
- return true;
- }
- }
- return false;
+ if (a == TypeDesc::TypeColor || a == TypeDesc::TypePoint || a == TypeDesc::TypeVector ||
+ a == TypeDesc::TypeNormal) {
+ if (b == TypeDesc::TypeColor || b == TypeDesc::TypePoint || b == TypeDesc::TypeVector ||
+ b == TypeDesc::TypeNormal) {
+ return true;
+ }
+ }
+ return false;
}
-void Attribute::zero_data(void* dst)
+void Attribute::zero_data(void *dst)
{
- memset(dst, 0, data_sizeof());
+ memset(dst, 0, data_sizeof());
}
-void Attribute::add_with_weight(void* dst, void* src, float weight)
+void Attribute::add_with_weight(void *dst, void *src, float weight)
{
- if(element == ATTR_ELEMENT_CORNER_BYTE) {
- for(int i = 0; i < 4; i++) {
- ((uchar*)dst)[i] += uchar(((uchar*)src)[i] * weight);
- }
- }
- else if(same_storage(type, TypeDesc::TypeFloat)) {
- *((float*)dst) += *((float*)src) * weight;
- }
- else if(same_storage(type, TypeFloat2)) {
- *((float2*)dst) += *((float2*)src) * weight;
- }
- else if(same_storage(type, TypeDesc::TypeVector)) {
- *((float4*)dst) += *((float4*)src) * weight;
- }
- else {
- assert(!"not implemented for this type");
- }
+ if (element == ATTR_ELEMENT_CORNER_BYTE) {
+ for (int i = 0; i < 4; i++) {
+ ((uchar *)dst)[i] += uchar(((uchar *)src)[i] * weight);
+ }
+ }
+ else if (same_storage(type, TypeDesc::TypeFloat)) {
+ *((float *)dst) += *((float *)src) * weight;
+ }
++ else if (same_storage(type, TypeFloat2)) {
++ *((float2 *)dst) += *((float2 *)src) * weight;
++ }
+ else if (same_storage(type, TypeDesc::TypeVector)) {
+ *((float4 *)dst) += *((float4 *)src) * weight;
+ }
+ else {
+ assert(!"not implemented for this type");
+ }
}
const char *Attribute::standard_name(AttributeStandard std)
More information about the Bf-blender-cvs
mailing list