blob: 77e0a8fb37650d35d7376559c0b325d2be527fa2 [file] [log] [blame]
zmo@google.com5601ea02011-06-10 18:23:25 +00001//
Jamie Madill02f20dd2013-09-12 12:07:42 -04002// Copyright (c) 2002-2013 The ANGLE Project Authors. All rights reserved.
zmo@google.com5601ea02011-06-10 18:23:25 +00003// Use of this source code is governed by a BSD-style license that can be
4// found in the LICENSE file.
5//
6
Geoff Lang17732822013-08-29 13:46:49 -04007#include "compiler/translator/OutputESSL.h"
zmo@google.com5601ea02011-06-10 18:23:25 +00008
Zhenyao Mo05b6b7f2015-03-02 17:08:09 -08009TOutputESSL::TOutputESSL(TInfoSinkBase &objSink,
shannon.woods@transgaming.com1d432bb2013-01-25 21:57:28 +000010 ShArrayIndexClampingStrategy clampingStrategy,
daniel@transgaming.com0aa3b5a2012-11-28 19:43:24 +000011 ShHashFunction64 hashFunction,
Zhenyao Mo05b6b7f2015-03-02 17:08:09 -080012 NameMap &nameMap,
13 TSymbolTable &symbolTable,
Olli Etuaho853dc1a2014-11-06 17:25:48 +020014 int shaderVersion,
15 bool forceHighp)
Zhenyao Mo05b6b7f2015-03-02 17:08:09 -080016 : TOutputGLSLBase(objSink,
17 clampingStrategy,
18 hashFunction,
19 nameMap,
20 symbolTable,
21 shaderVersion,
22 SH_ESSL_OUTPUT),
Olli Etuaho853dc1a2014-11-06 17:25:48 +020023 mForceHighp(forceHighp)
zmo@google.com5601ea02011-06-10 18:23:25 +000024{
25}
26
27bool TOutputESSL::writeVariablePrecision(TPrecision precision)
28{
29 if (precision == EbpUndefined)
30 return false;
31
32 TInfoSinkBase& out = objSink();
Olli Etuaho853dc1a2014-11-06 17:25:48 +020033 if (mForceHighp)
34 out << getPrecisionString(EbpHigh);
35 else
36 out << getPrecisionString(precision);
zmo@google.com5601ea02011-06-10 18:23:25 +000037 return true;
38}