Keep track of the index name of excessive loops.

TRAC #21167 ISSUE=338 Signed-off-by: Daniel Koch Author: Nicolas Capens git-svn-id: https://angleproject.googlecode.com/svn/trunk@1210 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent 0933b0cc
......@@ -87,6 +87,8 @@ OutputHLSL::OutputHLSL(TParseContext &context) : TIntermTraverser(true, true, tr
mContainsLoopDiscontinuity = false;
mOutputLod0Function = false;
mInsideDiscontinuousLoop = false;
mExcessiveLoopIndex = NULL;
}
OutputHLSL::~OutputHLSL()
......@@ -2052,6 +2054,9 @@ bool OutputHLSL::handleExcessiveLoop(TIntermLoop *node)
return false; // Not an excessive loop
}
TIntermSymbol *restoreIndex = mExcessiveLoopIndex;
mExcessiveLoopIndex = index;
out << "{int ";
index->traverse(this);
out << ";\n";
......@@ -2095,6 +2100,8 @@ bool OutputHLSL::handleExcessiveLoop(TIntermLoop *node)
out << "}";
mExcessiveLoopIndex = restoreIndex;
return true;
}
else UNIMPLEMENTED();
......
......@@ -144,6 +144,8 @@ class OutputHLSL : public TIntermTraverser
bool mContainsLoopDiscontinuity;
bool mOutputLod0Function;
bool mInsideDiscontinuousLoop;
TIntermSymbol *mExcessiveLoopIndex;
};
}
......
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