blob: 4dbaf3c9b8f45f095036525727d4ea7d8dab181f [file] [log] [blame]
daniel@transgaming.com91ed1492010-10-29 03:11:43 +00001//
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 Madill033dae62014-06-18 12:56:28 -040010#include "compiler/translator/Types.h"
Jamie Madillf51639a2014-06-25 16:04:57 -040011#include "angle_gl.h"
Jamie Madill033dae62014-06-18 12:56:28 -040012#include "common/shadervars.h"
13
Zhenyao Mof1d723c2013-09-23 14:57:07 -040014// 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.
18extern bool atof_clamp(const char *str, float *value);
daniel@transgaming.com91ed1492010-10-29 03:11:43 +000019
Zhenyao Mof1d723c2013-09-23 14:57:07 -040020// If overflow happens, clamp the value to INT_MIN or INT_MAX.
21// Return false if overflow happens.
22extern bool atoi_clamp(const char *str, int *value);
daniel@transgaming.com91ed1492010-10-29 03:11:43 +000023
Jamie Madill033dae62014-06-18 12:56:28 -040024namespace sh
25{
26
27GLenum GLVariableType(const TType &type);
28GLenum GLVariablePrecision(const TType &type);
29bool IsVaryingIn(TQualifier qualifier);
30bool IsVaryingOut(TQualifier qualifier);
31bool IsVarying(TQualifier qualifier);
Jamie Madillf2575982014-06-25 16:04:54 -040032InterpolationType GetInterpolationType(TQualifier qualifier);
Jamie Madill033dae62014-06-18 12:56:28 -040033TString ArrayString(const TType &type);
34
35}
36
daniel@transgaming.com91ed1492010-10-29 03:11:43 +000037#endif // COMPILER_UTIL_H