Use a different name for ternary operator unfolding temporaries, to avoid…

Use a different name for ternary operator unfolding temporaries, to avoid clashes with T x = x handling. TRAC #18382 Signed-off-by: Daniel Koch Author: Nicolas Capens git-svn-id: https://angleproject.googlecode.com/svn/trunk@783 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent 2fa45510
#define MAJOR_VERSION 0 #define MAJOR_VERSION 0
#define MINOR_VERSION 0 #define MINOR_VERSION 0
#define BUILD_VERSION 0 #define BUILD_VERSION 0
#define BUILD_REVISION 782 #define BUILD_REVISION 783
#define STRINGIFY(x) #x #define STRINGIFY(x) #x
#define MACRO_STRINGIFY(x) STRINGIFY(x) #define MACRO_STRINGIFY(x) STRINGIFY(x)
......
...@@ -1503,7 +1503,7 @@ bool OutputHLSL::visitSelection(Visit visit, TIntermSelection *node) ...@@ -1503,7 +1503,7 @@ bool OutputHLSL::visitSelection(Visit visit, TIntermSelection *node)
if (node->usesTernaryOperator()) if (node->usesTernaryOperator())
{ {
out << "t" << mUnfoldSelect->getTemporaryIndex(); out << "s" << mUnfoldSelect->getTemporaryIndex();
} }
else // if/else statement else // if/else statement
{ {
......
...@@ -32,7 +32,7 @@ bool UnfoldSelect::visitSelection(Visit visit, TIntermSelection *node) ...@@ -32,7 +32,7 @@ bool UnfoldSelect::visitSelection(Visit visit, TIntermSelection *node)
{ {
int i = mTemporaryIndex++; int i = mTemporaryIndex++;
out << mOutputHLSL->typeString(node->getType()) << " t" << i << ";\n"; out << mOutputHLSL->typeString(node->getType()) << " s" << i << ";\n";
node->getCondition()->traverse(this); node->getCondition()->traverse(this);
out << "if("; out << "if(";
...@@ -40,14 +40,14 @@ bool UnfoldSelect::visitSelection(Visit visit, TIntermSelection *node) ...@@ -40,14 +40,14 @@ bool UnfoldSelect::visitSelection(Visit visit, TIntermSelection *node)
out << ")\n" out << ")\n"
"{\n"; "{\n";
node->getTrueBlock()->traverse(this); node->getTrueBlock()->traverse(this);
out << " t" << i << " = "; out << " s" << i << " = ";
node->getTrueBlock()->traverse(mOutputHLSL); node->getTrueBlock()->traverse(mOutputHLSL);
out << ";\n" out << ";\n"
"}\n" "}\n"
"else\n" "else\n"
"{\n"; "{\n";
node->getFalseBlock()->traverse(this); node->getFalseBlock()->traverse(this);
out << " t" << i << " = "; out << " s" << i << " = ";
node->getFalseBlock()->traverse(mOutputHLSL); node->getFalseBlock()->traverse(mOutputHLSL);
out << ";\n" out << ";\n"
"}\n"; "}\n";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment