diff options
Diffstat (limited to 'intern')
-rw-r--r-- | intern/cycles/render/mesh.cpp | 22 | ||||
-rw-r--r-- | intern/cycles/render/mesh_subdivision.cpp | 18 | ||||
-rw-r--r-- | intern/cycles/subd/subd_dice.cpp | 2 | ||||
-rw-r--r-- | intern/cycles/subd/subd_patch_table.cpp | 4 | ||||
-rw-r--r-- | intern/cycles/subd/subd_patch_table.h | 2 |
5 files changed, 24 insertions, 24 deletions
diff --git a/intern/cycles/render/mesh.cpp b/intern/cycles/render/mesh.cpp index 257e83171e9..fcf4e69984d 100644 --- a/intern/cycles/render/mesh.cpp +++ b/intern/cycles/render/mesh.cpp @@ -298,17 +298,17 @@ int Mesh::split_vertex(int vertex) foreach(Attribute& attr, attributes.attributes) { if(attr.element == ATTR_ELEMENT_VERTEX) { - array<char> tmp(attr.data_sizeof()); - memcpy(tmp.data(), attr.data() + tmp.size()*vertex, tmp.size()); - attr.add(tmp.data()); + vector<char> tmp(attr.data_sizeof()); + memcpy(&tmp[0], attr.data() + tmp.size()*vertex, tmp.size()); + attr.add(&tmp[0]); } } foreach(Attribute& attr, subd_attributes.attributes) { if(attr.element == ATTR_ELEMENT_VERTEX) { - array<char> tmp(attr.data_sizeof()); - memcpy(tmp.data(), attr.data() + tmp.size()*vertex, tmp.size()); - attr.add(tmp.data()); + vector<char> tmp(attr.data_sizeof()); + memcpy(&tmp[0], attr.data() + tmp.size()*vertex, tmp.size()); + attr.add(&tmp[0]); } } @@ -474,7 +474,7 @@ void Mesh::add_face_normals() bool flip = transform_negative_scaled; if(triangles_size) { - float3 *verts_ptr = verts.data(); + float3 *verts_ptr = &verts[0]; for(size_t i = 0; i < triangles_size; i++) { fN[i] = compute_face_normal(get_triangle(i), verts_ptr); @@ -568,7 +568,7 @@ void Mesh::pack_normals(Scene *scene, uint *tri_shader, float4 *vnormal) bool last_smooth = false; size_t triangles_size = num_triangles(); - int *shader_ptr = shader.data(); + int *shader_ptr = (shader.size())? &shader[0]: NULL; bool do_transform = transform_applied; Transform ntfm = transform_normal; @@ -608,7 +608,7 @@ void Mesh::pack_verts(const vector<uint>& tri_prim_index, size_t verts_size = verts.size(); if(verts_size && subd_faces.size()) { - float2 *vert_patch_uv_ptr = vert_patch_uv.data(); + float2 *vert_patch_uv_ptr = &vert_patch_uv[0]; for(size_t i = 0; i < verts_size; i++) { tri_patch_uv[i] = vert_patch_uv_ptr[i]; @@ -636,8 +636,8 @@ void Mesh::pack_curves(Scene *scene, float4 *curve_key_co, float4 *curve_data, s /* pack curve keys */ if(curve_keys_size) { - float3 *keys_ptr = curve_keys.data(); - float *radius_ptr = curve_radius.data(); + float3 *keys_ptr = &curve_keys[0]; + float *radius_ptr = &curve_radius[0]; for(size_t i = 0; i < curve_keys_size; i++) curve_key_co[i] = make_float4(keys_ptr[i].x, keys_ptr[i].y, keys_ptr[i].z, radius_ptr[i]); diff --git a/intern/cycles/render/mesh_subdivision.cpp b/intern/cycles/render/mesh_subdivision.cpp index c9cc5df68a4..efb40efbb79 100644 --- a/intern/cycles/render/mesh_subdivision.cpp +++ b/intern/cycles/render/mesh_subdivision.cpp @@ -45,7 +45,7 @@ namespace Far { setNumBaseVertices(refiner, mesh.verts.size()); setNumBaseFaces(refiner, mesh.subd_faces.size()); - ccl::Mesh::SubdFace* face = mesh.subd_faces.data(); + ccl::Mesh::SubdFace* face = &mesh.subd_faces[0]; for(int i = 0; i < mesh.subd_faces.size(); i++, face++) { setNumBaseFaceVertices(refiner, i, face->num_corners); @@ -57,7 +57,7 @@ namespace Far { template<> bool TopologyRefinerFactory<ccl::Mesh>::assignComponentTopology(TopologyRefiner& refiner, ccl::Mesh const& mesh) { - ccl::Mesh::SubdFace* face = mesh.subd_faces.data() + ccl::Mesh::SubdFace* face = &mesh.subd_faces[0]; for(int i = 0; i < mesh.subd_faces.size(); i++, face++) { IndexArray face_verts = getBaseFaceVertices(refiner, i); @@ -195,14 +195,14 @@ public: verts[i].value = mesh->verts[i]; } - OsdValue<float3>* src = verts.data() + OsdValue<float3>* src = &verts[0]; for(int i = 0; i < refiner->GetMaxLevel(); i++) { OsdValue<float3>* dest = src + refiner->GetLevel(i).GetNumVertices(); Far::PrimvarRefiner(*refiner).Interpolate(i+1, src, dest); src = dest; } - patch_table->ComputeLocalPointValues(verts.data(), &verts[num_refiner_verts]); + patch_table->ComputeLocalPointValues(&verts[0], &verts[num_refiner_verts]); /* create patch map */ patch_map = new Far::PatchMap(*patch_table); @@ -219,7 +219,7 @@ public: attr.resize(num_refiner_verts + num_local_points); attr.flags |= ATTR_FINAL_SIZE; - char* src = attr.buffer.data(); + char* src = &attr.buffer[0]; for(int i = 0; i < refiner->GetMaxLevel(); i++) { char* dest = src + refiner->GetLevel(i).GetNumVertices() * attr.data_sizeof(); @@ -235,12 +235,12 @@ public: } if(attr.same_storage(attr.type, TypeDesc::TypeFloat)) { - patch_table->ComputeLocalPointValues((OsdValue<float>*)attr.buffer.data(), - (OsdValue<float>*)(attr.buffer.data() + num_refiner_verts * attr.data_sizeof())); + patch_table->ComputeLocalPointValues((OsdValue<float>*)&attr.buffer[0], + (OsdValue<float>*)&attr.buffer[num_refiner_verts * attr.data_sizeof()]); } else { - patch_table->ComputeLocalPointValues((OsdValue<float4>*)attr.buffer.data(), - (OsdValue<float4>*)(attr.buffer.data() + num_refiner_verts * attr.data_sizeof())); + patch_table->ComputeLocalPointValues((OsdValue<float4>*)&attr.buffer[0], + (OsdValue<float4>*)&attr.buffer[num_refiner_verts * attr.data_sizeof()]); } } else if(attr.element == ATTR_ELEMENT_CORNER || attr.element == ATTR_ELEMENT_CORNER_BYTE) { diff --git a/intern/cycles/subd/subd_dice.cpp b/intern/cycles/subd/subd_dice.cpp index a1bd349b167..36981a20f3c 100644 --- a/intern/cycles/subd/subd_dice.cpp +++ b/intern/cycles/subd/subd_dice.cpp @@ -57,7 +57,7 @@ void EdgeDice::reserve(int num_verts) Attribute *attr_vN = mesh->attributes.add(ATTR_STD_VERTEX_NORMAL); - mesh_P = mesh->verts.data(); + mesh_P = &mesh->verts[0]; mesh_N = attr_vN->data_float3(); } diff --git a/intern/cycles/subd/subd_patch_table.cpp b/intern/cycles/subd/subd_patch_table.cpp index 62572efa88a..68ec1b2c6a6 100644 --- a/intern/cycles/subd/subd_patch_table.cpp +++ b/intern/cycles/subd/subd_patch_table.cpp @@ -214,7 +214,7 @@ void PackedPatchTable::pack(Far::PatchTable* patch_table, int offset) } table.resize(total_size()); - uint* data = table.data(); + uint* data = &table[0]; uint* array = data; uint* index = array + num_arrays * PATCH_ARRAY_SIZE; @@ -259,7 +259,7 @@ void PackedPatchTable::pack(Far::PatchTable* patch_table, int offset) void PackedPatchTable::copy_adjusting_offsets(uint* dest, int doffset) { - uint* src = table.data(); + uint* src = &table[0]; /* arrays */ for(int i = 0; i < num_arrays; i++) { diff --git a/intern/cycles/subd/subd_patch_table.h b/intern/cycles/subd/subd_patch_table.h index 3166a1691d8..c8c7ecf9e47 100644 --- a/intern/cycles/subd/subd_patch_table.h +++ b/intern/cycles/subd/subd_patch_table.h @@ -43,7 +43,7 @@ namespace Far { struct PatchTable; } #define PATCH_NODE_SIZE 1 struct PackedPatchTable { - array<uint> table; + vector<uint> table; size_t num_arrays; size_t num_indices; |