Hash :
38ff3c70
Author :
Date :
2019-05-15T10:07:09
Vulkan:Allow same-named var in nested scope ESSL 1.00 spec allows for variable with same name to override outer variable inside of a nested scope. This change adds new scope to symbol table inside of a function defintion, but after function parameters for ESSL 1.00 shaders (but not webGL). This prevents an error while parsing. This also includes some new code in translator to rename any vars that are redefined between the function body and the function parameters. This prevents an error later on when the translated shader is then parsed as a desktop GLSL version. Bug: angleproject:3287 Change-Id: I3f025805cf8d65bf912283bb15e6dad6e5e9b967 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1601553 Commit-Queue: Tobin Ehlis <tobine@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
//
// Copyright 2019 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.
//
// ReplaceShadowingVariables.h: Find any variables that are redefined within a nested
// scope and replace them with a newly named variable.
#ifndef COMPILER_TRANSLATOR_TREEUTIL_REPLACESHADOWINGVARIABLES_H_
#define COMPILER_TRANSLATOR_TREEUTIL_REPLACESHADOWINGVARIABLES_H_
namespace sh
{
class TIntermBlock;
class TSymbolTable;
void ReplaceShadowingVariables(TIntermBlock *root, TSymbolTable *symbolTable);
} // namespace sh
#endif // COMPILER_TRANSLATOR_TREEUTIL_REPLACESHADOWINGVARIABLES_H_