X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fupdate%2Fcommon%2Funiform-map.h;h=0a505ded17fb93369e07d9d342d81a294f6ebb3d;hb=df66eaa6145d1d1ec9c43f49b7595b9cb359d336;hp=fbfb9f6e596bae4fcad766b8f2b283c948b50d81;hpb=beccefce103877b896aef8c460d71aac3e7d0d3d;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/dali/internal/update/common/uniform-map.h b/dali/internal/update/common/uniform-map.h index fbfb9f6..0a505de 100644 --- a/dali/internal/update/common/uniform-map.h +++ b/dali/internal/update/common/uniform-map.h @@ -2,7 +2,7 @@ #define DALI_INTERNAL_SCENE_GRAPH_UNIFORM_MAP_H /* - * Copyright (c) 2021 Samsung Electronics Co., Ltd. + * Copyright (c) 2022 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -53,13 +53,17 @@ public: arrayIndex(0u) { // Look for array index closing bracket - auto pos = theUniformName.GetStringView().rfind("]"); + auto nameStringView = theUniformName.GetStringView(); + auto pos = nameStringView.rfind("]"); - // If found, extract the array index and store it + // If found, extract the array index and store it, if it's an element in an array of basic types. if(pos != std::string::npos) { - auto pos0 = theUniformName.GetStringView().rfind("[", pos); - arrayIndex = atoi(theUniformName.GetCString() + pos0 + 1); + auto pos0 = theUniformName.GetStringView().rfind("[", pos); + if(pos == nameStringView.length() - 1) // if element is in struct, don't set array index. + { + arrayIndex = atoi(theUniformName.GetCString() + pos0 + 1); + } // Calculate hash from name without array index uniformNameHashNoArray = Dali::CalculateHash(theUniformName.GetStringView().substr(0, pos0).data(), '['); }