X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-scene3d%2Fpublic-api%2Floader%2Fshader-definition.h;h=743d34347b8cdd22b12070372858413ccfb26340;hb=HEAD;hp=3d3236b0365341b8bc3b6abd2d9f1da2e93b6340;hpb=d3ab7a4cc307562e687de2b2751f2f0a687c2835;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-scene3d/public-api/loader/shader-definition.h b/dali-scene3d/public-api/loader/shader-definition.h index 3d3236b..743d343 100644 --- a/dali-scene3d/public-api/loader/shader-definition.h +++ b/dali-scene3d/public-api/loader/shader-definition.h @@ -1,7 +1,7 @@ #ifndef DALI_SCENE3D_LOADER_SHADER_DEFINITION_H #define DALI_SCENE3D_LOADER_SHADER_DEFINITION_H /* - * Copyright (c) 2022 Samsung Electronics Co., Ltd. + * Copyright (c) 2023 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. @@ -17,24 +17,22 @@ * */ -// INTERNAL INCLUDES -#include "dali-scene3d/public-api/loader/renderer-state.h" - // EXTERNAL INCLUDES +#include +#include #include -#include "dali/public-api/common/vector-wrapper.h" -#include "dali/public-api/rendering/shader.h" -namespace Dali -{ -namespace Scene3D -{ -namespace Loader +// INTERNAL INCLUDES +#include +#include + +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,32 +42,31 @@ struct DALI_SCENE3D_API ShaderDefinition { std::string mVertexShaderSource; std::string mFragmentShaderSource; + std::string mShadowVertexShaderSource; + 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; @@ -78,16 +75,15 @@ public: // DATA std::shared_ptr mRawData; RendererState::Type mRendererState = RendererState::NONE; - std::string mVertexShaderPath; - std::string mFragmentShaderPath; - std::vector mDefines; - std::vector mHints; - Property::Map mUniforms; - bool mUseBuiltInShader{false}; + std::string mVertexShaderPath; + std::string mFragmentShaderPath; + std::vector mDefines; + std::vector mMacros; + std::vector mHints; + Property::Map mUniforms; + bool mUseBuiltInShader{false}; }; -} // namespace Loader -} // namespace Scene3D -} // namespace Dali +} // namespace Dali::Scene3D::Loader #endif // DALI_SCENE3D_LOADER_SHADER_DEFINITION_H