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:
Diffstat (limited to 'intern/cycles/render/geometry.cpp')
-rw-r--r--intern/cycles/render/geometry.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/intern/cycles/render/geometry.cpp b/intern/cycles/render/geometry.cpp
index 30b19104ccf..b01b1fe5a77 100644
--- a/intern/cycles/render/geometry.cpp
+++ b/intern/cycles/render/geometry.cpp
@@ -788,6 +788,11 @@ void GeometryManager::device_update_attributes(Device *device,
foreach (AttributeRequest &req, attributes.requests) {
Attribute *attr = geom->attributes.find(req);
+ /* Vertex normals are stored in DeviceScene.tri_vnormal. */
+ if (attr && attr->std == ATTR_STD_VERTEX_NORMAL) {
+ continue;
+ }
+
update_attribute_element_size(geom,
attr,
ATTR_PRIM_GEOMETRY,
@@ -800,6 +805,11 @@ void GeometryManager::device_update_attributes(Device *device,
Mesh *mesh = static_cast<Mesh *>(geom);
Attribute *subd_attr = mesh->subd_attributes.find(req);
+ /* Vertex normals are stored in DeviceScene.tri_vnormal. */
+ if (subd_attr && subd_attr->std == ATTR_STD_VERTEX_NORMAL) {
+ continue;
+ }
+
update_attribute_element_size(mesh,
subd_attr,
ATTR_PRIM_SUBD,
@@ -854,6 +864,11 @@ void GeometryManager::device_update_attributes(Device *device,
Attribute *attr = geom->attributes.find(req);
if (attr) {
+ /* Vertex normals are stored in DeviceScene.tri_vnormal. */
+ if (attr->std == ATTR_STD_VERTEX_NORMAL) {
+ continue;
+ }
+
/* force a copy if we need to reallocate all the data */
attr->modified |= attributes_need_realloc[Attribute::kernel_type(*attr)];
}
@@ -877,6 +892,11 @@ void GeometryManager::device_update_attributes(Device *device,
Attribute *subd_attr = mesh->subd_attributes.find(req);
if (subd_attr) {
+ /* Vertex normals are stored in DeviceScene.tri_vnormal. */
+ if (subd_attr->std == ATTR_STD_VERTEX_NORMAL) {
+ continue;
+ }
+
/* force a copy if we need to reallocate all the data */
subd_attr->modified |= attributes_need_realloc[Attribute::kernel_type(*subd_attr)];
}