src/compiler/translator/WrapSwitchStatementsInBlocks.cpp


Log

Author Commit Date CI Message
Olli Etuaho f6d242ed 2017-10-12T17:21:06 Wrap switch statements in blocks in HLSL If variables are declared inside a GLSL switch statement, they are scoped until the end of the switch statement. This is not compatible with HLSL rules, where the scoping is until the end of the case. To work around this, wrap switch statements in a block that declares the variables in HLSL. This is done after most other transformations done to the AST are complete, since some of the other transformations may introduce temporary variables. BUG=angleproject:2179 TEST=angle_end2end_tests Change-Id: Id0bb89affe103177fd3d6a6b2f3619b5e1ada0a6 Reviewed-on: https://chromium-review.googlesource.com/716381 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>