Always collect variables when generating HLSL
HLSL output needs uniform information generated by the collectVariables()
step to be able to write uniform registers.
Tested manually by compiling a shader with a uniform with
shader_translator.
BUG=angleproject:1132
Change-Id: I91d19b5fa789b7b33cf76a654ffbbd17d279db01
Reviewed-on: https://chromium-review.googlesource.com/294962
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
diff --git a/src/compiler/translator/Compiler.h b/src/compiler/translator/Compiler.h
index 1fb5c82..cedb20c 100644
--- a/src/compiler/translator/Compiler.h
+++ b/src/compiler/translator/Compiler.h
@@ -164,6 +164,11 @@
std::vector<sh::Varying> varyings;
std::vector<sh::InterfaceBlock> interfaceBlocks;
+ virtual bool shouldCollectVariables(int compileOptions)
+ {
+ return (compileOptions & SH_VARIABLES) != 0;
+ }
+
private:
// Creates the function call DAG for further analysis, returning false if there is a recursion
bool initCallDag(TIntermNode *root);