Revert "[Tizen] Apply precompile shader"
authorEunki, Hong <eunkiki.hong@samsung.com>
Wed, 25 Oct 2023 07:42:52 +0000 (16:42 +0900)
committerEunki, Hong <eunkiki.hong@samsung.com>
Wed, 25 Oct 2023 07:42:52 +0000 (16:42 +0900)
This reverts commit 6dc98c1ee5770c402af474654329103077443919.

dali-toolkit/devel-api/visual-factory/visual-factory.cpp
dali-toolkit/devel-api/visual-factory/visual-factory.h
dali-toolkit/internal/visuals/image-visual-shader-factory.cpp
dali-toolkit/internal/visuals/image-visual-shader-factory.h
dali-toolkit/internal/visuals/visual-factory-cache.h
dali-toolkit/internal/visuals/visual-factory-impl.cpp
dali-toolkit/internal/visuals/visual-factory-impl.h

index dce3109..6575c7d 100644 (file)
@@ -111,11 +111,6 @@ bool VisualFactory::GetPreMultiplyOnLoad() const
   return GetImplementation(*this).GetPreMultiplyOnLoad();
 }
 
-void VisualFactory::UsePreCompiledShader()
-{
-  GetImplementation(*this).UsePreCompiledShader();
-}
-
 } // namespace Toolkit
 
 } // namespace Dali
index bf861f7..1d6be15 100644 (file)
@@ -126,17 +126,6 @@ public:
    */
   bool GetPreMultiplyOnLoad() const;
 
-  /**
-   * @brief Compile the visual shader in advance. Afterwards,
-   * when a visual using a new shader is requested, the pre-compiled shader is used.
-   *
-   * @note It is recommended that this method be called at the top of the application code.
-   * @note Using precompiled shaders is helpful when the application is complex and uses
-   * many different styles of visual options. On the other hand,if most visuals are the same
-   * and the application is simple, it may use memory unnecessarily or slow down the application launching speed.
-   */
-  void UsePreCompiledShader();
-
 private:
   explicit DALI_INTERNAL VisualFactory(Internal::VisualFactory* impl);
 };
index ac7d7de..9761015 100644 (file)
@@ -36,50 +36,8 @@ namespace
 const Vector4 FULL_TEXTURE_RECT(0.f, 0.f, 1.f, 1.f);
 
 const int NATIVE_SHADER_TYPE_OFFSET = VisualFactoryCache::ShaderType::NATIVE_IMAGE_SHADER - VisualFactoryCache::ShaderType::IMAGE_SHADER;
-
 } // unnamed namespace
 
-static constexpr auto          SHADER_TYPE_COUNT = 16u;
-
-const std::string_view VertexPredefines[SHADER_TYPE_COUNT]
-{
-  "", // VisualFactoryCache::IMAGE_SHADER,
-  "#define IS_REQUIRED_ROUNDED_CORNER\n", //VisualFactoryCache::IMAGE_SHADER_ROUNDED_CORNER,
-  "#define IS_REQUIRED_BORDERLINE\n", //VisualFactoryCache::IMAGE_SHADER_BORDERLINE,
-  "#define IS_REQUIRED_ROUNDED_CORNER\n#define IS_REQUIRED_BORDERLINE\n", //VisualFactoryCache::IMAGE_SHADER_ROUNDED_BORDERLINE,
-  "#define IS_REQUIRED_ALPHA_MASKING\n", // VisualFactoryCache::IMAGE_SHADER_MASKING,
-  "#define IS_REQUIRED_ROUNDED_CORNER\n#define IS_REQUIRED_ALPHA_MASKING\n",//VisualFactoryCache::IMAGE_SHADER_ROUNDED_CORNER_MASKING,
-  "#define IS_REQUIRED_BORDERLINE\n#define IS_REQUIRED_ALPHA_MASKING\n",//VisualFactoryCache::IMAGE_SHADER_BORDERLINE_MASKING,
-  "#define IS_REQUIRED_ROUNDED_CORNER\n#define IS_REQUIRED_BORDERLINE\n#define IS_REQUIRED_ALPHA_MASKING\n",//VisualFactoryCache::IMAGE_SHADER_ROUNDED_BORDERLINE_MASKING,
-  "",//VisualFactoryCache::IMAGE_SHADER_YUV_TO_RGB,
-  "#define IS_REQUIRED_ROUNDED_CORNER\n",//VisualFactoryCache::IMAGE_SHADER_ROUNDED_CORNER_YUV_TO_RGB,
-  "#define IS_REQUIRED_BORDERLINE\n",//VisualFactoryCache::IMAGE_SHADER_BORDERLINE_YUV_TO_RGB,
-  "#define IS_REQUIRED_ROUNDED_CORNER\n#define IS_REQUIRED_BORDERLINE\n",//VisualFactoryCache::IMAGE_SHADER_ROUNDED_BORDERLINE_YUV_TO_RGB};
-  "",//VisualFactoryCache::IMAGE_SHADER_YUV_AND_RGB,
-  "#define IS_REQUIRED_ROUNDED_CORNER\n",//VisualFactoryCache::IMAGE_SHADER_ROUNDED_CORNER_YUV_AND_RGB,
-  "#define IS_REQUIRED_BORDERLINE\n",//VisualFactoryCache::IMAGE_SHADER_BORDERLINE_YUV_AND_RGB,
-  "#define IS_REQUIRED_ROUNDED_CORNER\n#define IS_REQUIRED_BORDERLINE\n"//VisualFactoryCache::IMAGE_SHADER_ROUNDED_BORDERLINE_YUV_AND_RGB};
-};
-const std::string_view FragmentPredefines[SHADER_TYPE_COUNT]
-{
-  "", // VisualFactoryCache::IMAGE_SHADER,
-  "#define IS_REQUIRED_ROUNDED_CORNER\n", //VisualFactoryCache::IMAGE_SHADER_ROUNDED_CORNER,
-  "#define IS_REQUIRED_BORDERLINE\n", //VisualFactoryCache::IMAGE_SHADER_BORDERLINE,
-  "#define IS_REQUIRED_ROUNDED_CORNER\n#define IS_REQUIRED_BORDERLINE\n", //VisualFactoryCache::IMAGE_SHADER_ROUNDED_BORDERLINE,
-  "#define IS_REQUIRED_ALPHA_MASKING\n", // VisualFactoryCache::IMAGE_SHADER_MASKING,
-  "#define IS_REQUIRED_ROUNDED_CORNER\n#define IS_REQUIRED_ALPHA_MASKING\n",//VisualFactoryCache::IMAGE_SHADER_ROUNDED_CORNER_MASKING,
-  "#define IS_REQUIRED_BORDERLINE\n#define IS_REQUIRED_ALPHA_MASKING\n",//VisualFactoryCache::IMAGE_SHADER_BORDERLINE_MASKING,
-  "#define IS_REQUIRED_ROUNDED_CORNER\n#define IS_REQUIRED_BORDERLINE\n#define IS_REQUIRED_ALPHA_MASKING\n",//VisualFactoryCache::IMAGE_SHADER_ROUNDED_BORDERLINE_MASKING,
-  "#define IS_REQUIRED_YUV_TO_RGB\n",//VisualFactoryCache::IMAGE_SHADER_YUV_TO_RGB,
-  "#define IS_REQUIRED_YUV_TO_RGB\n#define IS_REQUIRED_ROUNDED_CORNER\n",//VisualFactoryCache::IMAGE_SHADER_ROUNDED_CORNER_YUV_TO_RGB,
-  "#define IS_REQUIRED_YUV_TO_RGB\n#define IS_REQUIRED_BORDERLINE\n",//VisualFactoryCache::IMAGE_SHADER_BORDERLINE_YUV_TO_RGB,
-  "#define IS_REQUIRED_YUV_TO_RGB\n#define IS_REQUIRED_ROUNDED_CORNER\n#define IS_REQUIRED_BORDERLINE\n",//VisualFactoryCache::IMAGE_SHADER_ROUNDED_BORDERLINE_YUV_TO_RGB};
-  "#define IS_REQUIRED_UNIFIED_YUV_AND_RGB\n",//VisualFactoryCache::IMAGE_SHADER_YUV_AND_RGB,
-  "#define IS_REQUIRED_UNIFIED_YUV_AND_RGB\n#define IS_REQUIRED_ROUNDED_CORNER\n",//VisualFactoryCache::IMAGE_SHADER_ROUNDED_CORNER_YUV_AND_RGB,
-  "#define IS_REQUIRED_UNIFIED_YUV_AND_RGB\n#define IS_REQUIRED_BORDERLINE\n",//VisualFactoryCache::IMAGE_SHADER_BORDERLINE_YUV_AND_RGB,
-  "#define IS_REQUIRED_UNIFIED_YUV_AND_RGB\n#define IS_REQUIRED_ROUNDED_CORNER\n#define IS_REQUIRED_BORDERLINE\n"//VisualFactoryCache::IMAGE_SHADER_ROUNDED_BORDERLINE_YUV_AND_RGB};
-};
-
 ImageVisualShaderFactory::ImageVisualShaderFactory()
 : mFragmentShaderNeedChange(ImageVisualShaderFeature::ChangeFragmentShader::UNDECIDED)
 {
@@ -169,26 +127,6 @@ std::string_view ImageVisualShaderFactory::GetFragmentShaderSource()
   return gFragmentShaderNoAtlas;
 }
 
-void ImageVisualShaderFactory::GetPrecompiledShader(RawShaderData& shaders)
-{
-  std::vector<std::string_view> vertexPrefix;
-  std::vector<std::string_view> fragmentPrefix;
-  shaders.shaderCount = 0;
-  int shaderCount = 0;
-  for(int i=0; i< SHADER_TYPE_COUNT; ++i)
-  {
-    vertexPrefix.push_back(VertexPredefines[i]);
-    fragmentPrefix.push_back(FragmentPredefines[i]);
-    shaderCount++;
-  }
-
-  shaders.vertexPrefix= vertexPrefix;
-  shaders.fragmentPrefix = fragmentPrefix;
-  shaders.vertexShader = SHADER_IMAGE_VISUAL_SHADER_VERT;
-  shaders.fragmentShader = SHADER_IMAGE_VISUAL_SHADER_FRAG;
-  shaders.shaderCount += shaderCount;
-}
-
 } // namespace Internal
 
 } // namespace Toolkit
index 1a591a4..cf1c25b 100644 (file)
@@ -67,12 +67,6 @@ public:
    */
   std::string_view GetFragmentShaderSource();
 
-  /**
-   * @brief Get the default shader source.
-   * @param[in] shaders shaderList for precompile
-   */
-  void GetPrecompiledShader(RawShaderData& shaders);
-
 protected:
   /**
    * Undefined copy constructor.
index 934333d..f1d9703 100644 (file)
@@ -23,7 +23,6 @@
 #include <dali/public-api/object/ref-object.h>
 #include <dali/public-api/rendering/geometry.h>
 #include <dali/public-api/rendering/shader.h>
-#include <dali/integration-api/shader-precompiler.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/internal/texture-manager/texture-manager-impl.h>
index bb73247..c1cf764 100644 (file)
@@ -378,20 +378,6 @@ bool VisualFactory::GetPreMultiplyOnLoad() const
   return mPreMultiplyOnLoad;
 }
 
-void VisualFactory::UsePreCompiledShader()
-{
-  if(mPrecompiledShaderRequested)
-  {
-    return;
-  }
-  mPrecompiledShaderRequested = true;
-
-  RawShaderData rawShaderData;
-  Integration::ShaderPrecompiler::Get().Enable();
-  GetImageVisualShaderFactory().GetPrecompiledShader(rawShaderData);
-  Integration::ShaderPrecompiler::Get().SavePrecomipleShaderList(rawShaderData);
-}
-
 Internal::TextureManager& VisualFactory::GetTextureManager()
 {
   return GetFactoryCache().GetTextureManager();
@@ -430,9 +416,6 @@ Internal::VisualFactoryCache& VisualFactory::GetFactoryCache()
     }
     SetBrokenImageUrl(styleManager);
   }
-
-  //UsePreCompiledShader(); // Call forcelly
-
   return *mFactoryCache;
 }
 
index a3bc7cc..1e5ac93 100644 (file)
@@ -19,7 +19,6 @@
 
 // EXTERNAL INCLUDES
 #include <dali/public-api/object/base-object.h>
-#include <dali/integration-api/shader-precompiler.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/devel-api/visual-factory/visual-base.h>
@@ -86,11 +85,6 @@ public:
   bool GetPreMultiplyOnLoad() const;
 
   /**
-   * @copydoc Toolkit::VisualFactory::UsePreCompiledShader()
-   */
-  void UsePreCompiledShader();
-
-  /**
    * @return the reference to texture manager
    */
   Internal::TextureManager& GetTextureManager();
@@ -134,7 +128,6 @@ private:
   SlotDelegate<VisualFactory>               mSlotDelegate;
   bool                                      mDebugEnabled : 1;
   bool                                      mPreMultiplyOnLoad : 1; ///< Local store for this flag
-  bool                                      mPrecompiledShaderRequested{false};
 };
 
 /**