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.
Adobe Systems Inc.
Autodesk, Inc.
BlackBerry Limited
Borbitsoft
Cable Television Laboratories, Inc.
Cloud Party, Inc.
Intel Corporation
......
......@@ -49,6 +49,9 @@ Adobe Systems Inc.
Autodesk, Inc.
Ranger Harke
Borbitsoft
Tibor den Ouden
Cloud Party, Inc.
Conor Dickinson
......
......@@ -235,8 +235,8 @@ void ShaderD3D::compileToHLSL(void *compiler, const std::string &source)
size_t objCodeLen = 0;
ShGetInfo(compiler, SH_OBJECT_CODE_LENGTH, &objCodeLen);
char* outputHLSL = new char[objCodeLen];
ShGetObjectCode(compiler, outputHLSL);
std::vector<char> outputHLSL(objCodeLen);
ShGetObjectCode(compiler, outputHLSL.data());
#ifdef _DEBUG
std::ostringstream hlslStream;
......@@ -254,14 +254,12 @@ void ShaderD3D::compileToHLSL(void *compiler, const std::string &source)
curPos = (nextLine == std::string::npos) ? std::string::npos : (nextLine + 1);
}
hlslStream << "\n\n";
hlslStream << outputHLSL;
hlslStream << outputHLSL.data();
mHlsl = hlslStream.str();
#else
mHlsl = outputHLSL;
mHlsl = outputHLSL.data();
#endif
SafeDeleteArray(outputHLSL);
mUniforms = *GetShaderVariables(ShGetUniforms(compiler));
for (size_t uniformIndex = 0; uniformIndex < mUniforms.size(); uniformIndex++)
......@@ -301,11 +299,11 @@ void ShaderD3D::compileToHLSL(void *compiler, const std::string &source)
size_t infoLogLen = 0;
ShGetInfo(compiler, SH_INFO_LOG_LENGTH, &infoLogLen);
char* infoLog = new char[infoLogLen];
ShGetInfoLog(compiler, infoLog);
mInfoLog = infoLog;
std::vector<char> infoLog(infoLogLen);
ShGetInfoLog(compiler, infoLog.data());
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