From b5fb1f3b28e39d1c7d79b55dfabfeac0d39e17db Mon Sep 17 00:00:00 2001 From: "Eunki, Hong" Date: Mon, 16 Oct 2023 11:36:45 +0900 Subject: Print log when glCompile / glLinkProgram spend long time Change-Id: Ib6079ec907f91d55d061b84a08ad6f9fb7c8b83f Signed-off-by: Eunki, Hong --- dali/internal/graphics/gles/gl-implementation.h | 30 +++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/dali/internal/graphics/gles/gl-implementation.h b/dali/internal/graphics/gles/gl-implementation.h index 6d9171916..3969bc789 100644 --- a/dali/internal/graphics/gles/gl-implementation.h +++ b/dali/internal/graphics/gles/gl-implementation.h @@ -399,7 +399,22 @@ public: void CompileShader(GLuint shader) override { + uint32_t startTime = 0, endTime = 0; + if(mLogEnabled) + { + startTime = TimeService::GetMilliSeconds(); + } + glCompileShader(shader); + + if(mLogEnabled) + { + endTime = TimeService::GetMilliSeconds(); + if(endTime - startTime > mLogThreshold) + { + DALI_LOG_RELEASE_INFO("glCompileShader takes long time! [%u ms] shader id : %u\n", endTime - startTime, shader); + } + } } void CompressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data) override @@ -774,7 +789,22 @@ public: void LinkProgram(GLuint program) override { + uint32_t startTime = 0, endTime = 0; + if(mLogEnabled) + { + startTime = TimeService::GetMilliSeconds(); + } + glLinkProgram(program); + + if(mLogEnabled) + { + endTime = TimeService::GetMilliSeconds(); + if(endTime - startTime > mLogThreshold) + { + DALI_LOG_RELEASE_INFO("glLinkProgram takes long time! [%u ms] program id : %u\n", endTime - startTime, program); + } + } } void PixelStorei(GLenum pname, GLint param) override -- cgit v1.2.3