/*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 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.
return true;
}
+uint32_t TestGlAbstraction::GetShaderLanguageVersion()
+{
+ return mShaderLanguageVersion;
+}
+
std::string TestGlAbstraction::GetShaderVersionPrefix()
{
return std::string("");
#define TEST_GL_ABSTRACTION_H
/*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 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.
bool IsBlendEquationSupported(DevelBlendEquation::Type blendEquation) override;
+ uint32_t GetShaderLanguageVersion();
+
std::string GetShaderVersionPrefix();
std::string GetVertexShaderPrefix();
TraceCallStack mViewportTrace;
// Shaders & Uniforms
+ uint32_t mShaderLanguageVersion{320u};
+
GLuint mLastShaderIdUsed;
GLuint mLastProgramIdUsed{0u};
GLuint mLastUniformIdUsed;
END_TEST;
}
+int UtcDaliShaderGetShaderLanguageVersion(void)
+{
+ TestApplication application;
+
+ tet_infoline("Test get shader language version");
+
+ auto originalShaderVersion = application.GetGlAbstraction().GetShaderLanguageVersion();
+
+ try
+ {
+ uint32_t expectVersion = 100;
+ application.GetGlAbstraction().mShaderLanguageVersion = expectVersion;
+
+ DALI_TEST_EQUALS(Dali::Shader::GetShaderLanguageVersion(), expectVersion, TEST_LOCATION);
+
+ expectVersion = 200;
+ application.GetGlAbstraction().mShaderLanguageVersion = expectVersion;
+
+ DALI_TEST_EQUALS(Dali::Shader::GetShaderLanguageVersion(), expectVersion, TEST_LOCATION);
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(false);
+ }
+
+ application.GetGlAbstraction().mShaderLanguageVersion = originalShaderVersion;
+
+ END_TEST;
+}
+
int UtcDaliShaderAnimatedProperty02(void)
{
TestApplication application;
virtual bool IsBlendEquationSupported(DevelBlendEquation::Type blendEquation) = 0;
/**
+ * Returns shading language version.
+ * @Return shading language version.
+ */
+ virtual uint32_t GetShaderLanguageVersion() = 0;
+
+ /**
* Returns shader prefix of shading language version.
* @Return shader prefix of shading language version.
*/
virtual bool IsBlendEquationSupported(DevelBlendEquation::Type blendEquation) = 0;
/**
+ * Returns shading language version.
+ * @Return shading language version.
+ */
+ virtual uint32_t GetShaderLanguageVersion() = 0;
+
+ /**
* Returns shader prefix of shading language version.
* @Return shader prefix of shading language version.
*/
return mCore->GetGraphicsConfig().IsBlendEquationSupported(blendEquation);
}
+uint32_t ThreadLocalStorage::GetShaderLanguageVersion()
+{
+ return mCore->GetGraphicsConfig().GetShaderLanguageVersion();
+}
+
std::string ThreadLocalStorage::GetShaderVersionPrefix()
{
return mCore->GetGraphicsConfig().GetShaderVersionPrefix();
#define DALI_INTERNAL_THREAD_LOCAL_STORAGE_H
/*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 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.
bool IsBlendEquationSupported(DevelBlendEquation::Type blendEquation);
/**
+ * @brief Returns shading language version.
+ */
+ uint32_t GetShaderLanguageVersion();
+
+ /**
* @brief Returns shader prefix of shading language version.
*/
std::string GetShaderVersionPrefix();
}
}
+uint32_t Shader::GetShaderLanguageVersion()
+{
+ Dali::Internal::ThreadLocalStorage& tls = Dali::Internal::ThreadLocalStorage::Get();
+ return tls.GetShaderLanguageVersion();
+}
+
std::string Shader::GetShaderVersionPrefix()
{
Dali::Internal::ThreadLocalStorage& tls = Dali::Internal::ThreadLocalStorage::Get();
public:
/**
+ * @copydoc Dali::Shader::GetShaderLanguageVersion()
+ */
+ static uint32_t GetShaderLanguageVersion();
+
+ /**
* @copydoc Dali::Shader::GetShaderVersionPrefix()
*/
static std::string GetShaderVersionPrefix();
{
}
+uint32_t Shader::GetShaderLanguageVersion()
+{
+ return Dali::Internal::Shader::GetShaderLanguageVersion();
+}
+
std::string Shader::GetShaderVersionPrefix()
{
return Dali::Internal::Shader::GetShaderVersionPrefix();
Shader& operator=(Shader&& rhs) noexcept;
/**
+ * @brief Get the number of shading language version.
+ * @note This can potentially block until GL has been initialized
+ * when the first time any DALi application is launched in the system.
+ * @SINCE_2_3.11
+ * @return shader languange version as integer.
+ */
+ static uint32_t GetShaderLanguageVersion();
+
+ /**
* @brief Get shader preprocessor of shading language version.
* @note This can potentially block until GL has been initialized
* when the first time any DALi application is launched in the system.