daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 1 | // |
| 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 | // |
| 11 | #include "Common.h" |
| 12 | #include "ShHandle.h" |
| 13 | |
| 14 | // |
| 15 | // Actual link object, derived from the shader handle base classes. |
| 16 | // |
| 17 | class TGenericLinker : public TLinker { |
| 18 | public: |
| 19 | TGenericLinker(EShExecutable e, int dOptions) : TLinker(e, infoSink), debugOptions(dOptions) { } |
| 20 | bool link(TCompilerList&, TUniformMap*) { return true; } |
| 21 | void getAttributeBindings(ShBindingTable const **t) const { } |
| 22 | TInfoSink infoSink; |
| 23 | int debugOptions; |
| 24 | }; |
| 25 | |
| 26 | // |
| 27 | // The internal view of a uniform/float object exchanged with the driver. |
| 28 | // |
| 29 | class TUniformLinkedMap : public TUniformMap { |
| 30 | public: |
| 31 | TUniformLinkedMap() { } |
| 32 | virtual int getLocation(const char* name) { return 0; } |
| 33 | }; |
| 34 | |
| 35 | TShHandleBase* ConstructLinker(EShExecutable executable, int debugOptions) |
| 36 | { |
| 37 | return new TGenericLinker(executable, debugOptions); |
| 38 | } |
| 39 | |
| 40 | void DeleteLinker(TShHandleBase* linker) |
| 41 | { |
| 42 | delete linker; |
| 43 | } |
| 44 | |
| 45 | TUniformMap* ConstructUniformMap() |
| 46 | { |
| 47 | return new TUniformLinkedMap(); |
| 48 | } |
| 49 | |
| 50 | void DeleteUniformMap(TUniformMap* map) |
| 51 | { |
| 52 | delete map; |
| 53 | } |
| 54 | |
| 55 | TShHandleBase* ConstructBindings() |
| 56 | { |
| 57 | return 0; |
| 58 | } |
| 59 | |
| 60 | void DeleteBindingList(TShHandleBase* bindingList) |
| 61 | { |
| 62 | delete bindingList; |
| 63 | } |