Change the naming of RenderPass to RenderPassTag for Shader and RenderTask 61/294361/2
authorseungho baek <sbsh.baek@samsung.com>
Fri, 16 Jun 2023 09:05:49 +0000 (18:05 +0900)
committerseungho baek <sbsh.baek@samsung.com>
Fri, 16 Jun 2023 09:26:18 +0000 (18:26 +0900)
Change-Id: I7c4f7f24fdb7d13f202be317899e915e73f979cd
Signed-off-by: seungho baek <sbsh.baek@samsung.com>
18 files changed:
automated-tests/src/dali/utc-Dali-RenderTask.cpp
automated-tests/src/dali/utc-Dali-Shader.cpp
dali/internal/common/shader-data.h
dali/internal/event/render-tasks/render-task-impl.cpp
dali/internal/event/render-tasks/render-task-impl.h
dali/internal/event/rendering/shader-impl.cpp
dali/internal/event/rendering/shader-impl.h
dali/internal/render/common/render-instruction.h
dali/internal/render/renderers/render-renderer.cpp
dali/internal/render/shaders/render-shader.cpp
dali/internal/render/shaders/render-shader.h
dali/internal/update/manager/render-instruction-processor.cpp
dali/internal/update/render-tasks/scene-graph-render-task-messages.h
dali/internal/update/render-tasks/scene-graph-render-task.cpp
dali/internal/update/render-tasks/scene-graph-render-task.h
dali/public-api/render-tasks/render-task.cpp
dali/public-api/render-tasks/render-task.h
dali/public-api/rendering/shader.h

index cb0b8f6..11219df 100644 (file)
@@ -4085,10 +4085,10 @@ int UtcDaliRenderTaskSetPartialUpdate(void)
   END_TEST;
 }
 
-int UtcDaliRenderTaskRenderPass(void)
+int UtcDaliRenderTaskRenderPassTag(void)
 {
   TestApplication application;
-  tet_infoline("Testing RenderTask with RenderPass");
+  tet_infoline("Testing RenderTask with RenderPassTag");
 
   Stage   stage = Stage::GetCurrent();
   Vector2 stageSize(stage.GetSize());
@@ -4105,11 +4105,11 @@ int UtcDaliRenderTaskRenderPass(void)
   Property::Map map[2];
   map[0]["vertex"]     = SHADER_COLOR_TEST_SHADER_VERT1.data();
   map[0]["fragment"]   = SHADER_COLOR_TEST_SHADER_FRAG.data();
-  map[0]["renderPass"] = 0;
+  map[0]["renderPassTag"] = 0;
 
   map[1]["vertex"]     = SHADER_COLOR_TEST_SHADER_VERT2.data();
   map[1]["fragment"]   = SHADER_COLOR_TEST_SHADER_FRAG.data();
-  map[1]["renderPass"] = 1;
+  map[1]["renderPassTag"] = 1;
 
   Property::Array array;
   array.PushBack(map[0]);
@@ -4124,40 +4124,40 @@ int UtcDaliRenderTaskRenderPass(void)
   auto& gfx = application.GetGraphicsController();
 
   RenderTaskList renderTaskList = stage.GetRenderTaskList();
-  DALI_TEST_EQUALS(0u, renderTaskList.GetTask(0u).GetRenderPass(), TEST_LOCATION);
+  DALI_TEST_EQUALS(0u, renderTaskList.GetTask(0u).GetRenderPassTag(), TEST_LOCATION);
   // Render and notify
   application.SendNotification();
   application.Render(16);
   DALI_TEST_CHECK(gfx.mCallStack.FindMethod("CreatePipeline"));
   gfx.mCallStack.Reset();
-  DALI_TEST_EQUALS(0u, renderTaskList.GetTask(0u).GetRenderPass(), TEST_LOCATION);
+  DALI_TEST_EQUALS(0u, renderTaskList.GetTask(0u).GetRenderPassTag(), TEST_LOCATION);
 
-  renderTaskList.GetTask(0u).SetRenderPass(1u);
-  DALI_TEST_EQUALS(1u, renderTaskList.GetTask(0u).GetRenderPass(), TEST_LOCATION);
+  renderTaskList.GetTask(0u).SetRenderPassTag(1u);
+  DALI_TEST_EQUALS(1u, renderTaskList.GetTask(0u).GetRenderPassTag(), TEST_LOCATION);
   // Render and notify
   application.SendNotification();
   application.Render(16);
   DALI_TEST_CHECK(gfx.mCallStack.FindMethod("CreatePipeline"));
   gfx.mCallStack.Reset();
-  DALI_TEST_EQUALS(1u, renderTaskList.GetTask(0u).GetRenderPass(), TEST_LOCATION);
+  DALI_TEST_EQUALS(1u, renderTaskList.GetTask(0u).GetRenderPassTag(), TEST_LOCATION);
 
-  renderTaskList.GetTask(0u).SetRenderPass(0u);
-  DALI_TEST_EQUALS(0u, renderTaskList.GetTask(0u).GetRenderPass(), TEST_LOCATION);
+  renderTaskList.GetTask(0u).SetRenderPassTag(0u);
+  DALI_TEST_EQUALS(0u, renderTaskList.GetTask(0u).GetRenderPassTag(), TEST_LOCATION);
   // Render and notify
   application.SendNotification();
   application.Render(16);
   DALI_TEST_CHECK(!gfx.mCallStack.FindMethod("CreatePipeline"));
   gfx.mCallStack.Reset();
-  DALI_TEST_EQUALS(0u, renderTaskList.GetTask(0u).GetRenderPass(), TEST_LOCATION);
+  DALI_TEST_EQUALS(0u, renderTaskList.GetTask(0u).GetRenderPassTag(), TEST_LOCATION);
 
-  renderTaskList.GetTask(0u).SetRenderPass(1u);
-  DALI_TEST_EQUALS(1u, renderTaskList.GetTask(0u).GetRenderPass(), TEST_LOCATION);
+  renderTaskList.GetTask(0u).SetRenderPassTag(1u);
+  DALI_TEST_EQUALS(1u, renderTaskList.GetTask(0u).GetRenderPassTag(), TEST_LOCATION);
   // Render and notify
   application.SendNotification();
   application.Render(16);
   DALI_TEST_CHECK(!gfx.mCallStack.FindMethod("CreatePipeline"));
   gfx.mCallStack.Reset();
-  DALI_TEST_EQUALS(1u, renderTaskList.GetTask(0u).GetRenderPass(), TEST_LOCATION);
+  DALI_TEST_EQUALS(1u, renderTaskList.GetTask(0u).GetRenderPassTag(), TEST_LOCATION);
 
   END_TEST;
 }
@@ -4188,13 +4188,13 @@ int UtcDaliRenderTaskWithWrongShaderData(void)
   auto& gfx = application.GetGraphicsController();
 
   RenderTaskList renderTaskList = stage.GetRenderTaskList();
-  DALI_TEST_EQUALS(0u, renderTaskList.GetTask(0u).GetRenderPass(), TEST_LOCATION);
+  DALI_TEST_EQUALS(0u, renderTaskList.GetTask(0u).GetRenderPassTag(), TEST_LOCATION);
   // Render and notify
   application.SendNotification();
   application.Render(16);
   DALI_TEST_CHECK(!gfx.mCallStack.FindMethod("CreatePipeline"));
   gfx.mCallStack.Reset();
-  DALI_TEST_EQUALS(0u, renderTaskList.GetTask(0u).GetRenderPass(), TEST_LOCATION);
+  DALI_TEST_EQUALS(0u, renderTaskList.GetTask(0u).GetRenderPassTag(), TEST_LOCATION);
 
   END_TEST;
 }
\ No newline at end of file
index 3833963..75ea5d1 100644 (file)
@@ -508,7 +508,7 @@ int UtcDaliShaderPropertyValueConstructorMap(void)
   Property::Map map;
   map["vertex"]     = VertexSource;
   map["fragment"]   = FragmentSource;
-  map["renderPass"] = 0;
+  map["renderPassTag"] = 0;
   map["hints"]      = hintSet;
 
   Shader shader = Shader::New(map);
@@ -520,12 +520,12 @@ int UtcDaliShaderPropertyValueConstructorMap(void)
   std::string          v      = (*outMap)["vertex"].Get<std::string>();
   std::string          f      = (*outMap)["fragment"].Get<std::string>();
   std::string          h      = (*outMap)["hints"].Get<std::string>();
-  int32_t              r      = (*outMap)["renderPass"].Get<int32_t>();
+  int32_t              r      = (*outMap)["renderPassTag"].Get<int32_t>();
 
   DALI_TEST_CHECK(v == map["vertex"].Get<std::string>());
   DALI_TEST_CHECK(f == map["fragment"].Get<std::string>());
   DALI_TEST_CHECK(h == map["hints"].Get<std::string>());
-  DALI_TEST_CHECK(r == map["renderPass"].Get<int32_t>());
+  DALI_TEST_CHECK(r == map["renderPassTag"].Get<int32_t>());
 
   END_TEST;
 }
@@ -540,12 +540,12 @@ int UtcDaliShaderPropertyValueConstructorArray(void)
   Property::Map map[2];
   map[0]["vertex"]     = VertexSource;
   map[0]["fragment"]   = FragmentSource;
-  map[0]["renderPass"] = 0;
+  map[0]["renderPassTag"] = 0;
   map[0]["hints"]      = hintSet;
 
   map[1]["vertex"]     = VertexSource2;
   map[1]["fragment"]   = FragmentSource2;
-  map[1]["renderPass"] = 1;
+  map[1]["renderPassTag"] = 1;
   map[1]["hints"]      = hintSet;
 
   Property::Array array;
@@ -567,12 +567,12 @@ int UtcDaliShaderPropertyValueConstructorArray(void)
     std::string          v      = (*outMap)["vertex"].Get<std::string>();
     std::string          f      = (*outMap)["fragment"].Get<std::string>();
     std::string          h      = (*outMap)["hints"].Get<std::string>();
-    int32_t              r      = (*outMap)["renderPass"].Get<int32_t>();
+    int32_t              r      = (*outMap)["renderPassTag"].Get<int32_t>();
 
     DALI_TEST_CHECK(v == map[i]["vertex"].Get<std::string>());
     DALI_TEST_CHECK(f == map[i]["fragment"].Get<std::string>());
     DALI_TEST_CHECK(h == map[i]["hints"].Get<std::string>());
-    DALI_TEST_CHECK(r == map[i]["renderPass"].Get<int32_t>());
+    DALI_TEST_CHECK(r == map[i]["renderPassTag"].Get<int32_t>());
   }
 
   END_TEST;
@@ -590,12 +590,12 @@ int UtcDaliShaderProgramPropertyArray(void)
   Property::Map map[2];
   map[0]["vertex"]     = VertexSource;
   map[0]["fragment"]   = FragmentSource;
-  map[0]["renderPass"] = 0;
+  map[0]["renderPassTag"] = 0;
   map[0]["hints"]      = hintSet;
 
   map[1]["vertex"]     = VertexSource2;
   map[1]["fragment"]   = FragmentSource2;
-  map[1]["renderPass"] = 1;
+  map[1]["renderPassTag"] = 1;
   map[1]["hints"]      = hintSet;
 
   Property::Array array;
@@ -617,12 +617,12 @@ int UtcDaliShaderProgramPropertyArray(void)
     std::string          v      = (*outMap)["vertex"].Get<std::string>();
     std::string          f      = (*outMap)["fragment"].Get<std::string>();
     std::string          h      = (*outMap)["hints"].Get<std::string>();
-    int32_t              r      = (*outMap)["renderPass"].Get<int32_t>();
+    int32_t              r      = (*outMap)["renderPassTag"].Get<int32_t>();
 
     DALI_TEST_CHECK(v == map[i]["vertex"].Get<std::string>());
     DALI_TEST_CHECK(f == map[i]["fragment"].Get<std::string>());
     DALI_TEST_CHECK(h == map[i]["hints"].Get<std::string>());
-    DALI_TEST_CHECK(r == map[i]["renderPass"].Get<int32_t>());
+    DALI_TEST_CHECK(r == map[i]["renderPassTag"].Get<int32_t>());
   }
 
   END_TEST;
index a7ffb1f..c4fb4fb 100644 (file)
@@ -58,14 +58,15 @@ public:
    * @param[in] vertexSource   Source code for vertex program
    * @param[in] fragmentSource Source code for fragment program
    * @param[in] hints          Hints for rendering
+   * @param[in] renderPassTag  RenderPassTag to match shader data and render task.
    */
-  ShaderData(std::string vertexSource, std::string fragmentSource, const Dali::Shader::Hint::Value hints, uint32_t renderPass)
+  ShaderData(std::string vertexSource, std::string fragmentSource, const Dali::Shader::Hint::Value hints, uint32_t renderPassTag)
   : mShaderHash(-1),
     mVertexShader(StringToVector(vertexSource)),
     mFragmentShader(StringToVector(fragmentSource)),
     mHints(hints),
     mSourceMode(Graphics::ShaderSourceMode::TEXT),
-    mRenderPass(renderPass)
+    mRenderPassTag(renderPassTag)
   {
   }
 
@@ -74,14 +75,15 @@ public:
    * @param[in] vertexSource   Source code for vertex program
    * @param[in] fragmentSource Source code for fragment program
    * @param[in] hints          Hints for rendering
+   * @param[in] renderPassTag  RenderPassTag to match shader data and render task.
    */
-  ShaderData(std::vector<char>& vertexSource, std::vector<char>& fragmentSource, const Dali::Shader::Hint::Value hints, uint32_t renderPass)
+  ShaderData(std::vector<char>& vertexSource, std::vector<char>& fragmentSource, const Dali::Shader::Hint::Value hints, uint32_t renderPassTag)
   : mShaderHash(-1),
     mVertexShader(vertexSource),
     mFragmentShader(fragmentSource),
     mHints(hints),
     mSourceMode(Graphics::ShaderSourceMode::BINARY),
-    mRenderPass(renderPass)
+    mRenderPassTag(renderPassTag)
   {
   }
 
@@ -233,25 +235,25 @@ public: // API
 
   /**
    * Get Render Pass of shader data
-   * @return Render Pass of this shader data, Default value is 0.
+   * @return RenderPassTag for Render Pass of this shader data, Default value is 0.
    */
-  uint32_t GetRenderPass() const
+  uint32_t GetRenderPassTag() const
   {
-    return mRenderPass;
+    return mRenderPassTag;
   }
 
-private:                                        // Not implemented
-  ShaderData(const ShaderData& other);          ///< no copying of this object
-  ShaderData& operator=(const ShaderData& rhs); ///< no copying of this object
+private:                                         // Not implemented
+  ShaderData(const ShaderData& other);           ///< no copying of this object
+  ShaderData& operator=(const ShaderData& rhs);  ///< no copying of this object
 
-private:                                        // Data
-  std::size_t                mShaderHash;       ///< hash key created with vertex and fragment shader code
-  std::vector<char>          mVertexShader;     ///< source code for vertex program
-  std::vector<char>          mFragmentShader;   ///< source code for fragment program
-  Dali::Shader::Hint::Value  mHints;            ///< take a hint
-  Dali::Vector<uint8_t>      mBuffer;           ///< buffer containing compiled binary bytecode
-  Graphics::ShaderSourceMode mSourceMode;       ///< Source mode of shader data ( text or binary )
-  uint32_t                   mRenderPass{0u};   ///< Render Pass for this shader
+private:                                         // Data
+  std::size_t                mShaderHash;        ///< hash key created with vertex and fragment shader code
+  std::vector<char>          mVertexShader;      ///< source code for vertex program
+  std::vector<char>          mFragmentShader;    ///< source code for fragment program
+  Dali::Shader::Hint::Value  mHints;             ///< take a hint
+  Dali::Vector<uint8_t>      mBuffer;            ///< buffer containing compiled binary bytecode
+  Graphics::ShaderSourceMode mSourceMode;        ///< Source mode of shader data ( text or binary )
+  uint32_t                   mRenderPassTag{0u}; ///< Render Pass Tag for this shader
 };
 
 } // namespace Internal
index 3fe637b..51853be 100644 (file)
@@ -577,18 +577,18 @@ bool RenderTask::ViewportToLocal(Actor* actor, float viewportX, float viewportY,
   return actor->ScreenToLocal(*this, localX, localY, viewportX, viewportY);
 }
 
-void RenderTask::SetRenderPass(uint32_t renderPass)
+void RenderTask::SetRenderPassTag(uint32_t renderPassTag)
 {
-  if(mRenderPass != renderPass)
+  if(mRenderPassTag != renderPassTag)
   {
-    mRenderPass = renderPass;
-    SetRenderPassMessage(GetEventThreadServices(), *GetRenderTaskSceneObject(), renderPass);
+    mRenderPassTag = renderPassTag;
+    SetRenderPassTagMessage(GetEventThreadServices(), *GetRenderTaskSceneObject(), renderPassTag);
   }
 }
 
-uint32_t RenderTask::GetRenderPass() const
+uint32_t RenderTask::GetRenderPassTag() const
 {
-  return mRenderPass;
+  return mRenderPassTag;
 }
 
 const SceneGraph::RenderTask* RenderTask::GetRenderTaskSceneObject() const
index 90c2366..2e49900 100644 (file)
@@ -253,14 +253,14 @@ public:
   bool ViewportToLocal(Actor* actor, float viewportX, float viewportY, float& localX, float& localY) const;
 
   /**
-   * @copydoc Dali::RenderTask::SetRenderPass()
+   * @copydoc Dali::RenderTask::SetRenderPassTag()
    */
-  void SetRenderPass(uint32_t renderPass);
+  void SetRenderPassTag(uint32_t renderPassTag);
 
   /**
-   * @copydoc Dali::RenderTask::GetRenderPass()
+   * @copydoc Dali::RenderTask::GetRenderPassTag()
    */
-  uint32_t GetRenderPass() const;
+  uint32_t GetRenderPassTag() const;
 
 public: // Used by RenderTaskList, which owns the SceneGraph::RenderTasks
   /**
@@ -382,7 +382,7 @@ private:
 
   Dali::RenderTask::ScreenToFrameBufferFunction mScreenToFrameBufferFunction; ///< Used to convert screen to frame-buffer coordinates
 
-  uint32_t mRenderPass{0u};
+  uint32_t mRenderPassTag{0u};
 
   bool mExclusive : 1;    ///< True if the render-task has exclusive access to the source Nodes.
   bool mInputEnabled : 1; ///< True if the render-task should be considered for input handling.
index 1420375..e505140 100644 (file)
@@ -46,7 +46,7 @@ Dali::Scripting::StringEnum ShaderHintsTable[] =
 
 const uint32_t ShaderHintsTableSize = static_cast<uint32_t>(sizeof(ShaderHintsTable) / sizeof(ShaderHintsTable[0]));
 
-static constexpr uint32_t DEFAULT_RENDER_PASS = 0u;
+static constexpr uint32_t DEFAULT_RENDER_PASS_TAG = 0u;
 
 BaseHandle Create()
 {
@@ -88,10 +88,10 @@ Property::Value HintString(const Dali::Shader::Hint::Value& hints)
   return Property::Value(s);
 }
 
-void GetShaderData(const Property::Map& shaderMap, std::string& vertexShader, std::string& fragmentShader, uint32_t& renderPass, Dali::Shader::Hint::Value& hints)
+void GetShaderData(const Property::Map& shaderMap, std::string& vertexShader, std::string& fragmentShader, uint32_t& renderPassTag, Dali::Shader::Hint::Value& hints)
 {
   hints      = Dali::Shader::Hint::NONE;
-  renderPass = 0u;
+  renderPassTag = 0u;
 
   if(Property::Value* value = shaderMap.Find("vertex"))
   {
@@ -103,9 +103,9 @@ void GetShaderData(const Property::Map& shaderMap, std::string& vertexShader, st
     fragmentShader = value->Get<std::string>();
   }
 
-  if(Property::Value* value = shaderMap.Find("renderPass"))
+  if(Property::Value* value = shaderMap.Find("renderPassTag"))
   {
-    renderPass = static_cast<uint32_t>(value->Get<int32_t>());
+    renderPassTag = static_cast<uint32_t>(value->Get<int32_t>());
   }
 
   if(Property::Value* value = shaderMap.Find("hints"))
@@ -135,7 +135,7 @@ ShaderPtr Shader::New(std::string_view          vertexShader,
   AddShaderMessage(updateManager, transferOwnership);
 
   services.RegisterObject(shader.Get());
-  shader->UpdateShaderData(vertexShader, fragmentShader, DEFAULT_RENDER_PASS, hints);
+  shader->UpdateShaderData(vertexShader, fragmentShader, DEFAULT_RENDER_PASS_TAG, hints);
 
   return shader;
 }
@@ -188,7 +188,7 @@ Property::Value Shader::GetDefaultProperty(Property::Index index) const
         Dali::Property::Map map;
         map["vertex"]     = Property::Value(mShaderDataList.front()->GetVertexShader());
         map["fragment"]   = Property::Value(mShaderDataList.front()->GetFragmentShader());
-        map["renderPass"] = Property::Value(static_cast<int32_t>(mShaderDataList.front()->GetRenderPass()));
+        map["renderPassTag"] = Property::Value(static_cast<int32_t>(mShaderDataList.front()->GetRenderPassTag()));
         map["hints"]      = HintString(mShaderDataList.front()->GetHints());
         value             = map;
       }
@@ -202,7 +202,7 @@ Property::Value Shader::GetDefaultProperty(Property::Index index) const
             Dali::Property::Map map;
             map["vertex"]     = Property::Value(shaderData->GetVertexShader());
             map["fragment"]   = Property::Value(shaderData->GetFragmentShader());
-            map["renderPass"] = Property::Value(static_cast<int32_t>(shaderData->GetRenderPass()));
+            map["renderPassTag"] = Property::Value(static_cast<int32_t>(shaderData->GetRenderPassTag()));
             map["hints"]      = HintString(shaderData->GetHints());
             array.PushBack(map);
           }
@@ -228,17 +228,17 @@ Shader::Shader(const SceneGraph::Shader* sceneObject)
 
 void Shader::UpdateShaderData(std::string_view          vertexSource,
                               std::string_view          fragmentSource,
-                              uint32_t                  renderPass,
+                              uint32_t                  renderPassTag,
                               Dali::Shader::Hint::Value hints)
 {
   // Try to load a pre-compiled shader binary for the source pair:
   ThreadLocalStorage&     tls           = ThreadLocalStorage::Get();
   ShaderFactory&          shaderFactory = tls.GetShaderFactory();
   size_t                  shaderHash;
-  Internal::ShaderDataPtr shaderData = shaderFactory.Load(vertexSource, fragmentSource, hints, renderPass, shaderHash);
+  Internal::ShaderDataPtr shaderData = shaderFactory.Load(vertexSource, fragmentSource, hints, renderPassTag, shaderHash);
 
   std::vector<Internal::ShaderDataPtr>::iterator shaderDataIterator = std::find_if(mShaderDataList.begin(), mShaderDataList.end(), [&shaderData](const Internal::ShaderDataPtr& shaderDataItem)
-                                                                                   { return shaderDataItem->GetRenderPass() == shaderData->GetRenderPass(); });
+                                                                                   { return shaderDataItem->GetRenderPassTag() == shaderData->GetRenderPassTag(); });
   if(shaderDataIterator != mShaderDataList.end())
   {
     *shaderDataIterator = shaderData;
@@ -261,11 +261,11 @@ void Shader::SetShaderProperty(const Dali::Property::Value& shaderMap)
     {
       std::string               vertex;
       std::string               fragment;
-      uint32_t                  renderPass{0u};
+      uint32_t                  renderPassTag{0u};
       Dali::Shader::Hint::Value hints(Dali::Shader::Hint::NONE);
-      GetShaderData(*map, vertex, fragment, renderPass, hints);
+      GetShaderData(*map, vertex, fragment, renderPassTag, hints);
 
-      UpdateShaderData(vertex, fragment, renderPass, hints);
+      UpdateShaderData(vertex, fragment, renderPassTag, hints);
     }
   }
   else if(shaderMap.GetType() == Property::ARRAY)
@@ -281,11 +281,11 @@ void Shader::SetShaderProperty(const Dali::Property::Value& shaderMap)
         {
           std::string               vertex;
           std::string               fragment;
-          uint32_t                  renderPass{0u};
+          uint32_t                  renderPassTag{0u};
           Dali::Shader::Hint::Value hints(Dali::Shader::Hint::NONE);
-          GetShaderData(*map, vertex, fragment, renderPass, hints);
+          GetShaderData(*map, vertex, fragment, renderPassTag, hints);
 
-          UpdateShaderData(vertex, fragment, renderPass, hints);
+          UpdateShaderData(vertex, fragment, renderPassTag, hints);
         }
       }
     }
index 76b4283..ca32c18 100644 (file)
@@ -89,14 +89,14 @@ private: // implementation
 
   /**
    * @brief Update Shader Data
-   * If a ShaderData of the same renderPass is already exist, it is replaced,
+   * If a ShaderData of the same renderPassTag is already exist, it is replaced,
    * if not, new ShaderData is added.
    * @param[in] vertexShader Vertex shader code for the effect.
    * @param[in] fragmentShader Fragment Shader code for the effect.
-   * @param[in] renderPass render pass of shader data
+   * @param[in] renderPassTag render pass tag of this shader data
    * @param[in] hints Hints to define the geometry of the rendered object
    */
-  void UpdateShaderData(std::string_view vertexShader, std::string_view fragmentShader, uint32_t renderPass, Dali::Shader::Hint::Value hints);
+  void UpdateShaderData(std::string_view vertexShader, std::string_view fragmentShader, uint32_t renderPassTag, Dali::Shader::Hint::Value hints);
 
   /**
    * @brief Sets shader data from shaderMap.
index 95ddd5f..ba51050 100644 (file)
@@ -144,7 +144,7 @@ public:                                  // Data
   bool     mIgnoreRenderToFbo : 1;       ///< Whether to ignore the render to FBO option (used to measure the performance above 60 fps)
 
   Render::FrameBuffer* mFrameBuffer;
-  uint32_t             mRenderPass{0u};
+  uint32_t             mRenderPassTag{0u};
 
 private:                                             // Data
   Camera*                       mCamera;             ///< camera that is used
index 56fc55c..d3e18fe 100644 (file)
@@ -555,7 +555,7 @@ bool Renderer::Render(Graphics::CommandBuffer&                             comma
   }
 
   // Create Program
-  ShaderDataPtr shaderData = mRenderDataProvider->GetShader().GetShaderData(instruction.mRenderPass);
+  ShaderDataPtr shaderData = mRenderDataProvider->GetShader().GetShaderData(instruction.mRenderPassTag);
   if(!shaderData)
   {
     DALI_LOG_ERROR("Failed to get shader data.\n");
index 6fedd4d..5e03ec1 100644 (file)
@@ -34,7 +34,7 @@ namespace SceneGraph
 
 namespace
 {
-static constexpr uint32_t DEFAULT_RENDER_PASS = 0u;
+static constexpr uint32_t DEFAULT_RENDER_PASS_TAG = 0u;
 }
 
 Shader::~Shader()
@@ -45,7 +45,7 @@ void Shader::UpdateShaderData(ShaderDataPtr shaderData)
 {
   DALI_LOG_TRACE_METHOD_FMT(Debug::Filter::gShader, "%d\n", shaderData->GetHashValue());
   std::vector<Internal::ShaderDataPtr>::iterator shaderDataIterator = std::find_if(mShaderDataList.begin(), mShaderDataList.end(), [&shaderData](const Internal::ShaderDataPtr& shaderDataItem)
-                                                                                   { return shaderDataItem->GetRenderPass() == shaderData->GetRenderPass(); });
+                                                                                   { return shaderDataItem->GetRenderPassTag() == shaderData->GetRenderPassTag(); });
   if(shaderDataIterator != mShaderDataList.end())
   {
     *shaderDataIterator = shaderData;
@@ -56,7 +56,7 @@ void Shader::UpdateShaderData(ShaderDataPtr shaderData)
   }
 }
 
-ShaderDataPtr Shader::GetShaderData(uint32_t renderPass) const
+ShaderDataPtr Shader::GetShaderData(uint32_t renderPassTag) const
 {
   if(mShaderDataList.empty())
   {
@@ -66,11 +66,11 @@ ShaderDataPtr Shader::GetShaderData(uint32_t renderPass) const
   Internal::ShaderDataPtr returnShaderData = nullptr;
   for(auto && shaderData : mShaderDataList)
   {
-    if(shaderData->GetRenderPass() == renderPass)
+    if(shaderData->GetRenderPassTag() == renderPassTag)
     {
       return shaderData;
     }
-    if(shaderData->GetRenderPass() == DEFAULT_RENDER_PASS)
+    if(shaderData->GetRenderPassTag() == DEFAULT_RENDER_PASS_TAG)
     {
       returnShaderData = shaderData;
     }
index fbd3ea2..e6cc5c0 100644 (file)
@@ -67,7 +67,7 @@ public:
    * Get the shader data for this shader.
    * @return The shader data.
    */
-  [[nodiscard]] ShaderDataPtr GetShaderData(uint32_t renderPass) const;
+  [[nodiscard]] ShaderDataPtr GetShaderData(uint32_t renderPassTag) const;
 
 private: // Data
   Dali::Shader::Hint::Value mHints;
index cadee80..f22fc11 100644 (file)
@@ -563,7 +563,7 @@ void RenderInstructionProcessor::Prepare(BufferIndex                 updateBuffe
       {
         renderList->SetHasColorRenderItems(true);
         AddRenderersToRenderList(updateBufferIndex,
-                                 instruction.mRenderPass,
+                                 instruction.mRenderPassTag,
                                  *renderList,
                                  renderables,
                                  viewMatrix,
@@ -592,7 +592,7 @@ void RenderInstructionProcessor::Prepare(BufferIndex                 updateBuffe
       {
         renderList->SetHasColorRenderItems(false);
         AddRenderersToRenderList(updateBufferIndex,
-                                 instruction.mRenderPass,
+                                 instruction.mRenderPassTag,
                                  *renderList,
                                  renderables,
                                  viewMatrix,
index 3c34d7a..b2de30a 100644 (file)
@@ -139,7 +139,7 @@ inline void SetSyncRequiredMessage(EventThreadServices& eventThreadServices, con
   new(slot) LocalType(&task, &RenderTask::SetSyncRequired, requiresSync);
 }
 
-inline void SetRenderPassMessage(EventThreadServices& eventThreadServices, const RenderTask& task, uint32_t renderPass)
+inline void SetRenderPassTagMessage(EventThreadServices& eventThreadServices, const RenderTask& task, uint32_t renderPass)
 {
   using LocalType = MessageValue1<RenderTask, uint32_t>;
 
@@ -147,7 +147,7 @@ inline void SetRenderPassMessage(EventThreadServices& eventThreadServices, const
   uint32_t* slot = eventThreadServices.ReserveMessageSlot(sizeof(LocalType));
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
-  new(slot) LocalType(&task, &RenderTask::SetRenderPass, renderPass);
+  new(slot) LocalType(&task, &RenderTask::SetRenderPassTag, renderPass);
 }
 
 } // namespace Dali::Internal::SceneGraph
index d325308..352d2a3 100644 (file)
@@ -393,7 +393,7 @@ RenderInstruction& RenderTask::PrepareRenderInstruction(BufferIndex updateBuffer
     mRenderInstruction[updateBufferIndex].mRenderTracker = nullptr;
   }
 
-  mRenderInstruction[updateBufferIndex].mRenderPass = mRenderPass;
+  mRenderInstruction[updateBufferIndex].mRenderPassTag = mRenderPassTag;
   return mRenderInstruction[updateBufferIndex];
 }
 
@@ -456,9 +456,9 @@ void RenderTask::SetSyncRequired(bool requiresSync)
   mRequiresSync = requiresSync;
 }
 
-void RenderTask::SetRenderPass(uint32_t renderPass)
+void RenderTask::SetRenderPassTag(uint32_t renderPassTag)
 {
-  mRenderPass = renderPass;
+  mRenderPassTag = renderPassTag;
 }
 
 void RenderTask::PropertyOwnerConnected(PropertyOwner& owner)
index e52c4e3..3ff90fc 100644 (file)
@@ -358,9 +358,9 @@ public:
    * Shader code that matches this render pass is used for rendering.
    * If no matching shader is found, the code with a render pass of 0 is used.
    * In other cases, operation is not guaranteed.
-   * @param[in] renderPass RenderPass value for this render task.
+   * @param[in] renderPassTag RenderPassTag value for this render task.
    */
-  void SetRenderPass(uint32_t renderPass);
+  void SetRenderPassTag(uint32_t renderPassTag);
 
 private: // from PropertyOwner::Observer
   /**
@@ -418,7 +418,7 @@ private:
 
   State mState;                            ///< Render state.
 
-  uint32_t mRenderPass{0u};
+  uint32_t mRenderPassTag{0u};
 
   bool mRequiresSync : 1;    ///< Whether sync is needed to track the render
   bool mActive : 1;          ///< True when the task is active, i.e. has valid source and camera
index 29e6820..9740581 100644 (file)
@@ -273,14 +273,14 @@ bool RenderTask::ViewportToLocal(Actor actor, float viewportX, float viewportY,
   }
 }
 
-void RenderTask::SetRenderPass(uint32_t renderPass)
+void RenderTask::SetRenderPassTag(uint32_t renderPassTag)
 {
-  GetImplementation(*this).SetRenderPass(renderPass);
+  GetImplementation(*this).SetRenderPassTag(renderPassTag);
 }
 
-uint32_t RenderTask::GetRenderPass() const
+uint32_t RenderTask::GetRenderPassTag() const
 {
-  return GetImplementation(*this).GetRenderPass();
+  return GetImplementation(*this).GetRenderPassTag();
 }
 
 RenderTask::RenderTask(Internal::RenderTask* internal)
index f4997cc..8d0b356 100644 (file)
@@ -540,15 +540,16 @@ public:
    * Shader code that matches this render pass is used for rendering.
    * If no matching shader is found, the code with a render pass of 0 is used.
    * In other cases, operation is not guaranteed.
-   * @param[in] renderPass RenderPass value for this render task.
+   * @param[in] renderPassTag RenderPassTag value for this render task.
+   * @note RenderPassTag of default RenderTask is 0u.
    */
-  void SetRenderPass(uint32_t renderPass);
+  void SetRenderPassTag(uint32_t renderPassTag);
 
   /**
    * Gets Render Pass key for this RenderTask.
-   * @return RenderPass value for this render task.
+   * @return RenderPassTag value for this render task.
    */
-  uint32_t GetRenderPass() const;
+  uint32_t GetRenderPassTag() const;
 
 public: // Signals
   /**
index 5295d52..b7b6069 100644 (file)
@@ -110,7 +110,7 @@ public:
        * @brief Name: "program", Type: MAP or ARRAY.
        * @note The default value is empty.
        * @note It is Property::Map or Property::Array of the map.
-       * @note Format: {"renderPass":"", "vertex":"", "fragment":"", "hints":""}
+       * @note Format: {"renderPassTag":"", "vertex":"", "fragment":"", "hints":""}
        * @SINCE_1_1.43
        */
       PROGRAM = DEFAULT_OBJECT_PROPERTY_START_INDEX,
@@ -135,7 +135,7 @@ public:
    *
    * @SINCE_2_2.31
    * @param[in] shaderMap Property::Map of shader data or Property::Array of Property::Map.
-   * Property::Map format is {"renderPass":"", "vertex":"", "fragment":"", "hints":""}
+   * Property::Map format is {"renderPassTag":"", "vertex":"", "fragment":"", "hints":""}
    * shaderMap can be Property::Array of Property::Map for multi pass shading.
    * @return A handle to a shader effect
    */