Initialize BuiltInFunctionEmulator outside Compiler
This moves GLSL output specific code from the Compiler class to the
GLSL/ESSL translators.
BUG=angleproject:865
Change-Id: I2d552e9cdb41f7d8ddfee7b0249a99d629a6d7d7
Reviewed-on: https://chromium-review.googlesource.com/255471
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
diff --git a/src/compiler/translator/OutputHLSL.cpp b/src/compiler/translator/OutputHLSL.cpp
index b109ad3..5bf7d7b 100644
--- a/src/compiler/translator/OutputHLSL.cpp
+++ b/src/compiler/translator/OutputHLSL.cpp
@@ -12,6 +12,7 @@
#include "common/angleutils.h"
#include "common/utilities.h"
+#include "compiler/translator/BuiltInFunctionEmulator.h"
#include "compiler/translator/BuiltInFunctionEmulatorHLSL.h"
#include "compiler/translator/DetectDiscontinuity.h"
#include "compiler/translator/FlagStd140Structs.h"
@@ -178,7 +179,8 @@
RewriteElseBlocks(treeRoot);
}
- BuiltInFunctionEmulatorHLSL builtInFunctionEmulator;
+ BuiltInFunctionEmulator builtInFunctionEmulator;
+ InitBuiltInFunctionEmulatorForHLSL(&builtInFunctionEmulator);
builtInFunctionEmulator.MarkBuiltInFunctionsForEmulation(treeRoot);
// Output the body and footer first to determine what has to go in the header
@@ -289,7 +291,7 @@
return init;
}
-void OutputHLSL::header(const BuiltInFunctionEmulatorHLSL *builtInFunctionEmulator)
+void OutputHLSL::header(const BuiltInFunctionEmulator *builtInFunctionEmulator)
{
TInfoSinkBase &out = getInfoSink();