alokp@chromium.org | 76b8208 | 2010-03-24 17:59:39 +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 | |
Geoff Lang | 1773282 | 2013-08-29 13:46:49 -0400 | [diff] [blame^] | 7 | #include "compiler/translator/TranslatorGLSL.h" |
| 8 | #include "compiler/translator/TranslatorESSL.h" |
alokp@chromium.org | 76b8208 | 2010-03-24 17:59:39 +0000 | [diff] [blame] | 9 | |
| 10 | // |
| 11 | // This function must be provided to create the actual |
| 12 | // compile object used by higher level code. It returns |
| 13 | // a subclass of TCompiler. |
| 14 | // |
zmo@google.com | 5601ea0 | 2011-06-10 18:23:25 +0000 | [diff] [blame] | 15 | TCompiler* ConstructCompiler( |
| 16 | ShShaderType type, ShShaderSpec spec, ShShaderOutput output) |
alokp@chromium.org | 76b8208 | 2010-03-24 17:59:39 +0000 | [diff] [blame] | 17 | { |
zmo@google.com | 5601ea0 | 2011-06-10 18:23:25 +0000 | [diff] [blame] | 18 | switch (output) { |
| 19 | case SH_GLSL_OUTPUT: |
| 20 | return new TranslatorGLSL(type, spec); |
| 21 | case SH_ESSL_OUTPUT: |
| 22 | return new TranslatorESSL(type, spec); |
| 23 | default: |
| 24 | return NULL; |
| 25 | } |
alokp@chromium.org | 76b8208 | 2010-03-24 17:59:39 +0000 | [diff] [blame] | 26 | } |
| 27 | |
| 28 | // |
| 29 | // Delete the compiler made by ConstructCompiler |
| 30 | // |
| 31 | void DeleteCompiler(TCompiler* compiler) |
| 32 | { |
| 33 | delete compiler; |
| 34 | } |