[dali_2.3.23] Merge branch 'devel/master'
[platform/core/uifw/dali-toolkit.git] / dali-scene3d / public-api / loader / shader-definition.h
index 0fe83d3..743d343 100644 (file)
 
 // INTERNAL INCLUDES
 #include <dali-scene3d/public-api/loader/renderer-state.h>
+#include <dali-scene3d/public-api/loader/shader-option.h>
 
 namespace Dali::Scene3D::Loader
 {
-/*
+/**
  * @brief Defines a shader with paths to the files which define its
  *  vertex and fragment components, and a mapping of uniform names (which are
  *  used to refer to them in GLSL) to data.
+ * @SINCE_2_0.7
  */
 struct DALI_SCENE3D_API ShaderDefinition
 {
@@ -44,30 +46,27 @@ struct DALI_SCENE3D_API ShaderDefinition
     std::string mShadowFragmentShaderSource;
   };
 
-  /*
-   * @brief Apply the defines values to shader.
-   */
-  static void ApplyDefine(std::string& shaderCode, const std::string& definevar);
-
   ShaderDefinition() = default;
 
   ShaderDefinition(const ShaderDefinition& other);
-  ShaderDefinition& operator=(const ShaderDefinition& other);
+  ShaderDefinition& operator=(const ShaderDefinition& other) = delete;
 
-  ShaderDefinition(ShaderDefinition&&)            = default;
+  ShaderDefinition(ShaderDefinition&&) = default;
   ShaderDefinition& operator=(ShaderDefinition&&) = default;
 
-  /*
+  /**
    * @brief Attempts to load the source of the vertex and fragment shaders,
    *  then performs pre-processing of defines.
+   * @SINCE_2_0.7
    * @note This may be called from any thread.
    */
   RawData LoadRaw(const std::string& shadersPath) const;
 
-  /*
+  /**
    * @brief Creates a DALi Shader from the sources in @a raw, traverses
    *  uniforms to get them to register their data against their name,
    *  then returns the Shader.
+   * @SINCE_2_0.7
    * @note This must be called from the event thread.
    */
   Shader Load(RawData&& raw) const;
@@ -76,12 +75,13 @@ public: // DATA
   std::shared_ptr<RawData> mRawData;
   RendererState::Type      mRendererState = RendererState::NONE;
 
-  std::string              mVertexShaderPath;
-  std::string              mFragmentShaderPath;
-  std::vector<std::string> mDefines;
-  std::vector<std::string> mHints;
-  Property::Map            mUniforms;
-  bool                     mUseBuiltInShader{false};
+  std::string                                mVertexShaderPath;
+  std::string                                mFragmentShaderPath;
+  std::vector<std::string>                   mDefines;
+  std::vector<ShaderOption::MacroDefinition> mMacros;
+  std::vector<std::string>                   mHints;
+  Property::Map                              mUniforms;
+  bool                                       mUseBuiltInShader{false};
 };
 
 } // namespace Dali::Scene3D::Loader