blob: a4c0fbd286e6d1991c13982e77b840d7c05d57dd [file] [log] [blame]
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +00001//
shannonwoods@chromium.org2ac0be92013-05-30 00:02:27 +00002// Copyright (c) 2002-2013 The ANGLE Project Authors. All rights reserved.
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +00003// Use of this source code is governed by a BSD-style license that can be
4// found in the LICENSE file.
5//
6
7#ifndef _INITIALIZE_INCLUDED_
8#define _INITIALIZE_INCLUDED_
9
daniel@transgaming.combbf56f72010-04-20 18:52:13 +000010#include "compiler/Common.h"
11#include "compiler/ShHandle.h"
12#include "compiler/SymbolTable.h"
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +000013
14typedef TVector<TString> TBuiltInStrings;
15
16class TBuiltIns {
17public:
alokp@chromium.orge4249f02010-07-26 18:13:52 +000018 POOL_ALLOCATOR_NEW_DELETE(GlobalPoolAllocator)
19
alokp@chromium.org4888ceb2010-10-01 21:13:12 +000020 void initialize(ShShaderType type, ShShaderSpec spec,
shannon.woods%transgaming.com@gtempaccount.com5209de82013-04-13 03:41:53 +000021 const ShBuiltInResources& resources,
22 const TExtensionBehavior& extensionBehavior);
shannonwoods@chromium.org2ac0be92013-05-30 00:02:27 +000023 const TBuiltInStrings &getCommonBuiltIns() const { return commonBuiltIns; }
24 const TBuiltInStrings &getEssl1BuiltIns() const { return essl1BuiltIns; }
25 const TBuiltInStrings &getEssl3BuiltIns() const { return essl3BuiltIns; }
alokp@chromium.orge4249f02010-07-26 18:13:52 +000026
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +000027protected:
shannonwoods@chromium.org2ac0be92013-05-30 00:02:27 +000028 TBuiltInStrings commonBuiltIns;
29 TBuiltInStrings essl1BuiltIns;
30 TBuiltInStrings essl3BuiltIns;
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +000031};
32
alokp@chromium.org4888ceb2010-10-01 21:13:12 +000033void IdentifyBuiltIns(ShShaderType type, ShShaderSpec spec,
34 const ShBuiltInResources& resources,
alokp@chromium.orge4249f02010-07-26 18:13:52 +000035 TSymbolTable& symbolTable);
36
alokp@chromium.org4888ceb2010-10-01 21:13:12 +000037void InitExtensionBehavior(const ShBuiltInResources& resources,
alokp@chromium.orgad771eb2010-09-07 17:36:23 +000038 TExtensionBehavior& extensionBehavior);
39
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +000040#endif // _INITIALIZE_INCLUDED_