head 1.1; access; symbols pkgsrc-2026Q1:1.1.0.4 pkgsrc-2026Q1-base:1.1 pkgsrc-2025Q4:1.1.0.2 pkgsrc-2025Q4-base:1.1; locks; strict; comment @# @; 1.1 date 2025.09.29.02.35.56; author mrg; state Exp; branches; next ; commitid YQ4SHyOnGN8LpycG; desc @@ 1.1 log @update to blender 4.2.14 from 4.2.4. changes include: - fix many crashes and features (more than 100 issues upstream) - a few UI cleanups - various build fixes - hardware raytracing - fix possible buffer overflow in jpeg writer also add upstream change 4f4c3f73b697436922464e087823f53e8681d7e8 which fixes the build with new openimageio. (note upstream has a 4.5 LTS version out for a while now, but this was easy to update to.) @ text @From 4f4c3f73b697436922464e087823f53e8681d7e8 Mon Sep 17 00:00:00 2001 From: Jesse Yurkovich Date: Thu, 17 Oct 2024 19:48:38 +0200 Subject: [PATCH] Cleanup: Replace deprecated OIIO APIs with modern ones Noticed while helping validate the soon to be released OpenImageIO 3.x. This cleanup makes 2 sets of changes to accommodate removed APIs [1]: - Remove `ustringHash` since it's been defined as `std::hash` for quite some time and is fully removed in 3.0. - Replace `TypeDesc::Type*` types with just `Type*` as the former has been removed in 3.0. Cycles was using a mix of the deprecated and modern forms anyhow. [1] https://github.com/AcademySoftwareFoundation/OpenImageIO/blob/main/docs/Deprecations-3.0.md Pull Request: https://projects.blender.org/blender/blender/pulls/129136 --- intern/cycles/blender/mesh.cpp | 4 +- intern/cycles/blender/object.cpp | 2 +- intern/cycles/blender/volume.cpp | 2 +- intern/cycles/graph/node_enum.h | 6 +- intern/cycles/graph/node_type.cpp | 6 +- intern/cycles/graph/node_type.h | 2 +- intern/cycles/hydra/volume.cpp | 3 +- intern/cycles/kernel/osl/closures.cpp | 2 +- intern/cycles/kernel/osl/services.cpp | 26 ++---- intern/cycles/scene/attribute.cpp | 99 ++++++++++----------- intern/cycles/scene/colorspace.cpp | 4 +- intern/cycles/scene/geometry_attributes.cpp | 12 +-- intern/cycles/scene/mesh_subdivision.cpp | 4 +- intern/cycles/scene/object.cpp | 4 +- intern/cycles/scene/osl.cpp | 60 ++++++------- intern/cycles/scene/shader.cpp | 2 +- intern/cycles/scene/shader.h | 2 +- intern/cycles/scene/stats.h | 2 +- 18 files changed, 114 insertions(+), 128 deletions(-) diff --git intern/cycles/blender/mesh.cpp intern/cycles/blender/mesh.cpp index db00f353e1dd..49e391440e81 100644 --- intern/cycles/blender/mesh.cpp +++ intern/cycles/blender/mesh.cpp @@@@ -201,7 +201,7 @@@@ static void mikk_compute_tangents( attr = attributes.add(ATTR_STD_UV_TANGENT, name); } else { - attr = attributes.add(name, TypeDesc::TypeVector, ATTR_ELEMENT_CORNER); + attr = attributes.add(name, TypeVector, ATTR_ELEMENT_CORNER); } float3 *tangent = attr->data_float3(); /* Create bitangent sign attribute. */ @@@@ -220,7 +220,7 @@@@ static void mikk_compute_tangents( attr_sign = attributes.add(ATTR_STD_UV_TANGENT_SIGN, name_sign); } else { - attr_sign = attributes.add(name_sign, TypeDesc::TypeFloat, ATTR_ELEMENT_CORNER); + attr_sign = attributes.add(name_sign, TypeFloat, ATTR_ELEMENT_CORNER); } tangent_sign = attr_sign->data_float(); } diff --git intern/cycles/blender/object.cpp intern/cycles/blender/object.cpp index 54d88477bc8e..0e17a595e1ca 100644 --- intern/cycles/blender/object.cpp +++ intern/cycles/blender/object.cpp @@@@ -443,7 +443,7 @@@@ bool BlenderSync::sync_object_attributes(BL::DepsgraphObjectInstance &b_instance } /* Replace or add the value. */ - ParamValue new_param(name, TypeDesc::TypeFloat4, 1, &value); + ParamValue new_param(name, TypeFloat4, 1, &value); assert(new_param.datasize() == sizeof(value)); if (!param) { diff --git intern/cycles/blender/volume.cpp intern/cycles/blender/volume.cpp index 7d0455efa72a..db9fc826fb9d 100644 --- intern/cycles/blender/volume.cpp +++ intern/cycles/blender/volume.cpp @@@@ -339,7 +339,7 @@@@ static void sync_volume_object(BL::BlendData &b_data, { Attribute *attr = (std != ATTR_STD_NONE) ? volume->attributes.add(std) : - volume->attributes.add(name, TypeDesc::TypeFloat, ATTR_ELEMENT_VOXEL); + volume->attributes.add(name, TypeFloat, ATTR_ELEMENT_VOXEL); ImageLoader *loader = new BlenderVolumeLoader( b_data, b_volume, name.string(), b_render.precision()); diff --git intern/cycles/graph/node_enum.h intern/cycles/graph/node_enum.h index c18c4c2dc0eb..d003437a2081 100644 --- intern/cycles/graph/node_enum.h +++ intern/cycles/graph/node_enum.h @@@@ -48,17 +48,17 @@@@ struct NodeEnum { return right.find(y)->second; } - unordered_map::const_iterator begin() const + unordered_map::const_iterator begin() const { return left.begin(); } - unordered_map::const_iterator end() const + unordered_map::const_iterator end() const { return left.end(); } private: - unordered_map left; + unordered_map left; unordered_map right; }; diff --git intern/cycles/graph/node_type.cpp intern/cycles/graph/node_type.cpp index 3162e4d75fcf..368c6a2eab1c 100644 --- intern/cycles/graph/node_type.cpp +++ intern/cycles/graph/node_type.cpp @@@@ -203,9 +203,9 @@@@ const SocketType *NodeType::find_output(ustring name) const /* Node Type Registry */ -unordered_map &NodeType::types() +unordered_map &NodeType::types() { - static unordered_map _types; + static unordered_map _types; return _types; } @@@@ -229,7 +229,7 @@@@ NodeType *NodeType::add(const char *name_, CreateFunc create_, Type type_, const const NodeType *NodeType::find(ustring name) { - unordered_map::iterator it = types().find(name); + unordered_map::iterator it = types().find(name); return (it == types().end()) ? NULL : &it->second; } diff --git intern/cycles/graph/node_type.h intern/cycles/graph/node_type.h index 7a5f9376e6a6..39a21aeaeeb1 100644 --- intern/cycles/graph/node_type.h +++ intern/cycles/graph/node_type.h @@@@ -131,7 +131,7 @@@@ struct NodeType { Type type = NONE, const NodeType *base = NULL); static const NodeType *find(ustring name); - static unordered_map &types(); + static unordered_map &types(); }; /* Node Definition Macros diff --git intern/cycles/hydra/volume.cpp intern/cycles/hydra/volume.cpp index 623e9ebc7c08..0cac0dc21d40 100644 --- intern/cycles/hydra/volume.cpp +++ intern/cycles/hydra/volume.cpp @@@@ -78,8 +78,7 @@@@ void HdCyclesVolume::Populate(HdSceneDelegate *sceneDelegate, HdDirtyBits dirtyB { Attribute *const attr = (std != ATTR_STD_NONE) ? _geom->attributes.add(std) : - _geom->attributes.add( - name, TypeDesc::TypeFloat, ATTR_ELEMENT_VOXEL); + _geom->attributes.add(name, TypeFloat, ATTR_ELEMENT_VOXEL); attr->data_voxel() = openvdbAsset->GetImageHandle(); } } diff --git intern/cycles/kernel/osl/closures.cpp intern/cycles/kernel/osl/closures.cpp index 4a5906873af1..87b4ee1744a2 100644 --- intern/cycles/kernel/osl/closures.cpp +++ intern/cycles/kernel/osl/closures.cpp @@@@ -138,7 +138,7 @@@@ void osl_eval_nodes(const KernelGlobalsCPU *kg, bool found = kg->osl->services->get_attribute(sd, true, OSLRenderServices::u_empty, - TypeDesc::TypeVector, + TypeVector, OSLRenderServices::u_geom_undisplaced, data); (void)found; diff --git intern/cycles/kernel/osl/services.cpp intern/cycles/kernel/osl/services.cpp index 3fa7e9189611..d0044a7ac5b9 100644 --- intern/cycles/kernel/osl/services.cpp +++ intern/cycles/kernel/osl/services.cpp @@@@ -434,9 +434,7 @@@@ static bool set_attribute_float2(float2 f[3], TypeDesc type, bool derivatives, v } return true; } - else if (type == TypeDesc::TypePoint || type == TypeDesc::TypeVector || - type == TypeDesc::TypeNormal || type == TypeDesc::TypeColor) - { + else if (type == TypePoint || type == TypeVector || type == TypeNormal || type == TypeColor) { float *fval = (float *)val; fval[0] = f[0].x; @@@@ -455,7 +453,7 @@@@ static bool set_attribute_float2(float2 f[3], TypeDesc type, bool derivatives, v return true; } - else if (type == TypeDesc::TypeFloat) { + else if (type == TypeFloat) { float *fval = (float *)val; fval[0] = average(f[0]); @@@@ -505,9 +503,7 @@@@ static bool set_attribute_float3(float3 f[3], TypeDesc type, bool derivatives, v } return true; } - else if (type == TypeDesc::TypePoint || type == TypeDesc::TypeVector || - type == TypeDesc::TypeNormal || type == TypeDesc::TypeColor) - { + else if (type == TypePoint || type == TypeVector || type == TypeNormal || type == TypeColor) { float *fval = (float *)val; fval[0] = f[0].x; @@@@ -526,7 +522,7 @@@@ static bool set_attribute_float3(float3 f[3], TypeDesc type, bool derivatives, v return true; } - else if (type == TypeDesc::TypeFloat) { + else if (type == TypeFloat) { float *fval = (float *)val; fval[0] = average(f[0]); @@@@ -582,9 +578,7 @@@@ static bool set_attribute_float4(float4 f[3], TypeDesc type, bool derivatives, v } return true; } - else if (type == TypeDesc::TypePoint || type == TypeDesc::TypeVector || - type == TypeDesc::TypeNormal || type == TypeDesc::TypeColor) - { + else if (type == TypePoint || type == TypeVector || type == TypeNormal || type == TypeColor) { fval[0] = f[0].x; fval[1] = f[0].y; fval[2] = f[0].z; @@@@ -600,7 +594,7 @@@@ static bool set_attribute_float4(float4 f[3], TypeDesc type, bool derivatives, v } return true; } - else if (type == TypeDesc::TypeFloat) { + else if (type == TypeFloat) { fval[0] = average(float4_to_float3(f[0])); if (derivatives) { @@@@ -647,9 +641,7 @@@@ static bool set_attribute_float(float f[3], TypeDesc type, bool derivatives, voi } return true; } - else if (type == TypeDesc::TypePoint || type == TypeDesc::TypeVector || - type == TypeDesc::TypeNormal || type == TypeDesc::TypeColor) - { + else if (type == TypePoint || type == TypeVector || type == TypeNormal || type == TypeColor) { float *fval = (float *)val; fval[0] = f[0]; fval[1] = f[0]; @@@@ -667,7 +659,7 @@@@ static bool set_attribute_float(float f[3], TypeDesc type, bool derivatives, voi return true; } - else if (type == TypeDesc::TypeFloat) { + else if (type == TypeFloat) { float *fval = (float *)val; fval[0] = f[0]; @@@@ -761,7 +753,7 @@@@ static bool set_attribute_float3_3(float3 P[3], TypeDesc type, bool derivatives, static bool set_attribute_matrix(const Transform &tfm, TypeDesc type, void *val) { - if (type == TypeDesc::TypeMatrix) { + if (type == TypeMatrix) { copy_matrix(*(OSL::Matrix44 *)val, tfm); return true; } diff --git intern/cycles/scene/attribute.cpp intern/cycles/scene/attribute.cpp index 0a082f8e9d4b..aa4607f12af9 100644 --- intern/cycles/scene/attribute.cpp +++ intern/cycles/scene/attribute.cpp @@@@ -21,10 +21,9 @@@@ Attribute::Attribute( : name(name), std(ATTR_STD_NONE), type(type), element(element), flags(0), modified(true) { /* string and matrix not supported! */ - assert(type == TypeDesc::TypeFloat || type == TypeDesc::TypeColor || - type == TypeDesc::TypePoint || type == TypeDesc::TypeVector || - type == TypeDesc::TypeNormal || type == TypeDesc::TypeMatrix || type == TypeFloat2 || - type == TypeFloat4 || type == TypeRGBA); + assert(type == TypeFloat || type == TypeColor || type == TypePoint || type == TypeVector || + type == TypeNormal || type == TypeMatrix || type == TypeFloat2 || type == TypeFloat4 || + type == TypeRGBA); if (element == ATTR_ELEMENT_VOXEL) { buffer.resize(sizeof(ImageHandle)); @@@@ -170,18 +169,18 @@@@ size_t Attribute::data_sizeof() const else if (element == ATTR_ELEMENT_CORNER_BYTE) { return sizeof(uchar4); } - else if (type == TypeDesc::TypeFloat) { + else if (type == TypeFloat) { return sizeof(float); } else if (type == TypeFloat2) { return sizeof(float2); } - else if (type == TypeDesc::TypeMatrix) { + else if (type == TypeMatrix) { return sizeof(Transform); // The float3 type is not interchangeable with float4 // as it is now a packed type. } - else if (type == TypeDesc::TypeFloat4) { + else if (type == TypeFloat4) { return sizeof(float4); } else if (type == TypeRGBA) { @@@@ -293,12 +292,8 @@@@ bool Attribute::same_storage(TypeDesc a, TypeDesc 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) - { + if (a == TypeColor || a == TypePoint || a == TypeVector || a == TypeNormal) { + if (b == TypeColor || b == TypePoint || b == TypeVector || b == TypeNormal) { return true; } } @@@@ -317,13 +312,13 @@@@ void Attribute::add_with_weight(void *dst, void *src, float weight) ((uchar *)dst)[i] += uchar(((uchar *)src)[i] * weight); } } - else if (same_storage(type, TypeDesc::TypeFloat)) { + else if (same_storage(type, TypeFloat)) { *((float *)dst) += *((float *)src) * weight; } else if (same_storage(type, TypeFloat2)) { *((float2 *)dst) += *((float2 *)src) * weight; } - else if (same_storage(type, TypeDesc::TypeVector)) { + else if (same_storage(type, TypeVector)) { // Points are float3s and not float4s *((float3 *)dst) += *((float3 *)src) * weight; } @@@@ -425,7 +420,7 @@@@ AttrKernelDataType Attribute::kernel_type(const Attribute &attr) return AttrKernelDataType::UCHAR4; } - if (attr.type == TypeDesc::TypeFloat) { + if (attr.type == TypeFloat) { return AttrKernelDataType::FLOAT; } @@@@ -433,7 +428,7 @@@@ AttrKernelDataType Attribute::kernel_type(const Attribute &attr) return AttrKernelDataType::FLOAT2; } - if (attr.type == TypeFloat4 || attr.type == TypeRGBA || attr.type == TypeDesc::TypeMatrix) { + if (attr.type == TypeFloat4 || attr.type == TypeRGBA || attr.type == TypeMatrix) { return AttrKernelDataType::FLOAT4; } @@@@ -537,19 +532,19 @@@@ Attribute *AttributeSet::add(AttributeStandard std, ustring name) if (geometry->geometry_type == Geometry::MESH) { switch (std) { case ATTR_STD_VERTEX_NORMAL: - attr = add(name, TypeDesc::TypeNormal, ATTR_ELEMENT_VERTEX); + attr = add(name, TypeNormal, ATTR_ELEMENT_VERTEX); break; case ATTR_STD_FACE_NORMAL: - attr = add(name, TypeDesc::TypeNormal, ATTR_ELEMENT_FACE); + attr = add(name, TypeNormal, ATTR_ELEMENT_FACE); break; case ATTR_STD_UV: attr = add(name, TypeFloat2, ATTR_ELEMENT_CORNER); break; case ATTR_STD_UV_TANGENT: - attr = add(name, TypeDesc::TypeVector, ATTR_ELEMENT_CORNER); + attr = add(name, TypeVector, ATTR_ELEMENT_CORNER); break; case ATTR_STD_UV_TANGENT_SIGN: - attr = add(name, TypeDesc::TypeFloat, ATTR_ELEMENT_CORNER); + attr = add(name, TypeFloat, ATTR_ELEMENT_CORNER); break; case ATTR_STD_VERTEX_COLOR: attr = add(name, TypeRGBA, ATTR_ELEMENT_CORNER_BYTE); @@@@ -557,28 +552,28 @@@@ Attribute *AttributeSet::add(AttributeStandard std, ustring name) case ATTR_STD_GENERATED: case ATTR_STD_POSITION_UNDEFORMED: case ATTR_STD_POSITION_UNDISPLACED: - attr = add(name, TypeDesc::TypePoint, ATTR_ELEMENT_VERTEX); + attr = add(name, TypePoint, ATTR_ELEMENT_VERTEX); break; case ATTR_STD_MOTION_VERTEX_POSITION: - attr = add(name, TypeDesc::TypePoint, ATTR_ELEMENT_VERTEX_MOTION); + attr = add(name, TypePoint, ATTR_ELEMENT_VERTEX_MOTION); break; case ATTR_STD_MOTION_VERTEX_NORMAL: - attr = add(name, TypeDesc::TypeNormal, ATTR_ELEMENT_VERTEX_MOTION); + attr = add(name, TypeNormal, ATTR_ELEMENT_VERTEX_MOTION); break; case ATTR_STD_PTEX_FACE_ID: - attr = add(name, TypeDesc::TypeFloat, ATTR_ELEMENT_FACE); + attr = add(name, TypeFloat, ATTR_ELEMENT_FACE); break; case ATTR_STD_PTEX_UV: - attr = add(name, TypeDesc::TypePoint, ATTR_ELEMENT_VERTEX); + attr = add(name, TypePoint, ATTR_ELEMENT_VERTEX); break; case ATTR_STD_GENERATED_TRANSFORM: - attr = add(name, TypeDesc::TypeMatrix, ATTR_ELEMENT_MESH); + attr = add(name, TypeMatrix, ATTR_ELEMENT_MESH); break; case ATTR_STD_POINTINESS: - attr = add(name, TypeDesc::TypeFloat, ATTR_ELEMENT_VERTEX); + attr = add(name, TypeFloat, ATTR_ELEMENT_VERTEX); break; case ATTR_STD_RANDOM_PER_ISLAND: - attr = add(name, TypeDesc::TypeFloat, ATTR_ELEMENT_FACE); + attr = add(name, TypeFloat, ATTR_ELEMENT_FACE); break; default: assert(0); @@@@ -591,16 +586,16 @@@@ Attribute *AttributeSet::add(AttributeStandard std, ustring name) attr = add(name, TypeFloat2, ATTR_ELEMENT_VERTEX); break; case ATTR_STD_GENERATED: - attr = add(name, TypeDesc::TypePoint, ATTR_ELEMENT_VERTEX); + attr = add(name, TypePoint, ATTR_ELEMENT_VERTEX); break; case ATTR_STD_MOTION_VERTEX_POSITION: - attr = add(name, TypeDesc::TypeFloat4, ATTR_ELEMENT_VERTEX_MOTION); + attr = add(name, TypeFloat4, ATTR_ELEMENT_VERTEX_MOTION); break; case ATTR_STD_POINT_RANDOM: - attr = add(name, TypeDesc::TypeFloat, ATTR_ELEMENT_VERTEX); + attr = add(name, TypeFloat, ATTR_ELEMENT_VERTEX); break; case ATTR_STD_GENERATED_TRANSFORM: - attr = add(name, TypeDesc::TypeMatrix, ATTR_ELEMENT_MESH); + attr = add(name, TypeMatrix, ATTR_ELEMENT_MESH); break; default: assert(0); @@@@ -610,10 +605,10 @@@@ Attribute *AttributeSet::add(AttributeStandard std, ustring name) else if (geometry->geometry_type == Geometry::VOLUME) { switch (std) { case ATTR_STD_VERTEX_NORMAL: - attr = add(name, TypeDesc::TypeNormal, ATTR_ELEMENT_VERTEX); + attr = add(name, TypeNormal, ATTR_ELEMENT_VERTEX); break; case ATTR_STD_FACE_NORMAL: - attr = add(name, TypeDesc::TypeNormal, ATTR_ELEMENT_FACE); + attr = add(name, TypeNormal, ATTR_ELEMENT_FACE); break; case ATTR_STD_VOLUME_DENSITY: case ATTR_STD_VOLUME_FLAME: @@@@ -622,13 +617,13 @@@@ Attribute *AttributeSet::add(AttributeStandard std, ustring name) case ATTR_STD_VOLUME_VELOCITY_X: case ATTR_STD_VOLUME_VELOCITY_Y: case ATTR_STD_VOLUME_VELOCITY_Z: - attr = add(name, TypeDesc::TypeFloat, ATTR_ELEMENT_VOXEL); + attr = add(name, TypeFloat, ATTR_ELEMENT_VOXEL); break; case ATTR_STD_VOLUME_COLOR: - attr = add(name, TypeDesc::TypeColor, ATTR_ELEMENT_VOXEL); + attr = add(name, TypeColor, ATTR_ELEMENT_VOXEL); break; case ATTR_STD_VOLUME_VELOCITY: - attr = add(name, TypeDesc::TypeVector, ATTR_ELEMENT_VOXEL); + attr = add(name, TypeVector, ATTR_ELEMENT_VOXEL); break; default: assert(0); @@@@ -638,37 +633,37 @@@@ Attribute *AttributeSet::add(AttributeStandard std, ustring name) else if (geometry->geometry_type == Geometry::HAIR) { switch (std) { case ATTR_STD_VERTEX_NORMAL: - attr = add(name, TypeDesc::TypeNormal, ATTR_ELEMENT_CURVE_KEY); + attr = add(name, TypeNormal, ATTR_ELEMENT_CURVE_KEY); break; case ATTR_STD_UV: attr = add(name, TypeFloat2, ATTR_ELEMENT_CURVE); break; case ATTR_STD_GENERATED: - attr = add(name, TypeDesc::TypePoint, ATTR_ELEMENT_CURVE); + attr = add(name, TypePoint, ATTR_ELEMENT_CURVE); break; case ATTR_STD_MOTION_VERTEX_POSITION: - attr = add(name, TypeDesc::TypeFloat4, ATTR_ELEMENT_CURVE_KEY_MOTION); + attr = add(name, TypeFloat4, ATTR_ELEMENT_CURVE_KEY_MOTION); break; case ATTR_STD_CURVE_INTERCEPT: - attr = add(name, TypeDesc::TypeFloat, ATTR_ELEMENT_CURVE_KEY); + attr = add(name, TypeFloat, ATTR_ELEMENT_CURVE_KEY); break; case ATTR_STD_CURVE_LENGTH: - attr = add(name, TypeDesc::TypeFloat, ATTR_ELEMENT_CURVE); + attr = add(name, TypeFloat, ATTR_ELEMENT_CURVE); break; case ATTR_STD_CURVE_RANDOM: - attr = add(name, TypeDesc::TypeFloat, ATTR_ELEMENT_CURVE); + attr = add(name, TypeFloat, ATTR_ELEMENT_CURVE); break; case ATTR_STD_GENERATED_TRANSFORM: - attr = add(name, TypeDesc::TypeMatrix, ATTR_ELEMENT_MESH); + attr = add(name, TypeMatrix, ATTR_ELEMENT_MESH); break; case ATTR_STD_POINTINESS: - attr = add(name, TypeDesc::TypeFloat, ATTR_ELEMENT_VERTEX); + attr = add(name, TypeFloat, ATTR_ELEMENT_VERTEX); break; case ATTR_STD_RANDOM_PER_ISLAND: - attr = add(name, TypeDesc::TypeFloat, ATTR_ELEMENT_FACE); + attr = add(name, TypeFloat, ATTR_ELEMENT_FACE); break; case ATTR_STD_SHADOW_TRANSPARENCY: - attr = add(name, TypeDesc::TypeFloat, ATTR_ELEMENT_CURVE_KEY); + attr = add(name, TypeFloat, ATTR_ELEMENT_CURVE_KEY); break; default: assert(0); @@@@ -838,12 +833,12 @@@@ AttributeRequest::AttributeRequest(ustring name_) name = name_; std = ATTR_STD_NONE; - type = TypeDesc::TypeFloat; + type = TypeFloat; desc.element = ATTR_ELEMENT_NONE; desc.offset = 0; desc.type = NODE_ATTR_FLOAT; - subd_type = TypeDesc::TypeFloat; + subd_type = TypeFloat; subd_desc.element = ATTR_ELEMENT_NONE; subd_desc.offset = 0; subd_desc.type = NODE_ATTR_FLOAT; @@@@ -854,12 +849,12 @@@@ AttributeRequest::AttributeRequest(AttributeStandard std_) name = ustring(); std = std_; - type = TypeDesc::TypeFloat; + type = TypeFloat; desc.element = ATTR_ELEMENT_NONE; desc.offset = 0; desc.type = NODE_ATTR_FLOAT; - subd_type = TypeDesc::TypeFloat; + subd_type = TypeFloat; subd_desc.element = ATTR_ELEMENT_NONE; subd_desc.offset = 0; subd_desc.type = NODE_ATTR_FLOAT; diff --git intern/cycles/scene/colorspace.cpp intern/cycles/scene/colorspace.cpp index 03053d9f1920..75c29e1fefde 100644 --- intern/cycles/scene/colorspace.cpp +++ intern/cycles/scene/colorspace.cpp @@@@ -28,8 +28,8 @@@@ ustring u_colorspace_srgb("__builtin_srgb"); #ifdef WITH_OCIO static thread_mutex cache_colorspaces_mutex; static thread_mutex cache_processors_mutex; -static unordered_map cached_colorspaces; -static unordered_map cached_processors; +static unordered_map cached_colorspaces; +static unordered_map cached_processors; #endif ColorSpaceProcessor *ColorSpaceManager::get_processor(ustring colorspace) diff --git intern/cycles/scene/geometry_attributes.cpp intern/cycles/scene/geometry_attributes.cpp index dccf0637853d..d92169d349d1 100644 --- intern/cycles/scene/geometry_attributes.cpp +++ intern/cycles/scene/geometry_attributes.cpp @@@@ -103,10 +103,10 @@@@ static void emit_attribute_map_entry(AttributeMap *attr_map, attr_map[index].element = desc.element; attr_map[index].offset = as_uint(desc.offset); - if (type == TypeDesc::TypeFloat) { + if (type == TypeFloat) { attr_map[index].type = NODE_ATTR_FLOAT; } - else if (type == TypeDesc::TypeMatrix) { + else if (type == TypeMatrix) { attr_map[index].type = NODE_ATTR_MATRIX; } else if (type == TypeFloat2) { @@@@ -319,7 +319,7 @@@@ void GeometryManager::update_attribute_element_offset(Geometry *geom, } attr_uchar4_offset += size; } - else if (mattr->type == TypeDesc::TypeFloat) { + else if (mattr->type == TypeFloat) { float *data = mattr->data_float(); offset = attr_float_offset; @@@@ -345,7 +345,7 @@@@ void GeometryManager::update_attribute_element_offset(Geometry *geom, } attr_float2_offset += size; } - else if (mattr->type == TypeDesc::TypeMatrix) { + else if (mattr->type == TypeMatrix) { Transform *tfm = mattr->data_transform(); offset = attr_float4_offset; @@@@ -464,13 +464,13 @@@@ static void update_attribute_element_size(Geometry *geom, else if (mattr->element == ATTR_ELEMENT_CORNER_BYTE) { *attr_uchar4_size += size; } - else if (mattr->type == TypeDesc::TypeFloat) { + else if (mattr->type == TypeFloat) { *attr_float_size += size; } else if (mattr->type == TypeFloat2) { *attr_float2_size += size; } - else if (mattr->type == TypeDesc::TypeMatrix) { + else if (mattr->type == TypeMatrix) { *attr_float4_size += size * 4; } else if (mattr->type == TypeFloat4 || mattr->type == TypeRGBA) { diff --git intern/cycles/scene/mesh_subdivision.cpp intern/cycles/scene/mesh_subdivision.cpp index d7833bec140a..7f08a9ca69b4 100644 --- intern/cycles/scene/mesh_subdivision.cpp +++ intern/cycles/scene/mesh_subdivision.cpp @@@@ -254,7 +254,7 @@@@ class OsdData { for (int i = 0; i < refiner->GetMaxLevel(); i++) { char *dest = src + refiner->GetLevel(i).GetNumVertices() * attr.data_sizeof(); - if (attr.same_storage(attr.type, TypeDesc::TypeFloat)) { + if (attr.same_storage(attr.type, TypeFloat)) { primvar_refiner.Interpolate(i + 1, (OsdValue *)src, (OsdValue *&)dest); } else if (attr.same_storage(attr.type, TypeFloat2)) { @@@@ -273,7 +273,7 @@@@ class OsdData { } if (num_local_points) { - if (attr.same_storage(attr.type, TypeDesc::TypeFloat)) { + if (attr.same_storage(attr.type, TypeFloat)) { patch_table->ComputeLocalPointValues( (OsdValue *)&attr.buffer[0], (OsdValue *)&attr.buffer[num_refiner_verts * attr.data_sizeof()]); diff --git intern/cycles/scene/object.cpp intern/cycles/scene/object.cpp index ac5266f47c22..77fa7010e2c7 100644 --- intern/cycles/scene/object.cpp +++ intern/cycles/scene/object.cpp @@@@ -1117,7 +1117,7 @@@@ string ObjectManager::get_cryptomatte_objects(Scene *scene) { string manifest = "{"; - unordered_set objects; + unordered_set objects; foreach (Object *object, scene->objects) { if (objects.count(object->name)) { continue; @@@@ -1133,7 +1133,7 @@@@ string ObjectManager::get_cryptomatte_objects(Scene *scene) string ObjectManager::get_cryptomatte_assets(Scene *scene) { string manifest = "{"; - unordered_set assets; + unordered_set assets; foreach (Object *ob, scene->objects) { if (assets.count(ob->asset_name)) { continue; diff --git intern/cycles/scene/osl.cpp intern/cycles/scene/osl.cpp index 01aac1508adc..3e63111f8d85 100644 --- intern/cycles/scene/osl.cpp +++ intern/cycles/scene/osl.cpp @@@@ -914,37 +914,37 @@@@ void OSLCompiler::parameter(ShaderNode *node, const char *name) switch (socket.type) { case SocketType::BOOLEAN: { int value = node->get_bool(socket); - ss->Parameter(name, TypeDesc::TypeInt, &value); + ss->Parameter(name, TypeInt, &value); break; } case SocketType::FLOAT: { float value = node->get_float(socket); - ss->Parameter(uname, TypeDesc::TypeFloat, &value); + ss->Parameter(uname, TypeFloat, &value); break; } case SocketType::INT: { int value = node->get_int(socket); - ss->Parameter(uname, TypeDesc::TypeInt, &value); + ss->Parameter(uname, TypeInt, &value); break; } case SocketType::COLOR: { float3 value = node->get_float3(socket); - ss->Parameter(uname, TypeDesc::TypeColor, &value); + ss->Parameter(uname, TypeColor, &value); break; } case SocketType::VECTOR: { float3 value = node->get_float3(socket); - ss->Parameter(uname, TypeDesc::TypeVector, &value); + ss->Parameter(uname, TypeVector, &value); break; } case SocketType::POINT: { float3 value = node->get_float3(socket); - ss->Parameter(uname, TypeDesc::TypePoint, &value); + ss->Parameter(uname, TypePoint, &value); break; } case SocketType::NORMAL: { float3 value = node->get_float3(socket); - ss->Parameter(uname, TypeDesc::TypeNormal, &value); + ss->Parameter(uname, TypeNormal, &value); break; } case SocketType::POINT2: { @@@@ -954,19 +954,19 @@@@ void OSLCompiler::parameter(ShaderNode *node, const char *name) } case SocketType::STRING: { ustring value = node->get_string(socket); - ss->Parameter(uname, TypeDesc::TypeString, &value); + ss->Parameter(uname, TypeString, &value); break; } case SocketType::ENUM: { ustring value = node->get_string(socket); - ss->Parameter(uname, TypeDesc::TypeString, &value); + ss->Parameter(uname, TypeString, &value); break; } case SocketType::TRANSFORM: { Transform value = node->get_transform(socket); ProjectionTransform projection(value); projection = projection_transpose(projection); - ss->Parameter(uname, TypeDesc::TypeMatrix, &projection); + ss->Parameter(uname, TypeMatrix, &projection); break; } case SocketType::BOOLEAN_ARRAY: { @@@@ -975,17 +975,17 @@@@ void OSLCompiler::parameter(ShaderNode *node, const char *name) array intvalue(value.size()); for (size_t i = 0; i < value.size(); i++) intvalue[i] = value[i]; - ss->Parameter(uname, array_typedesc(TypeDesc::TypeInt, value.size()), intvalue.data()); + ss->Parameter(uname, array_typedesc(TypeInt, value.size()), intvalue.data()); break; } case SocketType::FLOAT_ARRAY: { const array &value = node->get_float_array(socket); - ss->Parameter(uname, array_typedesc(TypeDesc::TypeFloat, value.size()), value.data()); + ss->Parameter(uname, array_typedesc(TypeFloat, value.size()), value.data()); break; } case SocketType::INT_ARRAY: { const array &value = node->get_int_array(socket); - ss->Parameter(uname, array_typedesc(TypeDesc::TypeInt, value.size()), value.data()); + ss->Parameter(uname, array_typedesc(TypeInt, value.size()), value.data()); break; } case SocketType::COLOR_ARRAY: @@@@ -996,16 +996,16 @@@@ void OSLCompiler::parameter(ShaderNode *node, const char *name) switch (socket.type) { case SocketType::COLOR_ARRAY: - typedesc = TypeDesc::TypeColor; + typedesc = TypeColor; break; case SocketType::VECTOR_ARRAY: - typedesc = TypeDesc::TypeVector; + typedesc = TypeVector; break; case SocketType::POINT_ARRAY: - typedesc = TypeDesc::TypePoint; + typedesc = TypePoint; break; case SocketType::NORMAL_ARRAY: - typedesc = TypeDesc::TypeNormal; + typedesc = TypeNormal; break; default: assert(0); @@@@ -1034,7 +1034,7 @@@@ void OSLCompiler::parameter(ShaderNode *node, const char *name) } case SocketType::STRING_ARRAY: { const array &value = node->get_string_array(socket); - ss->Parameter(uname, array_typedesc(TypeDesc::TypeString, value.size()), value.data()); + ss->Parameter(uname, array_typedesc(TypeString, value.size()), value.data()); break; } case SocketType::TRANSFORM_ARRAY: { @@@@ -1043,7 +1043,7 @@@@ void OSLCompiler::parameter(ShaderNode *node, const char *name) for (size_t i = 0; i < value.size(); i++) { fvalue[i] = projection_transpose(ProjectionTransform(value[i])); } - ss->Parameter(uname, array_typedesc(TypeDesc::TypeMatrix, fvalue.size()), fvalue.data()); + ss->Parameter(uname, array_typedesc(TypeMatrix, fvalue.size()), fvalue.data()); break; } case SocketType::CLOSURE: @@@@ -1061,55 +1061,55 @@@@ void OSLCompiler::parameter(ShaderNode *node, const char *name) void OSLCompiler::parameter(const char *name, float f) { - ss->Parameter(name, TypeDesc::TypeFloat, &f); + ss->Parameter(name, TypeFloat, &f); } void OSLCompiler::parameter_color(const char *name, float3 f) { - ss->Parameter(name, TypeDesc::TypeColor, &f); + ss->Parameter(name, TypeColor, &f); } void OSLCompiler::parameter_point(const char *name, float3 f) { - ss->Parameter(name, TypeDesc::TypePoint, &f); + ss->Parameter(name, TypePoint, &f); } void OSLCompiler::parameter_normal(const char *name, float3 f) { - ss->Parameter(name, TypeDesc::TypeNormal, &f); + ss->Parameter(name, TypeNormal, &f); } void OSLCompiler::parameter_vector(const char *name, float3 f) { - ss->Parameter(name, TypeDesc::TypeVector, &f); + ss->Parameter(name, TypeVector, &f); } void OSLCompiler::parameter(const char *name, int f) { - ss->Parameter(name, TypeDesc::TypeInt, &f); + ss->Parameter(name, TypeInt, &f); } void OSLCompiler::parameter(const char *name, const char *s) { - ss->Parameter(name, TypeDesc::TypeString, &s); + ss->Parameter(name, TypeString, &s); } void OSLCompiler::parameter(const char *name, ustring s) { const char *str = s.c_str(); - ss->Parameter(name, TypeDesc::TypeString, &str); + ss->Parameter(name, TypeString, &str); } void OSLCompiler::parameter(const char *name, const Transform &tfm) { ProjectionTransform projection(tfm); projection = projection_transpose(projection); - ss->Parameter(name, TypeDesc::TypeMatrix, (float *)&projection); + ss->Parameter(name, TypeMatrix, (float *)&projection); } void OSLCompiler::parameter_array(const char *name, const float f[], int arraylen) { - TypeDesc type = TypeDesc::TypeFloat; + TypeDesc type = TypeFloat; type.arraylen = arraylen; ss->Parameter(name, type, f); } @@@@ -1125,7 +1125,7 @@@@ void OSLCompiler::parameter_color_array(const char *name, const array &f table[i][2] = f[i].z; } - TypeDesc type = TypeDesc::TypeColor; + TypeDesc type = TypeColor; type.arraylen = table.size(); ss->Parameter(name, type, table.data()); } diff --git intern/cycles/scene/shader.cpp intern/cycles/scene/shader.cpp index e7b04db4f393..c8d2733b816c 100644 --- intern/cycles/scene/shader.cpp +++ intern/cycles/scene/shader.cpp @@@@ -819,7 +819,7 @@@@ float3 ShaderManager::rec709_to_scene_linear(float3 c) string ShaderManager::get_cryptomatte_materials(Scene *scene) { string manifest = "{"; - unordered_set materials; + unordered_set materials; foreach (Shader *shader, scene->shaders) { if (materials.count(shader->name)) { continue; diff --git intern/cycles/scene/shader.h intern/cycles/scene/shader.h index f29d351ccafc..261e57196f5c 100644 --- intern/cycles/scene/shader.h +++ intern/cycles/scene/shader.h @@@@ -228,7 +228,7 @@@@ class ShaderManager { uint32_t update_flags; - typedef unordered_map AttributeIDMap; + typedef unordered_map AttributeIDMap; AttributeIDMap unique_attribute_id; static thread_mutex lookup_table_mutex; diff --git intern/cycles/scene/stats.h intern/cycles/scene/stats.h index 9f35f7c90600..f22f6e330631 100644 --- intern/cycles/scene/stats.h +++ intern/cycles/scene/stats.h @@@@ -131,7 +131,7 @@@@ class NamedSampleCountStats { string full_report(int indent_level = 0); void add(const ustring &name, uint64_t samples, uint64_t hits); - typedef unordered_map entry_map; + typedef unordered_map entry_map; entry_map entries; }; @