OLD | NEW |
1 // | 1 // |
2 // Copyright (c) 2002-2012 The ANGLE Project Authors. All rights reserved. | 2 // Copyright (c) 2002-2012 The ANGLE Project Authors. All rights reserved. |
3 // Use of this source code is governed by a BSD-style license that can be | 3 // Use of this source code is governed by a BSD-style license that can be |
4 // found in the LICENSE file. | 4 // found in the LICENSE file. |
5 // | 5 // |
6 | 6 |
7 #include "compiler/builtin_symbol_table.h" | 7 #include "compiler/builtin_symbol_table.h" |
8 #include "compiler/BuiltInFunctionEmulator.h" | 8 #include "compiler/BuiltInFunctionEmulator.h" |
9 #include "compiler/DetectCallDepth.h" | 9 #include "compiler/DetectCallDepth.h" |
10 #include "compiler/ForLoopUnroll.h" | 10 #include "compiler/ForLoopUnroll.h" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 continue; | 62 continue; |
63 | 63 |
64 if (PaParseStrings(1, &builtInShaders, &builtInLengths, &parseContext) !
= 0) | 64 if (PaParseStrings(1, &builtInShaders, &builtInLengths, &parseContext) !
= 0) |
65 { | 65 { |
66 infoSink.info.prefix(EPrefixInternalError); | 66 infoSink.info.prefix(EPrefixInternalError); |
67 infoSink.info << "Unable to parse built-ins"; | 67 infoSink.info << "Unable to parse built-ins"; |
68 return false; | 68 return false; |
69 } | 69 } |
70 } | 70 } |
71 | 71 |
72 InsertBuiltInFunctionsCommon(resources, &symbolTable); | 72 |
| 73 switch (type) { |
| 74 case SH_FRAGMENT_SHADER: |
| 75 InsertBuiltInFunctionsCommon(resources, &symbolTable); |
| 76 break; |
| 77 |
| 78 case SH_VERTEX_SHADER: |
| 79 InsertBuiltInFunctionsCommon(resources, &symbolTable); |
| 80 InsertBuiltInFunctionsVertex(resources, &symbolTable); |
| 81 break; |
| 82 |
| 83 default: assert(false && "Language not supported"); |
| 84 } |
| 85 |
73 IdentifyBuiltIns(type, spec, resources, symbolTable); | 86 IdentifyBuiltIns(type, spec, resources, symbolTable); |
74 | 87 |
75 return true; | 88 return true; |
76 } | 89 } |
77 | 90 |
78 class TScopedPoolAllocator { | 91 class TScopedPoolAllocator { |
79 public: | 92 public: |
80 TScopedPoolAllocator(TPoolAllocator* allocator, bool pushPop) | 93 TScopedPoolAllocator(TPoolAllocator* allocator, bool pushPop) |
81 : mAllocator(allocator), mPushPopAllocator(pushPop) { | 94 : mAllocator(allocator), mPushPopAllocator(pushPop) { |
82 if (mPushPopAllocator) mAllocator->push(); | 95 if (mPushPopAllocator) mAllocator->push(); |
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
414 | 427 |
415 ShArrayIndexClampingStrategy TCompiler::getArrayIndexClampingStrategy() const | 428 ShArrayIndexClampingStrategy TCompiler::getArrayIndexClampingStrategy() const |
416 { | 429 { |
417 return clampingStrategy; | 430 return clampingStrategy; |
418 } | 431 } |
419 | 432 |
420 const BuiltInFunctionEmulator& TCompiler::getBuiltInFunctionEmulator() const | 433 const BuiltInFunctionEmulator& TCompiler::getBuiltInFunctionEmulator() const |
421 { | 434 { |
422 return builtInFunctionEmulator; | 435 return builtInFunctionEmulator; |
423 } | 436 } |
OLD | NEW |