X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Frender%2Fshaders%2Fprogram.cpp;h=ec464892bbcf3bdcfa11feb9402f6997aa855a45;hb=6a9a86815730fc72cdb815b9f577e50f4f3cb49d;hp=8b145fc2e0a42490f15ac91c59f6ebe4851c886f;hpb=351854374bdc52d08f18ddfe0b534dbdc288d9fa;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/dali/internal/render/shaders/program.cpp b/dali/internal/render/shaders/program.cpp index 8b145fc..ec46489 100644 --- a/dali/internal/render/shaders/program.cpp +++ b/dali/internal/render/shaders/program.cpp @@ -489,16 +489,14 @@ void Program::Load() { DALI_LOG_ERROR("Failed to load program binary \n"); - char* szLog = NULL; GLint nLength; CHECK_GL( mGlAbstraction, mGlAbstraction.GetProgramiv( mProgramId, GL_INFO_LOG_LENGTH, &nLength) ); if(nLength > 0) { - szLog = new char[ nLength ]; - CHECK_GL( mGlAbstraction, mGlAbstraction.GetProgramInfoLog( mProgramId, nLength, &nLength, szLog ) ); - DALI_LOG_ERROR( "Program Link Error: %s\n", szLog ); - - delete [] szLog; + Dali::Vector< char > szLog; + szLog.Reserve( nLength ); // Don't call Resize as we don't want to initialise the data, just reserve a buffer + CHECK_GL( mGlAbstraction, mGlAbstraction.GetProgramInfoLog( mProgramId, nLength, &nLength, szLog.Begin() ) ); + DALI_LOG_ERROR( "Program Link Error: %s\n", szLog.Begin() ); } } else @@ -588,17 +586,17 @@ bool Program::CompileShader( GLenum shaderType, GLuint& shaderId, const char* sr DALI_LOG_ERROR("Failed to compile shader\n"); LogWithLineNumbers(src); - Dali::Vector< char > szLog; GLint nLength; mGlAbstraction.GetShaderiv( shaderId, GL_INFO_LOG_LENGTH, &nLength); if(nLength > 0) { - szLog.Reserve( nLength ); - mGlAbstraction.GetShaderInfoLog( shaderId, nLength, &nLength, &szLog[ 0 ] ); - DALI_LOG_ERROR( "Shader Compiler Error: %s\n", &szLog[ 0 ] ); + Dali::Vector< char > szLog; + szLog.Reserve( nLength ); // Don't call Resize as we don't want to initialise the data, just reserve a buffer + mGlAbstraction.GetShaderInfoLog( shaderId, nLength, &nLength, szLog.Begin() ); + DALI_LOG_ERROR( "Shader Compiler Error: %s\n", szLog.Begin() ); } - throw DaliException( "Shader compilation failure", &szLog[ 0 ] ); + DALI_ASSERT_ALWAYS( 0 && "Shader compilation failure" ); } return compiled != 0; @@ -617,18 +615,17 @@ void Program::Link() { DALI_LOG_ERROR("Shader failed to link \n"); - char* szLog = NULL; GLint nLength; mGlAbstraction.GetProgramiv( mProgramId, GL_INFO_LOG_LENGTH, &nLength); if(nLength > 0) { - szLog = new char[ nLength ]; - mGlAbstraction.GetProgramInfoLog( mProgramId, nLength, &nLength, szLog ); - DALI_LOG_ERROR( "Shader Link Error: %s\n", szLog ); - delete [] szLog; + Dali::Vector< char > szLog; + szLog.Reserve( nLength ); // Don't call Resize as we don't want to initialise the data, just reserve a buffer + mGlAbstraction.GetProgramInfoLog( mProgramId, nLength, &nLength, szLog.Begin() ); + DALI_LOG_ERROR( "Shader Link Error: %s\n", szLog.Begin() ); } - DALI_ASSERT_DEBUG(0); + DALI_ASSERT_ALWAYS( 0 && "Shader linking failure" ); } mLinked = linked != GL_FALSE;