Commit 91586494 by Bryan Bernhart (Intel Americas Inc) Committed by Commit Bot

Allow MapResource to return context loss GL error

Returns an OOM error to avoid query the context for status should Map fail. BUG=angleproject:2284 Change-Id: I4d35ef05c76fcc69bdab19f88c39a415d13ee116 Reviewed-on: https://chromium-review.googlesource.com/837519 Commit-Queue: Yuly Novikov <ynovikov@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarYuly Novikov <ynovikov@chromium.org>
parent fa920ebb
......@@ -4041,16 +4041,10 @@ gl::Error Renderer11::mapResource(ID3D11Resource *resource,
this->notifyDeviceLost();
}
const std::string genericFailureMessage = "Failed to map D3D11 resource.";
gl::Error glError = gl::InternalError() << genericFailureMessage << gl::FmtHR(hr);
if (E_OUTOFMEMORY)
{
glError = gl::OutOfMemory() << genericFailureMessage << gl::FmtHR(hr);
}
return glError;
// Note: gl::OutOfMemory is used instead of gl::InternalError to avoid requiring
// additional context queries. This is needed as gl::InternalError corresponds to
// GL_INVALID_OPERATION, which does not uniquely identify a device reset error.
return gl::OutOfMemory() << "Failed to map D3D11 resource." << gl::FmtHR(hr);
}
return gl::NoError();
......
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