Changed handling of uniforms of arrays of structs
[platform/core/uifw/dali-core.git] / automated-tests / src / dali / utc-Dali-Renderer.cpp
index 3d09351..ba640e0 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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.
@@ -78,17 +78,6 @@ void TestConstraintNoBlue(Vector4& current, const PropertyInputContainer& inputs
   current.b = 0.0f;
 }
 
-Texture CreateTexture(TextureType::Type type, Pixel::Format format, int width, int height)
-{
-  Texture texture = Texture::New(type, format, width, height);
-
-  int       bufferSize = width * height * Pixel::GetBytesPerPixel(format);
-  uint8_t*  buffer     = reinterpret_cast<uint8_t*>(malloc(bufferSize));
-  PixelData pixelData  = PixelData::New(buffer, bufferSize, width, height, format, PixelData::FREE);
-  texture.Upload(pixelData, 0u, 0u, 0u, 0u, width, height);
-  return texture;
-}
-
 Renderer CreateRenderer(Actor actor, Geometry geometry, Shader shader, int depthIndex)
 {
   Texture    image0      = CreateTexture(TextureType::TEXTURE_2D, Pixel::RGB888, 64, 64);
@@ -709,6 +698,8 @@ int UtcDaliRendererBlendOptions05(void)
   actor.AddRenderer(renderer);
   actor.SetProperty(Actor::Property::SIZE, Vector2(400, 400));
   application.GetScene().Add(actor);
+  TestGlAbstraction& glAbstraction = application.GetGlAbstraction();
+  glAbstraction.EnableEnableDisableCallTrace(true);
 
   if(Dali::Capabilities::IsBlendEquationSupported(DevelBlendEquation::MAX))
   {
@@ -767,48 +758,93 @@ int UtcDaliRendererBlendOptions05(void)
   {
     renderer.SetProperty(DevelRenderer::Property::BLEND_EQUATION, DevelBlendEquation::MULTIPLY);
     DALI_TEST_EQUALS((int)DevelBlendEquation::MULTIPLY, renderer.GetProperty<int>(DevelRenderer::Property::BLEND_EQUATION), TEST_LOCATION);
+    application.SendNotification();
+    application.Render();
+    DALI_TEST_EQUALS(glAbstraction.GetLastBlendEquationRgb(), GL_MULTIPLY, TEST_LOCATION);
 
     renderer.SetProperty(DevelRenderer::Property::BLEND_EQUATION, DevelBlendEquation::SCREEN);
     DALI_TEST_EQUALS((int)DevelBlendEquation::SCREEN, renderer.GetProperty<int>(DevelRenderer::Property::BLEND_EQUATION), TEST_LOCATION);
+    application.SendNotification();
+    application.Render();
+    DALI_TEST_EQUALS(glAbstraction.GetLastBlendEquationRgb(), GL_SCREEN, TEST_LOCATION);
 
     renderer.SetProperty(DevelRenderer::Property::BLEND_EQUATION, DevelBlendEquation::OVERLAY);
     DALI_TEST_EQUALS((int)DevelBlendEquation::OVERLAY, renderer.GetProperty<int>(DevelRenderer::Property::BLEND_EQUATION), TEST_LOCATION);
+    application.SendNotification();
+    application.Render();
+    DALI_TEST_EQUALS(glAbstraction.GetLastBlendEquationRgb(), GL_OVERLAY, TEST_LOCATION);
 
     renderer.SetProperty(DevelRenderer::Property::BLEND_EQUATION, DevelBlendEquation::DARKEN);
     DALI_TEST_EQUALS((int)DevelBlendEquation::DARKEN, renderer.GetProperty<int>(DevelRenderer::Property::BLEND_EQUATION), TEST_LOCATION);
+    application.SendNotification();
+    application.Render();
+    DALI_TEST_EQUALS(glAbstraction.GetLastBlendEquationRgb(), GL_DARKEN, TEST_LOCATION);
 
     renderer.SetProperty(DevelRenderer::Property::BLEND_EQUATION, DevelBlendEquation::LIGHTEN);
     DALI_TEST_EQUALS((int)DevelBlendEquation::LIGHTEN, renderer.GetProperty<int>(DevelRenderer::Property::BLEND_EQUATION), TEST_LOCATION);
+    application.SendNotification();
+    application.Render();
+    DALI_TEST_EQUALS(glAbstraction.GetLastBlendEquationRgb(), GL_LIGHTEN, TEST_LOCATION);
 
     renderer.SetProperty(DevelRenderer::Property::BLEND_EQUATION, DevelBlendEquation::COLOR_DODGE);
     DALI_TEST_EQUALS((int)DevelBlendEquation::COLOR_DODGE, renderer.GetProperty<int>(DevelRenderer::Property::BLEND_EQUATION), TEST_LOCATION);
+    application.SendNotification();
+    application.Render();
+    DALI_TEST_EQUALS(glAbstraction.GetLastBlendEquationRgb(), GL_COLORDODGE, TEST_LOCATION);
 
     renderer.SetProperty(DevelRenderer::Property::BLEND_EQUATION, DevelBlendEquation::COLOR_BURN);
     DALI_TEST_EQUALS((int)DevelBlendEquation::COLOR_BURN, renderer.GetProperty<int>(DevelRenderer::Property::BLEND_EQUATION), TEST_LOCATION);
+    application.SendNotification();
+    application.Render();
+    DALI_TEST_EQUALS(glAbstraction.GetLastBlendEquationRgb(), GL_COLORBURN, TEST_LOCATION);
 
     renderer.SetProperty(DevelRenderer::Property::BLEND_EQUATION, DevelBlendEquation::HARD_LIGHT);
     DALI_TEST_EQUALS((int)DevelBlendEquation::HARD_LIGHT, renderer.GetProperty<int>(DevelRenderer::Property::BLEND_EQUATION), TEST_LOCATION);
+    application.SendNotification();
+    application.Render();
+    DALI_TEST_EQUALS(glAbstraction.GetLastBlendEquationRgb(), GL_HARDLIGHT, TEST_LOCATION);
 
     renderer.SetProperty(DevelRenderer::Property::BLEND_EQUATION, DevelBlendEquation::SOFT_LIGHT);
     DALI_TEST_EQUALS((int)DevelBlendEquation::SOFT_LIGHT, renderer.GetProperty<int>(DevelRenderer::Property::BLEND_EQUATION), TEST_LOCATION);
+    application.SendNotification();
+    application.Render();
+    DALI_TEST_EQUALS(glAbstraction.GetLastBlendEquationRgb(), GL_SOFTLIGHT, TEST_LOCATION);
 
     renderer.SetProperty(DevelRenderer::Property::BLEND_EQUATION, DevelBlendEquation::DIFFERENCE);
     DALI_TEST_EQUALS((int)DevelBlendEquation::DIFFERENCE, renderer.GetProperty<int>(DevelRenderer::Property::BLEND_EQUATION), TEST_LOCATION);
+    application.SendNotification();
+    application.Render();
+    DALI_TEST_EQUALS(glAbstraction.GetLastBlendEquationRgb(), GL_DIFFERENCE, TEST_LOCATION);
 
     renderer.SetProperty(DevelRenderer::Property::BLEND_EQUATION, DevelBlendEquation::EXCLUSION);
     DALI_TEST_EQUALS((int)DevelBlendEquation::EXCLUSION, renderer.GetProperty<int>(DevelRenderer::Property::BLEND_EQUATION), TEST_LOCATION);
+    application.SendNotification();
+    application.Render();
+    DALI_TEST_EQUALS(glAbstraction.GetLastBlendEquationRgb(), GL_EXCLUSION, TEST_LOCATION);
 
     renderer.SetProperty(DevelRenderer::Property::BLEND_EQUATION, DevelBlendEquation::HUE);
     DALI_TEST_EQUALS((int)DevelBlendEquation::HUE, renderer.GetProperty<int>(DevelRenderer::Property::BLEND_EQUATION), TEST_LOCATION);
+    application.SendNotification();
+    application.Render();
+    DALI_TEST_EQUALS(glAbstraction.GetLastBlendEquationRgb(), GL_HSL_HUE, TEST_LOCATION);
 
     renderer.SetProperty(DevelRenderer::Property::BLEND_EQUATION, DevelBlendEquation::SATURATION);
     DALI_TEST_EQUALS((int)DevelBlendEquation::SATURATION, renderer.GetProperty<int>(DevelRenderer::Property::BLEND_EQUATION), TEST_LOCATION);
+    application.SendNotification();
+    application.Render();
+    DALI_TEST_EQUALS(glAbstraction.GetLastBlendEquationRgb(), GL_HSL_SATURATION, TEST_LOCATION);
 
     renderer.SetProperty(DevelRenderer::Property::BLEND_EQUATION, DevelBlendEquation::COLOR);
     DALI_TEST_EQUALS((int)DevelBlendEquation::COLOR, renderer.GetProperty<int>(DevelRenderer::Property::BLEND_EQUATION), TEST_LOCATION);
+    application.SendNotification();
+    application.Render();
+    DALI_TEST_EQUALS(glAbstraction.GetLastBlendEquationRgb(), GL_HSL_COLOR, TEST_LOCATION);
 
     renderer.SetProperty(DevelRenderer::Property::BLEND_EQUATION, DevelBlendEquation::LUMINOSITY);
     DALI_TEST_EQUALS((int)DevelBlendEquation::LUMINOSITY, renderer.GetProperty<int>(DevelRenderer::Property::BLEND_EQUATION), TEST_LOCATION);
+    application.SendNotification();
+    application.Render();
+    DALI_TEST_EQUALS(glAbstraction.GetLastBlendEquationRgb(), GL_HSL_LUMINOSITY, TEST_LOCATION);
   }
 
   END_TEST;
@@ -825,7 +861,7 @@ int UtcDaliRendererSetBlendMode01(void)
   Renderer renderer = Renderer::New(geometry, shader);
 
   Actor actor = Actor::New();
-  actor.SetProperty(Actor::Property::OPACITY, 0.98f);
+  actor.SetProperty(Actor::Property::OPACITY, 1.0f);
   actor.AddRenderer(renderer);
   actor.SetProperty(Actor::Property::SIZE, Vector2(400.0f, 400.0f));
   application.GetScene().Add(actor);
@@ -1214,6 +1250,71 @@ int UtcDaliRendererSetBlendMode08b(void)
   END_TEST;
 }
 
+int UtcDaliRendererSetBlendMode09(void)
+{
+  TestApplication application;
+
+  tet_infoline("Test setting the blend mode to on_without_cull with an opaque color renders with blending enabled");
+
+  Geometry geometry = CreateQuadGeometry();
+  Shader   shader   = CreateShader();
+  Renderer renderer = Renderer::New(geometry, shader);
+
+  Actor actor = Actor::New();
+  actor.SetProperty(Actor::Property::OPACITY, 1.0f);
+  actor.AddRenderer(renderer);
+  actor.SetProperty(Actor::Property::SIZE, Vector2(400.0f, 400.0f));
+  application.GetScene().Add(actor);
+
+  renderer.SetProperty(Renderer::Property::BLEND_MODE, BlendMode::ON_WITHOUT_CULL);
+
+  TestGlAbstraction& glAbstraction = application.GetGlAbstraction();
+  glAbstraction.EnableEnableDisableCallTrace(true);
+
+  application.SendNotification();
+  application.Render();
+
+  TraceCallStack&             glEnableStack = glAbstraction.GetEnableDisableTrace();
+  TraceCallStack::NamedParams params;
+  params["cap"] << std::hex << GL_BLEND;
+  DALI_TEST_CHECK(glEnableStack.FindMethodAndParams("Enable", params));
+
+  END_TEST;
+}
+
+int UtcDaliRendererSetBlendMode09b(void)
+{
+  TestApplication application;
+
+  tet_infoline("Test setting the blend mode to on_without_cull with an transparent color renders with blending enabled");
+
+  Geometry geometry = CreateQuadGeometry();
+  Shader   shader   = CreateShader();
+  Renderer renderer = Renderer::New(geometry, shader);
+
+  Actor actor = Actor::New();
+  actor.SetProperty(Actor::Property::OPACITY, 0.0f);
+  actor.AddRenderer(renderer);
+  actor.SetProperty(Actor::Property::SIZE, Vector2(400.0f, 400.0f));
+  application.GetScene().Add(actor);
+
+  renderer.SetProperty(Renderer::Property::BLEND_MODE, BlendMode::ON_WITHOUT_CULL);
+
+  TestGlAbstraction& glAbstraction = application.GetGlAbstraction();
+  glAbstraction.EnableEnableDisableCallTrace(true);
+  glAbstraction.EnableDrawCallTrace(true);
+
+  application.SendNotification();
+  application.Render();
+
+  TraceCallStack& glEnableStack = glAbstraction.GetEnableDisableTrace();
+  DALI_TEST_CHECK(glEnableStack.FindMethod("Enable"));
+
+  DALI_TEST_CHECK(glAbstraction.GetDrawTrace().FindMethod("DrawElements"));
+
+  END_TEST;
+}
+
 int UtcDaliRendererGetBlendMode(void)
 {
   TestApplication application;
@@ -1238,6 +1339,11 @@ int UtcDaliRendererGetBlendMode(void)
   mode = renderer.GetProperty<int>(Renderer::Property::BLEND_MODE);
   DALI_TEST_EQUALS(static_cast<BlendMode::Type>(mode), BlendMode::OFF, TEST_LOCATION);
 
+  // ON_WITHOUT_CULL
+  renderer.SetProperty(Renderer::Property::BLEND_MODE, BlendMode::ON_WITHOUT_CULL);
+  mode = renderer.GetProperty<int>(Renderer::Property::BLEND_MODE);
+  DALI_TEST_EQUALS(static_cast<BlendMode::Type>(mode), BlendMode::ON_WITHOUT_CULL, TEST_LOCATION);
+
   END_TEST;
 }
 
@@ -1352,9 +1458,12 @@ int UtcDaliRendererPreMultipledAlpha(void)
   application.Render();
 
   Vector4            actualValue(Vector4::ZERO);
+  Vector4            actualActorColor(Vector4::ZERO);
   TestGlAbstraction& gl = application.GetGlAbstraction();
   DALI_TEST_CHECK(gl.GetUniformValue<Vector4>("uColor", actualValue));
   DALI_TEST_EQUALS(actualValue, Vector4(1.0f, 0.0f, 1.0f, 0.5f), TEST_LOCATION);
+  DALI_TEST_CHECK(gl.GetUniformValue<Vector4>("uActorColor", actualActorColor));
+  DALI_TEST_EQUALS(actualActorColor, Vector4(1.0f, 0.0f, 1.0f, 0.5f), TEST_LOCATION);
 
   // Enable pre-multiplied alpha
   renderer.SetProperty(Renderer::Property::BLEND_PRE_MULTIPLIED_ALPHA, true);
@@ -1382,6 +1491,9 @@ int UtcDaliRendererPreMultipledAlpha(void)
 
   DALI_TEST_CHECK(gl.GetUniformValue<Vector4>("uColor", actualValue));
   DALI_TEST_EQUALS(actualValue, Vector4(0.5f, 0.0f, 0.5f, 0.5f), TEST_LOCATION);
+  // Note : uActorColor doesn't premultiplied.
+  DALI_TEST_CHECK(gl.GetUniformValue<Vector4>("uActorColor", actualActorColor));
+  DALI_TEST_EQUALS(actualActorColor, Vector4(1.0f, 0.0f, 1.0f, 0.5f), TEST_LOCATION);
 
   // Disable pre-multiplied alpha again
   renderer.SetProperty(Renderer::Property::BLEND_PRE_MULTIPLIED_ALPHA, false);
@@ -1409,6 +1521,8 @@ int UtcDaliRendererPreMultipledAlpha(void)
 
   DALI_TEST_CHECK(gl.GetUniformValue<Vector4>("uColor", actualValue));
   DALI_TEST_EQUALS(actualValue, Vector4(1.0f, 0.0f, 1.0f, 0.5f), TEST_LOCATION);
+  DALI_TEST_CHECK(gl.GetUniformValue<Vector4>("uActorColor", actualActorColor));
+  DALI_TEST_EQUALS(actualActorColor, Vector4(1.0f, 0.0f, 1.0f, 0.5f), TEST_LOCATION);
 
   END_TEST;
 }
@@ -1907,7 +2021,7 @@ int UtcDaliRendererRenderOrder2DLayer(void)
   for(unsigned int i(0); i < 4; ++i)
   {
     std::stringstream params;
-    params << GL_TEXTURE_2D << ", " << i + 1;
+    params << std::hex << GL_TEXTURE_2D << std::dec << ", " << i + 1;
     textureBindIndex[i] = gl.GetTextureTrace().FindIndexFromMethodAndParams("BindTexture", params.str());
   }
 
@@ -1975,7 +2089,7 @@ int UtcDaliRendererRenderOrder2DLayerMultipleRenderers(void)
   for(unsigned int i(0); i < 6; ++i)
   {
     std::stringstream params;
-    params << GL_TEXTURE_2D << ", " << i + 1;
+    params << std::hex << GL_TEXTURE_2D << std::dec << ", " << i + 1;
     textureBindIndex[i] = gl.GetTextureTrace().FindIndexFromMethodAndParams("BindTexture", params.str());
   }
 
@@ -2064,7 +2178,7 @@ int UtcDaliRendererRenderOrder2DLayerSiblingOrder(void)
   for(unsigned int i(0); i < 6; ++i)
   {
     std::stringstream params;
-    params << GL_TEXTURE_2D << ", " << i + 1;
+    params << std::hex << GL_TEXTURE_2D << std::dec << ", " << i + 1;
     textureBindIndex[i] = gl.GetTextureTrace().FindIndexFromMethodAndParams("BindTexture", params.str());
   }
 
@@ -2086,7 +2200,7 @@ int UtcDaliRendererRenderOrder2DLayerSiblingOrder(void)
   for(unsigned int i(0); i < 6; ++i)
   {
     std::stringstream params;
-    params << GL_TEXTURE_2D << ", " << i + 1;
+    params << std::hex << GL_TEXTURE_2D << std::dec << ", " << i + 1;
     textureBindIndex[i] = gl.GetTextureTrace().FindIndexFromMethodAndParams("BindTexture", params.str());
   }
 
@@ -2166,7 +2280,7 @@ int UtcDaliRendererRenderOrder2DLayerOverlay(void)
   for(unsigned int i(0); i < 5; ++i)
   {
     std::stringstream params;
-    params << GL_TEXTURE_2D << ", " << i + 1;
+    params << std::hex << GL_TEXTURE_2D << std::dec << ", " << i + 1;
     textureBindIndex[i] = gl.GetTextureTrace().FindIndexFromMethodAndParams("BindTexture", params.str());
   }
 
@@ -2804,7 +2918,8 @@ void CheckRenderModeColorMask(TestApplication& application, Renderer& renderer,
   DALI_TEST_EQUALS<bool>(colorMaskParams.red, expectedValue, TEST_LOCATION);
   DALI_TEST_EQUALS<bool>(colorMaskParams.green, expectedValue, TEST_LOCATION);
   DALI_TEST_EQUALS<bool>(colorMaskParams.blue, expectedValue, TEST_LOCATION);
-  DALI_TEST_EQUALS<bool>(colorMaskParams.alpha, expectedValue, TEST_LOCATION);
+  // @todo Only check alpha if framebuffer supports it.
+  //DALI_TEST_EQUALS<bool>(colorMaskParams.alpha, expectedValue, TEST_LOCATION);
 }
 
 int UtcDaliRendererSetRenderModeToUseColorBuffer(void)
@@ -3144,9 +3259,12 @@ int UtcDaliRendererOpacity(void)
   application.Render();
 
   Vector4            actualValue;
+  Vector4            actualActorColor;
   TestGlAbstraction& gl = application.GetGlAbstraction();
   DALI_TEST_CHECK(gl.GetUniformValue<Vector4>("uColor", actualValue));
   DALI_TEST_EQUALS(actualValue.a, 1.0f, Dali::Math::MACHINE_EPSILON_1, TEST_LOCATION);
+  DALI_TEST_CHECK(gl.GetUniformValue<Vector4>("uActorColor", actualActorColor));
+  DALI_TEST_EQUALS(actualActorColor.a, 1.0f, Dali::Math::MACHINE_EPSILON_1, TEST_LOCATION);
 
   renderer.SetProperty(DevelRenderer::Property::OPACITY, 0.5f);
 
@@ -3164,6 +3282,10 @@ int UtcDaliRendererOpacity(void)
   DALI_TEST_CHECK(gl.GetUniformValue<Vector4>("uColor", actualValue));
   DALI_TEST_EQUALS(actualValue.a, 0.5f, Dali::Math::MACHINE_EPSILON_1, TEST_LOCATION);
 
+  // Note : Renderer opacity doesn't apply to uActorColor.
+  DALI_TEST_CHECK(gl.GetUniformValue<Vector4>("uActorColor", actualActorColor));
+  DALI_TEST_EQUALS(actualActorColor.a, 1.0f, Dali::Math::MACHINE_EPSILON_1, TEST_LOCATION);
+
   END_TEST;
 }
 
@@ -3429,8 +3551,6 @@ int UtcDaliRendererAddDrawCommands(void)
   DALI_TEST_EQUALS(drawTrace.CountMethod("DrawElements"), 1, TEST_LOCATION);
 
   tet_infoline("\n\nTesting extension draw commands\n");
-  tet_infoline("TEMPORARILY REMOVED. MUST PUT BACK!\n");
-#ifdef TEMPORARY_TEST_REMOVAL
   auto drawCommand1         = DevelRenderer::DrawCommand{};
   drawCommand1.drawType     = DevelRenderer::DrawType::INDEXED;
   drawCommand1.firstIndex   = 0;
@@ -3459,7 +3579,6 @@ int UtcDaliRendererAddDrawCommands(void)
   application.Render();
 
   DALI_TEST_EQUALS(drawTrace.CountMethod("DrawElements"), 3, TEST_LOCATION);
-#endif
   END_TEST;
 }
 int UtcDaliRendererSetGeometryNegative(void)
@@ -3648,10 +3767,13 @@ int UtcDaliRendererPreparePipeline(void)
 
   DALI_TEST_CHECK(graphicsCallstack.FindMethod("SubmitCommandBuffers"));
   std::vector<Graphics::SubmitInfo>& submissions = graphics.mSubmitStack;
-  DALI_TEST_EQUALS(submissions.size(), 1, TEST_LOCATION);
-  DALI_TEST_EQUALS(submissions[0].cmdBuffer.size(), 1, TEST_LOCATION);
-  const TestGraphicsCommandBuffer* cmdBuf   = static_cast<TestGraphicsCommandBuffer*>((submissions[0].cmdBuffer[0]));
-  auto                             pipeline = cmdBuf->mPipeline;
+  DALI_TEST_CHECK(submissions.size() > 0);
+
+  TestGraphicsCommandBuffer* cmdBuf = static_cast<TestGraphicsCommandBuffer*>((submissions.back().cmdBuffer[0]));
+
+  auto result   = cmdBuf->GetChildCommandsByType(0 | CommandType::BIND_PIPELINE);
+  auto pipeline = result[0]->data.bindPipeline.pipeline;
+
   if(pipeline)
   {
     DALI_TEST_EQUALS(pipeline->vertexInputState.attributes.size(), 12, TEST_LOCATION);
@@ -3665,3 +3787,117 @@ int UtcDaliRendererPreparePipeline(void)
 
   END_TEST;
 }
+
+int UtcDaliRendererUniformArrayOfStruct(void)
+{
+  TestApplication application;
+  tet_infoline("Test that uniforms that are elements of arrays of structs can be accessed");
+
+  std::vector<UniformData> customUniforms{{"arrayof[10].color", Property::VECTOR4},
+                                          {"arrayof[10].position", Property::VECTOR2},
+                                          {"arrayof[10].normal", Property::VECTOR3}};
+
+  application.GetGraphicsController().AddCustomUniforms(customUniforms);
+
+  Geometry geometry = CreateQuadGeometry();
+  Shader   shader   = Shader::New("vertexSrc", "fragmentSrc");
+  Renderer renderer = Renderer::New(geometry, shader);
+  Actor    actor    = Actor::New();
+  actor.AddRenderer(renderer);
+  actor[Actor::Property::SIZE] = Vector2(120, 120);
+  application.GetScene().Add(actor);
+
+  // Define some properties to match the custom uniforms.
+  // Ensure they can be written & read back from the abstraction.
+
+  struct UniformIndexPair
+  {
+    Property::Index index;
+    std::string     name;
+    UniformIndexPair(Property::Index index, std::string name)
+    : index(index),
+      name(name)
+    {
+    }
+  };
+  std::vector<UniformIndexPair> uniformIndices;
+
+  std::ostringstream oss;
+  for(int i = 0; i < 10; ++i)
+  {
+    Property::Index index;
+    oss << "arrayof[" << i << "].color";
+    Vector4 color = Color::WHITE;
+    color.r       = 25.5f * i;
+    index         = renderer.RegisterProperty(oss.str(), color);
+    uniformIndices.emplace_back(index, oss.str());
+
+    oss.str("");
+    oss.clear();
+    oss << "arrayof[" << i << "].position";
+    Vector2 pos(i, 10 + i * 5);
+    index = renderer.RegisterProperty(oss.str(), pos);
+    uniformIndices.emplace_back(index, oss.str());
+
+    oss.str("");
+    oss.clear();
+    oss << "arrayof[" << i << "].normal";
+    Vector3 normal(i, i * 10, i * 100);
+    index = renderer.RegisterProperty(oss.str(), normal);
+    uniformIndices.emplace_back(index, oss.str());
+    oss.str("");
+    oss.clear();
+  }
+  auto&           gl        = application.GetGlAbstraction();
+  TraceCallStack& callStack = gl.GetSetUniformTrace();
+  gl.EnableSetUniformCallTrace(true);
+
+  application.SendNotification();
+  application.Render();
+
+  // Check that the uniforms match.
+  TraceCallStack::NamedParams params;
+  for(auto& uniformInfo : uniformIndices)
+  {
+    Property::Value value = renderer.GetProperty(uniformInfo.index);
+    switch(value.GetType())
+    {
+      case Property::VECTOR2:
+      {
+        DALI_TEST_CHECK(callStack.FindMethodAndGetParameters(uniformInfo.name, params));
+        Vector2 setValue;
+        DALI_TEST_CHECK(gl.GetUniformValue<Vector2>(uniformInfo.name.c_str(), setValue));
+        DALI_TEST_EQUALS(value.Get<Vector2>(), setValue, 0.001f, TEST_LOCATION);
+        break;
+      }
+      case Property::VECTOR3:
+      {
+        DALI_TEST_CHECK(callStack.FindMethodAndGetParameters(uniformInfo.name, params));
+        Vector3 setValue;
+        DALI_TEST_CHECK(gl.GetUniformValue<Vector3>(uniformInfo.name.c_str(), setValue));
+        DALI_TEST_EQUALS(value.Get<Vector3>(), setValue, 0.001f, TEST_LOCATION);
+        break;
+      }
+      case Property::VECTOR4:
+      {
+        DALI_TEST_CHECK(callStack.FindMethodAndGetParameters(uniformInfo.name, params));
+        Vector4 setValue;
+        DALI_TEST_CHECK(gl.GetUniformValue<Vector4>(uniformInfo.name.c_str(), setValue));
+        DALI_TEST_EQUALS(value.Get<Vector4>(), setValue, 0.001f, TEST_LOCATION);
+        break;
+      }
+      default:
+        break;
+    }
+  }
+
+  // There is a hash in the property name's uniform map: check this in debugger
+  // There is a hash in the reflection. Check this in the debugger.
+
+  // Check that the reflection contains individual locs for each array entry's struct element
+  // and that it hashes the whole string
+
+  // Ensure that the property name's hash is also for the whole string.
+
+  END_TEST;
+}