Made multiple calls to ShInitialize not assert.
BUG=456
R=apatrick@chromium.org, kbr@chromium.org
Review URL: https://codereview.appspot.com/11916046
Conflicts:
src/common/version.h
src/compiler/ShaderLang.cpp
diff --git a/src/compiler/ShaderLang.cpp b/src/compiler/ShaderLang.cpp
index 77cb644..48dc0a0 100644
--- a/src/compiler/ShaderLang.cpp
+++ b/src/compiler/ShaderLang.cpp
@@ -85,15 +85,13 @@
}
//
-// Driver must call this first, once, before doing any other
-// compiler operations.
+// Driver must call this first, once, before doing any other compiler operations.
+// Subsequent calls to this function are no-op.
//
int ShInitialize()
{
- if (!InitProcess())
- return 0;
-
- return 1;
+ static const bool kInitialized = InitProcess();
+ return kInitialized ? 1 : 0;
}
//