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