blob: 3bc1d4588624c0b8ac2049b62334253902189367 [file] [log] [blame]
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +00001//
2// Copyright (c) 2002-2010 The ANGLE Project Authors. All rights reserved.
3// Use of this source code is governed by a BSD-style license that can be
4// found in the LICENSE file.
5//
6
7//
8// The top level algorithms for linking multiple
9// shaders together.
10//
daniel@transgaming.combbf56f72010-04-20 18:52:13 +000011#include "compiler/Common.h"
12#include "compiler/ShHandle.h"
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +000013
14//
15// Actual link object, derived from the shader handle base classes.
16//
17class TGenericLinker : public TLinker {
18public:
alokp@chromium.org76b82082010-03-24 17:59:39 +000019 TGenericLinker(EShExecutable e, int dOptions) : TLinker(e), debugOptions(dOptions) { }
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +000020 bool link(TCompilerList&, TUniformMap*) { return true; }
alokp@chromium.org76b82082010-03-24 17:59:39 +000021 void getAttributeBindings(ShBindingTable const **t) const { }
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +000022 int debugOptions;
23};
24
25//
26// The internal view of a uniform/float object exchanged with the driver.
27//
28class TUniformLinkedMap : public TUniformMap {
29public:
30 TUniformLinkedMap() { }
31 virtual int getLocation(const char* name) { return 0; }
32};
33
34TShHandleBase* ConstructLinker(EShExecutable executable, int debugOptions)
35{
36 return new TGenericLinker(executable, debugOptions);
37}
38
39void DeleteLinker(TShHandleBase* linker)
40{
41 delete linker;
42}
43
44TUniformMap* ConstructUniformMap()
45{
46 return new TUniformLinkedMap();
47}
48
49void DeleteUniformMap(TUniformMap* map)
50{
51 delete map;
52}
53
54TShHandleBase* ConstructBindings()
55{
56 return 0;
57}
58
59void DeleteBindingList(TShHandleBase* bindingList)
60{
61 delete bindingList;
62}