Cleanup: Simplify filling constant value per triangle in PBVH draw

This commit is contained in:
Hans Goudey
2023-10-06 18:33:03 +02:00
parent 57e914fc8a
commit 5052fe489c

View File

@@ -482,8 +482,7 @@ struct PBVHBatches {
face_no = convert_value<float3, short4>(args.face_normals[face_i]);
last_face = face_i;
}
*data = *(data + 1) = *(data + 2) = face_no;
std::fill(data, data + 3, face_no);
data += 3;
}
else {
@@ -742,7 +741,7 @@ struct PBVHBatches {
fset_color[0] = fset_color[1] = fset_color[2] = UCHAR_MAX;
}
}
*data = *(data + 1) = *(data + 2) = fset_color;
std::fill(data, data + 3, fset_color);
data += 3;
}
}
@@ -887,7 +886,7 @@ struct PBVHBatches {
data++;
}
else {
*data = *(data + 1) = *(data + 2) = convert_value<float3, short4>(f->no);
std::fill(data, data + 3, convert_value<float3, short4>(f->no));
data += 3;
}
}
@@ -928,8 +927,7 @@ struct PBVHBatches {
/* Skip for the default color face set to render it white. */
fset_color[0] = fset_color[1] = fset_color[2] = UCHAR_MAX;
}
*data = *(data + 1) = *(data + 2) = fset_color;
std::fill(data, data + 3, fset_color);
data += 3;
}
GSET_FOREACH_END();