Commit 65d17e56 by Geoff Lang Committed by Commit Bot

Generate OUT_OF_MEMORY when compiler initialization fails.

INVALID_OPERATION implies that the error is recoverable. Change-Id: Iaa13293168f66f46864e5e4c0ab7d7c53c97e8fd Reviewed-on: https://chromium-review.googlesource.com/383131Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
parent c955058b
......@@ -136,7 +136,8 @@ gl::Error HLSLCompiler::initialize()
if (!mD3DCompilerModule)
{
return gl::Error(GL_INVALID_OPERATION, "No D3D compiler module found - aborting!\n");
ERR("D3D compiler module not found.");
return gl::Error(GL_OUT_OF_MEMORY, "D3D compiler module not found.");
}
mD3DCompileFunc = reinterpret_cast<pD3DCompile>(GetProcAddress(mD3DCompilerModule, "D3DCompile"));
......@@ -155,7 +156,7 @@ gl::Error HLSLCompiler::initialize()
if (mD3DCompileFunc == nullptr)
{
return gl::Error(GL_INVALID_OPERATION, "Error finding D3DCompile entry point");
return gl::Error(GL_OUT_OF_MEMORY, "Error finding D3DCompile entry point.");
}
mInitialized = true;
......
......@@ -1433,7 +1433,12 @@ LinkResult ProgramD3D::link(const gl::ContextState &data, gl::InfoLog &infoLog)
gatherTransformFeedbackVaryings(varyingPacking);
LinkResult result = compileProgramExecutables(data, infoLog);
if (result.error.isError() || !result.linkSuccess)
if (result.error.isError())
{
infoLog << result.error.getMessage();
return result;
}
else if (!result.linkSuccess)
{
infoLog << "Failed to create D3D shaders.";
return result;
......
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