src/tests/compiler_tests/SeparateDeclarations_test.cpp


Log

Author Commit Date CI Message
Yuxin Hu 1d8279a2 2025-08-13T13:35:02 Do not sort ANGLE internal uniforms or built-in uniforms On Mac, for webGL app on chrome, if the uniforms added by ANGLE are not placed at the top of the ANGLE_UserUniforms struct, the user defined uniforms in the same ANGLE_UserUniforms struct seem to be messed up and not read correctly by shader code. This change fixes it by moving the sortUniforms() function call to the place before we add ANGLE internal uniforms. That way ANGLE internal uniforms will be inserted later and stay on top of ANGLE_UserUniforms struct. Bug: chromium:437678149 Change-Id: I34a0d3dcb98c5fe30ad248381ecb5f7f78252275 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6847281 Auto-Submit: Yuxin Hu <yuxinhu@google.com> Commit-Queue: Yuxin Hu <yuxinhu@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com>
Yuxin Hu 1e613fec 2025-05-27T16:59:26 Compiler: sort uniforms by precision This change reoreders the AST sequences so that uniform declarations with lower precisions are places in front of uniform declarations with higher precisions. This is to prepare for the upcoming change that converts uniforms declared with mediump or lowp to 16-bit and pack them to 32-bit integeter using packHalf2x16(). Bug: b/405795981 Change-Id: I5e1e293399dc8b51b9a6e83115f95beb0c4a7b1b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6594255 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com>
Kimmo Kinnunen 8e9dc1a6 2024-11-19T11:08:31 Validate anonymous struct names with namespace Consider GLSL: struct { vec4 e; } g; struct sbbf { vec4 f; }; The struct name validation would fail if user chosen struct name would clash with a symbol name that ANGLE internally gave to an anonymous struct. Fix by importing Name abstraction from MSL backend. A symbol name is a pair (namespace, string). Move operator<<(std::ostream &os, const ImmutableString &str) to sh namespace because that is more natural for operator overloading name resolution. MSVC works with this. Bug: angleproject:379758201 Change-Id: Icc9b02aa8cb532e1d925e2fba4c45468f01b9144 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6035029 Reviewed-by: Geoff Lang <geofflang@chromium.org> Auto-Submit: Kimmo Kinnunen <kkinnunen@apple.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Kimmo Kinnunen <kkinnunen@apple.com>
Kimmo Kinnunen df61fc7f 2024-11-14T13:31:24 Avoid reordering structs when separating from func Avoid reordering structs when separating struct declarations and function declarations. Consider: struct S1 { ... }; struct S2 { S1 a; } f(); SeparateStructFromFunctionDeclarations would insert the S2 to the beginning of the containg block, so before S1 definition. Fix by not inserting the structs to the parent block. Instead, return the nodes from multi-replacement, so that the struct definition is inserted at the site of the replaced function. Bug: angleproject:378966971 Change-Id: I47582660610c1fcb28a9b5bd592ac020b5c48e34 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6022856 Commit-Queue: Kimmo Kinnunen <kkinnunen@apple.com> Auto-Submit: Kimmo Kinnunen <kkinnunen@apple.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Kimmo Kinnunen 0d02f857 2024-11-07T09:32:28 Test SeparateDeclarations This makes it easier to fix issues with SeparateDeclarations Bug: angleproject:377330017 Change-Id: I53b9ca06971e0272563b6b3c752e0438c5802193 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6000533 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Auto-Submit: Kimmo Kinnunen <kkinnunen@apple.com> Commit-Queue: Kimmo Kinnunen <kkinnunen@apple.com>