Commit ac7556f6 by Tibor den Ouden Committed by Geoff Lang

Freed temporary info log buffer and removed explicit destruction of char[]

BUG=angle:758 Removed explicit destruction of char[] by using std::vector<char> object. Added Borbitsoft to AUTHORS and Tibor den Ouden to CONTRIBUTORS Change-Id: I9c4017eb81ce3fab8b7fb4a5b4ad52a758d14a2d Reviewed-on: https://chromium-review.googlesource.com/219940Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Tested-by: 's avatarGeoff Lang <geofflang@chromium.org>
parent ff39bd87
...@@ -14,6 +14,7 @@ TransGaming Inc. ...@@ -14,6 +14,7 @@ TransGaming Inc.
Adobe Systems Inc. Adobe Systems Inc.
Autodesk, Inc. Autodesk, Inc.
BlackBerry Limited BlackBerry Limited
Borbitsoft
Cable Television Laboratories, Inc. Cable Television Laboratories, Inc.
Cloud Party, Inc. Cloud Party, Inc.
Intel Corporation Intel Corporation
......
...@@ -49,6 +49,9 @@ Adobe Systems Inc. ...@@ -49,6 +49,9 @@ Adobe Systems Inc.
Autodesk, Inc. Autodesk, Inc.
Ranger Harke Ranger Harke
Borbitsoft
Tibor den Ouden
Cloud Party, Inc. Cloud Party, Inc.
Conor Dickinson Conor Dickinson
......
...@@ -235,8 +235,8 @@ void ShaderD3D::compileToHLSL(void *compiler, const std::string &source) ...@@ -235,8 +235,8 @@ void ShaderD3D::compileToHLSL(void *compiler, const std::string &source)
size_t objCodeLen = 0; size_t objCodeLen = 0;
ShGetInfo(compiler, SH_OBJECT_CODE_LENGTH, &objCodeLen); ShGetInfo(compiler, SH_OBJECT_CODE_LENGTH, &objCodeLen);
char* outputHLSL = new char[objCodeLen]; std::vector<char> outputHLSL(objCodeLen);
ShGetObjectCode(compiler, outputHLSL); ShGetObjectCode(compiler, outputHLSL.data());
#ifdef _DEBUG #ifdef _DEBUG
std::ostringstream hlslStream; std::ostringstream hlslStream;
...@@ -254,14 +254,12 @@ void ShaderD3D::compileToHLSL(void *compiler, const std::string &source) ...@@ -254,14 +254,12 @@ void ShaderD3D::compileToHLSL(void *compiler, const std::string &source)
curPos = (nextLine == std::string::npos) ? std::string::npos : (nextLine + 1); curPos = (nextLine == std::string::npos) ? std::string::npos : (nextLine + 1);
} }
hlslStream << "\n\n"; hlslStream << "\n\n";
hlslStream << outputHLSL; hlslStream << outputHLSL.data();
mHlsl = hlslStream.str(); mHlsl = hlslStream.str();
#else #else
mHlsl = outputHLSL; mHlsl = outputHLSL.data();
#endif #endif
SafeDeleteArray(outputHLSL);
mUniforms = *GetShaderVariables(ShGetUniforms(compiler)); mUniforms = *GetShaderVariables(ShGetUniforms(compiler));
for (size_t uniformIndex = 0; uniformIndex < mUniforms.size(); uniformIndex++) for (size_t uniformIndex = 0; uniformIndex < mUniforms.size(); uniformIndex++)
...@@ -301,11 +299,11 @@ void ShaderD3D::compileToHLSL(void *compiler, const std::string &source) ...@@ -301,11 +299,11 @@ void ShaderD3D::compileToHLSL(void *compiler, const std::string &source)
size_t infoLogLen = 0; size_t infoLogLen = 0;
ShGetInfo(compiler, SH_INFO_LOG_LENGTH, &infoLogLen); ShGetInfo(compiler, SH_INFO_LOG_LENGTH, &infoLogLen);
char* infoLog = new char[infoLogLen]; std::vector<char> infoLog(infoLogLen);
ShGetInfoLog(compiler, infoLog); ShGetInfoLog(compiler, infoLog.data());
mInfoLog = infoLog; mInfoLog = infoLog.data();
TRACE("\n%s", mInfoLog.c_str()); TRACE("\n%s", infoLog.data());
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment