Merge branch 'devel/master' into tizen
[platform/core/uifw/dali-toolkit.git] / dali-scene3d / public-api / loader / shader-option.h
index bca29f7..063d4c0 100644 (file)
@@ -33,25 +33,25 @@ class DALI_SCENE3D_API ShaderOption
 public:
   enum class Type
   {
-    GLTF_CHANNELS = 0,
-    THREE_TEXTURE,
-    BASE_COLOR_TEXTURE,
-    METALLIC_ROUGHNESS_TEXTURE,
-    NORMAL_TEXTURE,
-    OCCLUSION,
-    EMISSIVE,
-    ALPHA_TEST,
-    SUBSURFACE,
-    SPECULAR,
-    SPECULAR_COLOR,
-    SKINNING,
-    FLIP_UVS_VERTICAL,
-    COLOR_ATTRIBUTE,
-    VEC4_TANGENT,
-    MORPH_POSITION,
-    MORPH_NORMAL,
-    MORPH_TANGENT,
-    MORPH_VERSION_2_0
+    GLTF_CHANNELS = 0,          // 00001
+    THREE_TEXTURE,              // 00002
+    BASE_COLOR_TEXTURE,         // 00004
+    METALLIC_ROUGHNESS_TEXTURE, // 00008
+    NORMAL_TEXTURE,             // 00010
+    OCCLUSION,                  // 00020
+    EMISSIVE,                   // 00040
+    ALPHA_TEST,                 // 00080
+    SUBSURFACE,                 // 00100
+    SPECULAR,                   // 00200
+    SPECULAR_COLOR,             // 00400
+    SKINNING,                   // 00800
+    FLIP_UVS_VERTICAL,          // 01000
+    COLOR_ATTRIBUTE,            // 02000
+    VEC4_TANGENT,               // 04000
+    MORPH_POSITION,             // 08000
+    MORPH_NORMAL,               // 10000
+    MORPH_TANGENT,              // 20000
+    MORPH_VERSION_2_0           // 40000
   };
 
   struct MacroDefinition
@@ -64,40 +64,48 @@ public:
   ShaderOption(const ShaderOption& rhs);
   ShaderOption& operator=(const ShaderOption& rhs);
 
+  using HashType = uint64_t;
+
 public:
   /**
    * @brief Sets transparency option.
+   * @SINCE_2_2.33
    */
   void SetTransparency();
 
   /**
    * @brief Adds new shader definition option.
-   * If the option is already added, nothin is changed.
    *
+   * If the option is already added, nothin is changed.
+   * @SINCE_2_2.33
    * @param[in] shaderOptionType Option to be added,
    */
   void AddOption(Type shaderOptionType);
 
   /**
-   * Adds macro definitions for joints based on the number of joint sets.
+   * @brief Adds macro definitions for joints based on the number of joint sets.
+   * @SINCE_2_2.52
    */
   void AddJointMacros(size_t numberOfJointSets);
 
   /**
-   * Enables empty preprocessor definitions to be defined to a value
+   * @brief Enables empty preprocessor definitions to be defined to a value.
+   * @SINCE_2_2.52
    */
   void AddMacroDefinition(std::string macro, std::string definition);
 
   /**
    * @brief Retrieves current shader option hash
    *
+   * @SINCE_2_2.33
    * @return Hash value of currently added options.
    */
-  uint64_t GetOptionHash() const;
+  HashType GetOptionHash() const;
 
   /**
    * @brief Retrieves a list of define keywords.
    *
+   * @SINCE_2_2.33
    * @param[out] defines A list of define keywords those are used in this option.
    */
   void GetDefines(std::vector<std::string>& defines) const;
@@ -105,18 +113,20 @@ public:
   /**
    * @brief Retrieves a single shader define keyword of input type.
    *
+   * @SINCE_2_2.33
    * @param[in] shaderOptionType Shader definition option type to know its keyword.
    * @return string keyword of shader define.
    */
   static std::string_view GetDefineKeyword(Type shaderOptionType);
 
   /**
-   * Get any macro definitions
+   * @brief Get any macro definitions.
+   * @SINCE_2_2.52
    */
   const std::vector<MacroDefinition>& GetMacroDefinitions() const;
 
 private:
-  uint64_t mOptionHash{0u};
+  HashType mOptionHash{0u};
 
   std::vector<MacroDefinition> mMacros;
 };