Revert "[Tizen] Apply precompile shader"
authorEunki, Hong <eunkiki.hong@samsung.com>
Tue, 26 Sep 2023 08:26:35 +0000 (17:26 +0900)
committerEunki, Hong <eunkiki.hong@samsung.com>
Tue, 26 Sep 2023 08:26:35 +0000 (17:26 +0900)
This reverts commit 8aa5ae787e14584ef1d338d1b3be9b2ee0b6097b.

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 dce31096010f8e497931f178f7601fe0f14949d1..6575c7d9744458046b0131fafb47883e579dc086 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 bf861f7460d4a6bb4c1ff6447296a70445b7a88e..1d6be157cb1c4e46ec96b14f1fef2fafd6533b44 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 ac7d7de0735e53717b2c0746afcb8bc4fd97cf59..97610152b4b2a9bb27524a070e59658eeb1d9bc7 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 1a591a4e78ef1af6f618e92f8aa1f41cc37f7970..cf1c25ba645ffd44e2f189844037f48510be902c 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 934333def1b4b739517f86b6082b68af06ffebde..f1d9703f12f66d25974fc0c29eac06ba4c177628 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 bb73247998e6034f381d4b76a29c629948f1fc1d..c1cf764396f2964714f8e9d91f232897ae3da16d 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 a3bc7ccbe242a6731e80fc52bcb6d9849c2465ad..1e5ac93a723a5ba3eeff0e8ffa5c31e2f48728ad 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>
@@ -85,11 +84,6 @@ public:
    */
   bool GetPreMultiplyOnLoad() const;
 
-  /**
-   * @copydoc Toolkit::VisualFactory::UsePreCompiledShader()
-   */
-  void UsePreCompiledShader();
-
   /**
    * @return the reference to texture manager
    */
@@ -134,7 +128,6 @@ private:
   SlotDelegate<VisualFactory>               mSlotDelegate;
   bool                                      mDebugEnabled : 1;
   bool                                      mPreMultiplyOnLoad : 1; ///< Local store for this flag
-  bool                                      mPrecompiledShaderRequested{false};
 };
 
 /**