diff options
Diffstat (limited to 'ANGLE/src/compiler/ShaderLang.cpp')
-rw-r--r-- | ANGLE/src/compiler/ShaderLang.cpp | 44 |
1 files changed, 33 insertions, 11 deletions
diff --git a/ANGLE/src/compiler/ShaderLang.cpp b/ANGLE/src/compiler/ShaderLang.cpp index 3c36ef8..e0c646a 100644 --- a/ANGLE/src/compiler/ShaderLang.cpp +++ b/ANGLE/src/compiler/ShaderLang.cpp @@ -90,15 +90,45 @@ static bool GenerateBuiltInSymbolTable( // int ShInitialize() { - bool ret = InitProcess(); + if (!InitProcess()) + return 0; - return ret ? 1 : 0; + return 1; } // -// Driver calls these to create and destroy compiler objects. +// Cleanup symbol tables +// +int ShFinalize() +{ + if (!DetachProcess()) + return 0; + + return 1; +} + +// +// Initialize built-in resources with minimum expected values. // +void ShInitBuiltInResource(TBuiltInResource* resources) +{ + // Constants. + resources->MaxVertexAttribs = 8; + resources->MaxVertexUniformVectors = 128; + resources->MaxVaryingVectors = 8; + resources->MaxVertexTextureImageUnits = 0; + resources->MaxCombinedTextureImageUnits = 8; + resources->MaxTextureImageUnits = 8; + resources->MaxFragmentUniformVectors = 16; + resources->MaxDrawBuffers = 1; + + // Extensions. + resources->OES_standard_derivatives = 0; +} +// +// Driver calls these to create and destroy compiler objects. +// ShHandle ShConstructCompiler(EShLanguage language, EShSpec spec, const TBuiltInResource* resources) { if (!InitThread()) @@ -130,14 +160,6 @@ void ShDestruct(ShHandle handle) } // -// Cleanup symbol tables -// -int ShFinalize() -{ - return 1; -} - -// // Do an actual compile on the given strings. The result is left // in the given compile object. // |