Commit f0470974 by Jamie Madill Committed by Commit Bot

D3D: Ensure compiler is loaded in applyShaders.

We're finding that D3Dcompile is being called with a null compiler handle. This means at some point we successfully linked a program, using a valid compiler handle, and likely we went through some traumatic event like a GPU device lost. This unloaded the compiler DLL and hence leads to a null deref. It's not clear how this is happening since a device lost should trigger a restart of the browser process in all cases with Chrome, but this should fix the NULL deref and lead to a user-visible program link error. BUG=chromium:671162 Change-Id: Ibf85f19d4f099d2f00921c230ee0a52b46bfd8cf Reviewed-on: https://chromium-review.googlesource.com/422553Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
parent 37ee8a6b
...@@ -2179,6 +2179,9 @@ gl::Error Renderer11::drawTriangleFan(const gl::ContextState &data, ...@@ -2179,6 +2179,9 @@ gl::Error Renderer11::drawTriangleFan(const gl::ContextState &data,
gl::Error Renderer11::applyShaders(const gl::ContextState &data, GLenum drawMode) gl::Error Renderer11::applyShaders(const gl::ContextState &data, GLenum drawMode)
{ {
// This method is called single-threaded.
ANGLE_TRY(ensureHLSLCompilerInitialized());
const auto &glState = data.getState(); const auto &glState = data.getState();
ProgramD3D *programD3D = GetImplAs<ProgramD3D>(glState.getProgram()); ProgramD3D *programD3D = GetImplAs<ProgramD3D>(glState.getProgram());
programD3D->updateCachedInputLayout(glState); programD3D->updateCachedInputLayout(glState);
......
...@@ -1712,6 +1712,9 @@ gl::Error Renderer9::getCountingIB(size_t count, StaticIndexBufferInterface **ou ...@@ -1712,6 +1712,9 @@ gl::Error Renderer9::getCountingIB(size_t count, StaticIndexBufferInterface **ou
gl::Error Renderer9::applyShaders(const gl::ContextState &data, GLenum drawMode) gl::Error Renderer9::applyShaders(const gl::ContextState &data, GLenum drawMode)
{ {
// This method is called single-threaded.
ANGLE_TRY(ensureHLSLCompilerInitialized());
ProgramD3D *programD3D = GetImplAs<ProgramD3D>(data.getState().getProgram()); ProgramD3D *programD3D = GetImplAs<ProgramD3D>(data.getState().getProgram());
programD3D->updateCachedInputLayout(data.getState()); programD3D->updateCachedInputLayout(data.getState());
......
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