Commit 1aa7f3c1 by Jamie Madill

Re-initialize shader translator properly after one shutdown.

Because of a local static, we could get stuck and never re-initialize the translator after calling ShFinalize. BUG=344043 Change-Id: Ib4d18da886eac28f3e1bc959a7eadf5b34d9410f Reviewed-on: https://chromium-review.googlesource.com/186975Reviewed-by: 's avatarNicolas Capens <nicolascapens@chromium.org> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Tested-by: 's avatarJamie Madill <jmadill@chromium.org>
parent 836bd217
...@@ -17,6 +17,8 @@ ...@@ -17,6 +17,8 @@
#include "compiler/translator/TranslatorHLSL.h" #include "compiler/translator/TranslatorHLSL.h"
#include "compiler/translator/VariablePacker.h" #include "compiler/translator/VariablePacker.h"
static bool isInitialized = false;
// //
// This is the platform independent interface between an OGL driver // This is the platform independent interface between an OGL driver
// and the shading language compiler. // and the shading language compiler.
...@@ -49,8 +51,8 @@ static bool checkMappedNameMaxLength(const ShHandle handle, size_t expectedValue ...@@ -49,8 +51,8 @@ static bool checkMappedNameMaxLength(const ShHandle handle, size_t expectedValue
// //
int ShInitialize() int ShInitialize()
{ {
static const bool kInitialized = InitProcess(); isInitialized = InitProcess();
return kInitialized ? 1 : 0; return isInitialized ? 1 : 0;
} }
// //
...@@ -59,6 +61,7 @@ int ShInitialize() ...@@ -59,6 +61,7 @@ int ShInitialize()
int ShFinalize() int ShFinalize()
{ {
DetachProcess(); DetachProcess();
isInitialized = false;
return 1; return 1;
} }
......
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