src/compiler/translator/tree_ops/SeparateDeclarations.cpp


Log

Author Commit Date CI Message
Kimmo Kinnunen 03c75d35 2024-11-14T14:24:44 Remove SeparateStructFromFunctionDeclarations Move SeparateStructFromFunctionDeclarations to SeparateDeclarations It is logical part of the separate declarations step. Bug: angleproject:378966971 Change-Id: Ie102a1d936f7b444f5f9f2ac2fe8dc6c10027782 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6022857 Auto-Submit: Kimmo Kinnunen <kkinnunen@apple.com> Commit-Queue: Kimmo Kinnunen <kkinnunen@apple.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Kimmo Kinnunen 4397ff2f 2024-10-25T16:55:30 Metal: SeparateCompoundStructDeclarations fails validation Consider GLSL: struct S { int i; } s; s=s; SeparateCompoundStructDeclarations would rewrite this to: struct S { int i; }; S s'; s=s; The interm rewrite would rewrite the specification and declaration of s, but not the use sites. The use sites would use the old type, and thus something that was not in the tree anymore. This would fail the validation. This kind of bug was previously fixed for SeparateDeclarations in commit 18fa02bebf901dd8501de3176f6052ae4ce984be. Fix by adding the logic to SeparateDeclarations, as it is already doing almost the exact task, separating `struct S { ..} a, b`. The separation is tested in GLSLTests.StructInShader and various other draw tests. These pass with MSL, but these would also fail validation if that was enabled. Bug: angleproject:375523825 Change-Id: I1697103d0ba47616dbd3159f36f9e71cb2831c4b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5964899 Auto-Submit: Kimmo Kinnunen <kkinnunen@apple.com> Commit-Queue: Kimmo Kinnunen <kkinnunen@apple.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Kimmo Kinnunen 18fa02be 2024-03-12T10:23:55 Rewrite exprs using separated decl variables Rewrite expressions that use the rewritten struct declaration variables. Declaration that specfies a struct and defines multiple variables will get its variable declarations separated. The type of the variable changes when a struct specifier is removed for the second and rest of the variable declarations. The type of the variable changes also when a anonymous struct is named. The expressions that used the separated variables used the old struct as their types. Fix by using TIntermRebuild. Upon creating a new symbol node referencing the new type, the rebuilder will instantiate also all the needed intermediate nodes, which then get the correct struct type. For consistency, fix the case of anonymous struct -> named struct transform naming the variables similar to named struct separation. Consider base case: struct S { .. } a, b; -> struct S { .. } a; S b; Compare against case: struct { .. } a, b; Before, inconsistency: struct s1 { .. }; s1 a; s1 b; After, fixed: struct s1 { .. } a; s1 b; Bug: angleproject:8590 Change-Id: Iffb0ef4441d6021e076b04485b808b26a7fa4dcb Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5365201 Auto-Submit: Kimmo Kinnunen <kkinnunen@apple.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Kimmo Kinnunen <kkinnunen@apple.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Eddie Hatfield 91976352 2022-06-21T15:41:02 Use C++17 attributes instead of custom macros Bug: angleproject:6747 Change-Id: Iad6c7cd8a18d028e01da49b647c5d01af11e0522 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3718999 Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi ae555e85 2021-09-05T21:43:03 Translator: Fix uninitialized TStructure::mAtGlobalScope This flag was not set in SeparateDeclarations when creating a struct. Bug: chromium:1246301 Change-Id: I673a7158bcc8ead0fd36a5b00696dd990950a8c0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3139663 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 9d0e2851 2021-09-01T00:42:58 Fix SeparateDeclarations vs struct specifiers Bug: chromium:1237696 Change-Id: I3b00f3797800e814ca83226a8e4f25b2a43cc641 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3133824 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com>
Shahbaz Youssefi 9f4b159b 2021-01-19T12:48:15 Translator: Avoid vector copies with multi-replacement Turns push_backs into emplace_backs and changes the TIntermSequence constructor argument to &&. Bug: angleproject:5535 Change-Id: I640ce879b6ade48a28dea6385ebb7a95cb8304ff Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2636680 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com>
Shahbaz Youssefi 472c74c6 2019-08-19T16:32:13 Translator: Allow tree validation in children of TCompiler This is to be able to perform validation inside TranslatorVulkan, even if it's through ASSERTs. Additionally, every transformation is changed such that they do their validation themselves. TIntermTraverser::updateTree() performs the validation, which indirectly validates many of three tree transformations. Some of the more ancient transformations that don't use this function directly call TCompiler::validateAST. Bug: angleproject:2733 Change-Id: Ie4af029d34e053c5ad1dc8c2c2568eecd625d344 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1761149 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Stuart Morgan 9d737966 2019-08-14T12:25:12 Standardize copyright notices to project style For all "ANGLE Project" copyrights, standardize to the format specified by the style guide. Changes: - "Copyright (c)" and "Copyright(c)" changed to just "Copyright". - Removed the second half of date ranges ("Y1Y1-Y2Y2"->"Y1Y1"). - Fixed a small number of files that had no copyright date using the initial commit year from the version control history. - Fixed one instance of copyright being "The ANGLE Project" rather than "The ANGLE Project Authors" These changes are applied both to the copyright of source file, and where applicable to copyright statements that are generated by templates. BUG=angleproject:3811 Change-Id: I973dd65e4ef9deeba232d5be74c768256a0eb2e5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1754397 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill b980c563 2018-11-27T11:34:27 Reformat all cpp and h files. This applies git cl format --full to all ANGLE sources. Bug: angleproject:2986 Change-Id: Ib504e618c1589332a37e97696cdc3515d739308f Reviewed-on: https://chromium-review.googlesource.com/c/1351367 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Olli Etuaho a07b4213 2018-03-22T16:13:13 Move AST transformations to a subdirectory Move AST transformations to compiler/translator/tree_ops. BUG=angleproject:2409 TEST=angle_unittests Change-Id: I9c620e98707d22d005da6192fe7d1b4e8030aadd Reviewed-on: https://chromium-review.googlesource.com/975550 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>