daniel@transgaming.com | 91ed149 | 2010-10-29 03:11:43 +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 | #ifndef COMPILER_UTIL_H |
| 8 | #define COMPILER_UTIL_H |
| 9 | |
Jamie Madill | 033dae6 | 2014-06-18 12:56:28 -0400 | [diff] [blame] | 10 | #include "compiler/translator/Types.h" |
Jamie Madill | f51639a | 2014-06-25 16:04:57 -0400 | [diff] [blame] | 11 | #include "angle_gl.h" |
Jamie Madill | 033dae6 | 2014-06-18 12:56:28 -0400 | [diff] [blame] | 12 | #include "common/shadervars.h" |
| 13 | |
Zhenyao Mo | f1d723c | 2013-09-23 14:57:07 -0400 | [diff] [blame] | 14 | // atof_clamp is like atof but |
| 15 | // 1. it forces C locale, i.e. forcing '.' as decimal point. |
| 16 | // 2. it clamps the value to -FLT_MAX or FLT_MAX if overflow happens. |
| 17 | // Return false if overflow happens. |
| 18 | extern bool atof_clamp(const char *str, float *value); |
daniel@transgaming.com | 91ed149 | 2010-10-29 03:11:43 +0000 | [diff] [blame] | 19 | |
Zhenyao Mo | f1d723c | 2013-09-23 14:57:07 -0400 | [diff] [blame] | 20 | // If overflow happens, clamp the value to INT_MIN or INT_MAX. |
| 21 | // Return false if overflow happens. |
| 22 | extern bool atoi_clamp(const char *str, int *value); |
daniel@transgaming.com | 91ed149 | 2010-10-29 03:11:43 +0000 | [diff] [blame] | 23 | |
Jamie Madill | 033dae6 | 2014-06-18 12:56:28 -0400 | [diff] [blame] | 24 | namespace sh |
| 25 | { |
| 26 | |
| 27 | GLenum GLVariableType(const TType &type); |
| 28 | GLenum GLVariablePrecision(const TType &type); |
| 29 | bool IsVaryingIn(TQualifier qualifier); |
| 30 | bool IsVaryingOut(TQualifier qualifier); |
| 31 | bool IsVarying(TQualifier qualifier); |
Jamie Madill | f257598 | 2014-06-25 16:04:54 -0400 | [diff] [blame] | 32 | InterpolationType GetInterpolationType(TQualifier qualifier); |
Jamie Madill | 033dae6 | 2014-06-18 12:56:28 -0400 | [diff] [blame] | 33 | TString ArrayString(const TType &type); |
| 34 | |
| 35 | } |
| 36 | |
daniel@transgaming.com | 91ed149 | 2010-10-29 03:11:43 +0000 | [diff] [blame] | 37 | #endif // COMPILER_UTIL_H |