Jamie Madill | 033dae6 | 2014-06-18 12:56:28 -0400 | [diff] [blame] | 1 | // |
| 2 | // Copyright (c) 2014 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 | // UtilsHLSL.h: |
| 7 | // Utility methods for GLSL to HLSL translation. |
| 8 | // |
| 9 | |
Geoff Lang | 0a73dd8 | 2014-11-19 16:18:08 -0500 | [diff] [blame] | 10 | #ifndef COMPILER_TRANSLATOR_UTILSHLSL_H_ |
| 11 | #define COMPILER_TRANSLATOR_UTILSHLSL_H_ |
Jamie Madill | 033dae6 | 2014-06-18 12:56:28 -0400 | [diff] [blame] | 12 | |
| 13 | #include <vector> |
| 14 | #include "compiler/translator/Types.h" |
| 15 | |
Jamie Madill | f51639a | 2014-06-25 16:04:57 -0400 | [diff] [blame] | 16 | #include "angle_gl.h" |
Jamie Madill | 033dae6 | 2014-06-18 12:56:28 -0400 | [diff] [blame] | 17 | |
Olli Etuaho | f5cfc8d | 2015-08-06 16:36:39 +0300 | [diff] [blame] | 18 | class TName; |
| 19 | |
Jamie Madill | 033dae6 | 2014-06-18 12:56:28 -0400 | [diff] [blame] | 20 | namespace sh |
| 21 | { |
| 22 | |
| 23 | TString TextureString(const TType &type); |
| 24 | TString SamplerString(const TType &type); |
| 25 | // Prepends an underscore to avoid naming clashes |
| 26 | TString Decorate(const TString &string); |
Olli Etuaho | f5cfc8d | 2015-08-06 16:36:39 +0300 | [diff] [blame] | 27 | TString DecorateIfNeeded(const TName &name); |
Olli Etuaho | 59f9a64 | 2015-08-06 20:38:26 +0300 | [diff] [blame^] | 28 | // Decorates and also unmangles the function name |
| 29 | TString DecorateFunctionIfNeeded(const TName &name); |
Jamie Madill | 033dae6 | 2014-06-18 12:56:28 -0400 | [diff] [blame] | 30 | TString DecorateUniform(const TString &string, const TType &type); |
| 31 | TString DecorateField(const TString &string, const TStructure &structure); |
| 32 | TString DecoratePrivate(const TString &privateText); |
| 33 | TString TypeString(const TType &type); |
| 34 | TString StructNameString(const TStructure &structure); |
| 35 | TString QualifiedStructNameString(const TStructure &structure, bool useHLSLRowMajorPacking, |
| 36 | bool useStd140Packing); |
| 37 | TString InterpolationString(TQualifier qualifier); |
| 38 | TString QualifierString(TQualifier qualifier); |
| 39 | |
| 40 | } |
| 41 | |
Geoff Lang | 0a73dd8 | 2014-11-19 16:18:08 -0500 | [diff] [blame] | 42 | #endif // COMPILER_TRANSLATOR_UTILSHLSL_H_ |