blob: 40b45f2871fe7b496e1af88a113b5a9c75cfe86a [file] [log] [blame]
Jamie Madill033dae62014-06-18 12:56:28 -04001//
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 Lang0a73dd82014-11-19 16:18:08 -050010#ifndef COMPILER_TRANSLATOR_UTILSHLSL_H_
11#define COMPILER_TRANSLATOR_UTILSHLSL_H_
Jamie Madill033dae62014-06-18 12:56:28 -040012
13#include <vector>
14#include "compiler/translator/Types.h"
15
Jamie Madillf51639a2014-06-25 16:04:57 -040016#include "angle_gl.h"
Jamie Madill033dae62014-06-18 12:56:28 -040017
Olli Etuahof5cfc8d2015-08-06 16:36:39 +030018class TName;
19
Jamie Madill033dae62014-06-18 12:56:28 -040020namespace sh
21{
22
23TString TextureString(const TType &type);
24TString SamplerString(const TType &type);
25// Prepends an underscore to avoid naming clashes
26TString Decorate(const TString &string);
Olli Etuahof5cfc8d2015-08-06 16:36:39 +030027TString DecorateIfNeeded(const TName &name);
Olli Etuaho59f9a642015-08-06 20:38:26 +030028// Decorates and also unmangles the function name
29TString DecorateFunctionIfNeeded(const TName &name);
Jamie Madill033dae62014-06-18 12:56:28 -040030TString DecorateUniform(const TString &string, const TType &type);
31TString DecorateField(const TString &string, const TStructure &structure);
32TString DecoratePrivate(const TString &privateText);
33TString TypeString(const TType &type);
34TString StructNameString(const TStructure &structure);
35TString QualifiedStructNameString(const TStructure &structure, bool useHLSLRowMajorPacking,
36 bool useStd140Packing);
37TString InterpolationString(TQualifier qualifier);
38TString QualifierString(TQualifier qualifier);
39
40}
41
Geoff Lang0a73dd82014-11-19 16:18:08 -050042#endif // COMPILER_TRANSLATOR_UTILSHLSL_H_