Compile GLSL in a critical section
Our copy of glslang is not thread safe, so we need to ensure a mutex is
held during GLSL compilation. With shared contexts this was already the
case because we lock a mutex belonging to the shared resource manager
(through es2::getContext()), but using independent contexts in multiple
threads was unsafe.
Use of glReleaseShaderCompiler() was also unsafe, even with shared
contexts, because no lock was taken.
Bug: b/137828018
Change-Id: I90028035868f95c5a121777aee05c2128a2f8180
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/34488
Presubmit-Ready: Nicolas Capens <nicolascapens@google.com>
Tested-by:
Nicolas Capens <nicolascapens@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Reviewed-by:
Alexis Hétu <sugoi@google.com>
Showing
Please
register
or
sign in
to comment