bool TCompiler::Init(const ShBuiltInResources& resources) { shaderVersion = 100; maxUniformVectors = (shaderType == GL_VERTEX_SHADER) ? resources.MaxVertexUniformVectors : resources.MaxFragmentUniformVectors; maxExpressionComplexity = resources.MaxExpressionComplexity; maxCallStackDepth = resources.MaxCallStackDepth; maxFunctionParameters = resources.MaxFunctionParameters; SetGlobalPoolAllocator(&allocator); // Generate built-in symbol table. if (!InitBuiltInSymbolTable(resources)) return false; InitExtensionBehavior(resources, extensionBehavior); fragmentPrecisionHigh = resources.FragmentPrecisionHigh == 1; arrayBoundsClamper.SetClampingStrategy(resources.ArrayIndexClampingStrategy); clampingStrategy = resources.ArrayIndexClampingStrategy; hashFunction = resources.HashFunction; return true; }
virtual void SetUp() { allocator.push(); SetGlobalPoolAllocator(&allocator); ShBuiltInResources resources; ShInitBuiltInResources(&resources); mTranslatorESSL = new TranslatorESSL(GL_FRAGMENT_SHADER, SH_GLES3_SPEC); ASSERT_TRUE(mTranslatorESSL->Init(resources)); }
TShHandleBase::~TShHandleBase() { SetGlobalPoolAllocator(NULL); allocator.popAll(); }
TShHandleBase::TShHandleBase() { allocator.push(); SetGlobalPoolAllocator(&allocator); }
virtual void TearDown() { delete mTranslatorESSL; SetGlobalPoolAllocator(NULL); allocator.pop(); }