Fix loop splitting.

Trac #15446 Issue=98 Signed-off-by: Daniel Koch git-svn-id: https://angleproject.googlecode.com/svn/trunk@555 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent e41afd8d
......@@ -1706,7 +1706,7 @@ bool OutputHLSL::handleExcessiveLoop(TIntermLoop *node)
if (comparator == EOpLessThan)
{
int iterations = (limit - initial + 1) / increment;
int iterations = (limit - initial) / increment;
if (iterations <= 255)
{
......@@ -1715,8 +1715,8 @@ bool OutputHLSL::handleExcessiveLoop(TIntermLoop *node)
while (iterations > 0)
{
int remainder = (limit - initial + 1) % increment;
int clampedLimit = initial + increment * std::min(255, iterations) - 1 - remainder;
int remainder = (limit - initial) % increment;
int clampedLimit = initial + increment * std::min(255, iterations);
// for(int index = initial; index < clampedLimit; index += increment)
......
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