+ // Look for array index closing bracket
+ auto nameStringView = theUniformName.GetStringView();
+ auto pos = nameStringView.rfind("]");
+
+ // 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);
+ 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(), '[');
+ }
+ uniformName = theUniformName;
+ uniformNameHash = Dali::CalculateHash(theUniformName.GetCString());