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:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2020-02-03 23:40:58 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2020-02-07 14:18:15 +0300
commitd809853513c1333c9d9a22ab6ba35617b5ed2b8c (patch)
tree6c159a81df1f72c587a247ed31219705399a3788 /intern/cycles/render/mesh.cpp
parentd9c5f0d25fc91b069158ae1ab4fddc21bfd85846 (diff)
Cleanup: simplify Cycles primitive attribute map storage
Diffstat (limited to 'intern/cycles/render/mesh.cpp')
-rw-r--r--intern/cycles/render/mesh.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/intern/cycles/render/mesh.cpp b/intern/cycles/render/mesh.cpp
index 792848e744a..e80e87f2980 100644
--- a/intern/cycles/render/mesh.cpp
+++ b/intern/cycles/render/mesh.cpp
@@ -135,7 +135,7 @@ NODE_DEFINE(Mesh)
return type;
}
-Mesh::Mesh() : Geometry(node_type, Geometry::MESH)
+Mesh::Mesh() : Geometry(node_type, Geometry::MESH), subd_attributes(this, ATTR_PRIM_SUBD)
{
vert_offset = 0;
@@ -145,9 +145,6 @@ Mesh::Mesh() : Geometry(node_type, Geometry::MESH)
num_subd_verts = 0;
- attributes.triangle_mesh = this;
- subd_attributes.subd_mesh = this;
-
volume_isovalue = 0.001f;
num_ngons = 0;
@@ -329,7 +326,9 @@ void Mesh::get_uv_tiles(ustring map, unordered_set<int> &tiles)
}
if (attr) {
- attr->get_uv_tiles(this, ATTR_PRIM_TRIANGLE, tiles);
+ attr->get_uv_tiles(this, ATTR_PRIM_GEOMETRY, tiles);
+ }
+ if (subd_attr) {
subd_attr->get_uv_tiles(this, ATTR_PRIM_SUBD, tiles);
}
}
@@ -546,8 +545,7 @@ void Mesh::add_undisplaced()
float3 *data = attr->data_float3();
/* copy verts */
- size_t size = attr->buffer_size(
- this, (subdivision_type == SUBDIVISION_NONE) ? ATTR_PRIM_TRIANGLE : ATTR_PRIM_SUBD);
+ size_t size = attr->buffer_size(this, attrs.prim);
/* Center points for ngons aren't stored in Mesh::verts but are included in size since they will
* be calculated later, we subtract them from size here so we don't have an overflow while