blob: 7df69dd851e9bc3e7056980a3e025918b80dbc7f [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
daniel@transgaming.com0aa3b5a2012-11-28 19:43:24 +00009TOutputESSL::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,
12 NameMap& nameMap,
Jamie Madill02f20dd2013-09-12 12:07:42 -040013 TSymbolTable& symbolTable,
Olli Etuaho853dc1a2014-11-06 17:25:48 +020014 int shaderVersion,
15 bool forceHighp)
16 : TOutputGLSLBase(objSink, clampingStrategy, hashFunction, nameMap, symbolTable, shaderVersion),
17 mForceHighp(forceHighp)
zmo@google.com5601ea02011-06-10 18:23:25 +000018{
19}
20
21bool TOutputESSL::writeVariablePrecision(TPrecision precision)
22{
23 if (precision == EbpUndefined)
24 return false;
25
26 TInfoSinkBase& out = objSink();
Olli Etuaho853dc1a2014-11-06 17:25:48 +020027 if (mForceHighp)
28 out << getPrecisionString(EbpHigh);
29 else
30 out << getPrecisionString(precision);
zmo@google.com5601ea02011-06-10 18:23:25 +000031 return true;
32}