Ensure nested ternary operator unfolding uses a new scope to avoid redefinition…

Ensure nested ternary operator unfolding uses a new scope to avoid redefinition of the same temporary variable. TRAC #22629 Signed-off-by: Jamie Madill Signed-off-by: Shannon Woods Author: Nicolas Capens git-svn-id: https://angleproject.googlecode.com/svn/trunk@1835 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent 2576f07c
#define MAJOR_VERSION 1
#define MINOR_VERSION 0
#define BUILD_VERSION 0
#define BUILD_REVISION 1834
#define BUILD_REVISION 1835
#define STRINGIFY(x) #x
#define MACRO_STRINGIFY(x) STRINGIFY(x)
......
//
// Copyright (c) 2002-2012 The ANGLE Project Authors. All rights reserved.
// Copyright (c) 2002-2013 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
......@@ -111,6 +111,8 @@ bool UnfoldShortCircuit::visitSelection(Visit visit, TIntermSelection *node)
out << mOutputHLSL->typeString(node->getType()) << " s" << i << ";\n";
out << "{\n";
mTemporaryIndex = i + 1;
node->getCondition()->traverse(this);
out << "if(";
......@@ -135,6 +137,8 @@ bool UnfoldShortCircuit::visitSelection(Visit visit, TIntermSelection *node)
out << ";\n"
"}\n";
out << "}\n";
mTemporaryIndex = i + 1;
}
......
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