src/compiler/translator


Log

Author Commit Date CI Message
Matthew Denton 0cdbc781 2025-03-06T11:22:18 WGSL: Output samplers, including samplers from structs This output two WGSL variables for each GLSL sampler, including samplers in structs. This does not output the correct types for the WGSL variables, yet, nor does it generate texture access function calls. It also can't deal with arrays of samplers, which are not allowed in WGSL. Note that WGSL does not allow structs containing samplers to be arguments to a function, like Vulkan, nor does it allowed arrays of samplers at all, unlike Vulkan. This deals with the former problem the same way as Vulkan and Metal, by monomorphizing functions that take unsupported arguments. Bug: angleproject:389145696 Change-Id: I346688783dd2771c8fe6848b6783d948ed111783 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6253672 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Matthew Denton <mpdenton@chromium.org>
Shahbaz Youssefi 3d806ba6 2025-03-02T00:15:36 Translator: Split textureGather* ops ... based on whether the comp or refz arguments are present. Bug: angleproject:349994211 Change-Id: I19e638f6cb27cdb890c5e30c0662aad30888d2da Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6313582 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com> Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 8dd4a6e8 2025-02-28T16:50:51 Translator: Remove rect and 2DMS* images from atomic ops They are a relic of desktop GLSL support. Bug: angleproject:349994211 Change-Id: I111467fea111d22e2d12003d639bec268e418b44 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6313639 Commit-Queue: Cody Northrop <cnorthrop@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com> Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi d39cabbd 2025-02-27T15:15:46 Translator: textureGather* always takes refZ with shadow sampler Bug: angleproject:349994211 Change-Id: I8337b80bf1d9ecae6943c6f1432b710040081273 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6309579 Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Alexey Knyazev 03de46ef 2025-02-20T00:00:00 Metal: Remove divMatrixScalar polyfills MSL 2.3+ natively supports matrix by scalar division. Bug: angleproject:372169468 Change-Id: I2055ab8cfff01d8a52ddc0de4d5c3bc115271aed Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6289047 Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Aurora Zhang 3972cfa1 2025-02-18T19:52:06 YUV should support on all the shader stages * The spec requires all shader stages should support YUV. Therefore, move YUV related functions out of the switch. * Add a new end2end test that sampling YUV in the vertex shader. Bug: angleproject:391919465 Change-Id: I7811d419d5f1461c2499c522a902c3b2149289a1 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6263325 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Roman Lavrov c4caed5f 2025-02-10T06:17:01 Revert "UNREACHABLE -> __builtin_unreachable() in release clang builds" This reverts commit 7370bb573dd8b37006d409fc8917ff49912dd75a. Reason for revert: issue identified by fuzzer crbug.com/394980074 Original change's description: > UNREACHABLE -> __builtin_unreachable() in release clang builds > > This enables compiler optimizations such as reducing the amount of > branching, see anglebug.com/394129077#comment1 > > Reduces .so size in an Android perf build by 0.4%. I spot checked a few > differences and saw less branches (this will be causing a different > behavior in UNREACHABLE branches) as well as more functions getting > inlined (likely due to compiler heuristics due to less branches) > > Bug: angleproject:394129077 > Change-Id: I23411ca7a49d3daf2a0621bfcc0b2523d4db4f5a > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6231111 > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > Reviewed-by: Charlie Lao <cclao@google.com> > Commit-Queue: Roman Lavrov <romanl@google.com> Bug: angleproject:394129077 Bug: chromium:394980074 Change-Id: I7398d86c692e5c50ac1185c30e2053eb87f9bd70 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6248417 Auto-Submit: Roman Lavrov <romanl@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Roman Lavrov 7370bb57 2025-02-04T13:19:37 UNREACHABLE -> __builtin_unreachable() in release clang builds This enables compiler optimizations such as reducing the amount of branching, see anglebug.com/394129077#comment1 Reduces .so size in an Android perf build by 0.4%. I spot checked a few differences and saw less branches (this will be causing a different behavior in UNREACHABLE branches) as well as more functions getting inlined (likely due to compiler heuristics due to less branches) Bug: angleproject:394129077 Change-Id: I23411ca7a49d3daf2a0621bfcc0b2523d4db4f5a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6231111 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Roman Lavrov <romanl@google.com>
Geoff Lang 1161ac8e 2025-01-23T13:25:01 WebGPU: Implement no-op gl_PointSize Support writing to the gl_PointSize builtin but do not pass it to the next shader stages. Bug: angleproject:392604862 Change-Id: I845a3edeb0ce8e7ea41a5e96e5f3b443100f2cbf Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6194555 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Matthew Denton <mpdenton@chromium.org>
Matthew Denton 8ee72cc7 2025-01-13T13:44:31 WGSL: support matCx2 in uniforms matCx2 in WGSL does not match std140 layout and so it needs to be translated as array<ANGLE_wrapped_vec2, C> when in a uniform. On use it needs to be converted to a WGSL-native matCx2. This also includes the optimization of an array<matCx2> in a uniform--when indexing into it, only the indexed element will be converted to a native matCx2, instead of converting the entire array and then indexing. Bug: angleproject:376553328 Change-Id: I1d84471234b3d3cf4cf361ae89cb61675d5bf9a8 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6157788 Reviewed-by: Liza Burakova <liza@chromium.org> Commit-Queue: Matthew Denton <mpdenton@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Kimmo Kinnunen 0cfea380 2025-01-15T10:46:54 Rename sh::TSpan as general purpose angle::Span Span abstraction is useful for making buffer manipulation more consistent. The commit makes the Span available to all code until std::span can be used. Bug: angleproject:389951202 Change-Id: Id0c6b54bb6e75d3cc4e85af854d9e61b66906752 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6170997 Reviewed-by: Geoff Lang <geofflang@chromium.org> Auto-Submit: Kimmo Kinnunen <kkinnunen@apple.com> Commit-Queue: Kimmo Kinnunen <kkinnunen@apple.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 65513240 2025-01-03T17:26:55 Fix initializing output variables ... by compiling a list of TVariables instead of names that are later looked up. The latter results in wrong symbols being initialized when the output variables are shadowed. Bug: chromium:376738756 Bug: chromium:377553431 Change-Id: I76b9688c035476c547ac73cff380629161210406 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6143374 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Matthew Denton b1a0d60f 2025-01-08T15:10:41 WGSL: Fix accidentally overloaded functions Small-stride arrays in uniforms with the same element type, but different array sizes, would cause the WGSL generator to produce conversion functions with the same name but different array sizes. This CL puts the array size in the name of the function to avoid overloading, which is unsupported in WGSL. Bug: angleproject:376553328 Change-Id: I446e91ccb9da2872c88f1a4e05283aacc9d6f8b1 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6160334 Commit-Queue: Matt Denton <mpdenton@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Auto-Submit: Matthew Denton <mpdenton@chromium.org> Reviewed-by: Matt Denton <mpdenton@google.com> Reviewed-by: Liza Burakova <liza@chromium.org>
Matthew Denton 363f6264 2025-01-07T10:35:09 WGSL: unwrap single array element from uniform ...instead of unwrapping the entire array when only one element is being accessed. The is step #4 from the implementation plan in https://docs.google.com/document/d/17Qku1QEbLDhvJS-JJ9lPQAbnuZtLxWhG-ha5eCUhtEY/edit?tab=t.0#bookmark=id.dt9vmixnpdvo Bug: angleproject:376553328 Change-Id: I6c559f44b75cd1d3c4a478141c11f65a33d76bdf Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6102117 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Matt Denton <mpdenton@google.com> Reviewed-by: Matt Denton <mpdenton@google.com> Reviewed-by: Liza Burakova <liza@chromium.org>
Shahbaz Youssefi 6f32ed6c 2025-01-03T23:54:22 Fix struct sampler rewrite vs comma Bug: chromium:377614665 Change-Id: I2c0e8230e31405c9e7fd165a9fca68b7e9f31a76 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6142516 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi d1496a22 2025-01-03T22:54:27 Produce same compile errors for op= as op Bug: chromium:376787367 Change-Id: Ic2c1415c184c603b86876e5eb70eee602639abbf Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6142515 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Alexey Knyazev <lexa.knyazev@gmail.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Matthew Denton 53ec86ab 2024-12-17T14:40:31 WGSL: support small stride arrays in uniforms WGSL requires arrays in the uniform address space to have a stride a multiple of 16. This CL makes WGSL translator emit wrapper structs for array element types used in the uniform address space, when the array stride is not a multiple of 16. The exception is for structs that aren't an aligned size of 16n, and for any types matCx2, since they are (or will be) handled in different ways that ensure alignment to 16. This should leave only f32, i32, u32, and vec2. See https://www.w3.org/TR/WGSL/#example-67da5de6 for an example of using a wrapper struct. This requires converting arrays with a wrapper struct element type to arrays with an unwrapped element type when they are first used; this can be "optimized" later for the common case of accessing a single array element, which can then be unwrapped immediately. This CL generates WGSL conversion functions when necessary. After this, the only types that can't yet be used in a uniform are matCx2 and bools. This is #2 in https://docs.google.com/document/d/17Qku1QEbLDhvJS-JJ9lPQAbnuZtLxWhG-ha5eCUhtEY/edit?tab=t.0#bookmark=id.rt3slgehd4te Bug: angleproject:376553328 Change-Id: I1edfa7f481a6cbf5b595643aae8728e67bc4b770 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6092038 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Liza Burakova <liza@chromium.org> Reviewed-by: Matt Denton <mpdenton@google.com> Commit-Queue: Matt Denton <mpdenton@google.com>
Shahbaz Youssefi f80d15ad 2025-01-03T16:19:13 Vulkan: Fix crash with array of array of samplers vs comma Bug: chromium:385256122 Change-Id: I9b356401e7c007060e95bb95ca8269411178ce66 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6143373 Reviewed-by: Yuxin Hu <yuxinhu@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi e72cc71b 2024-12-13T11:59:29 Vulkan: Remove framebuffer fetch from shader if unused Some application shaders may use `inout` variables to simplify shader generation (presumably), but in the end don't actually ever read from those variables. This change tries to detect some very simple but common cases where it's clear that the shader completely overwrites the variable without reading from it and turns `inout` into `out`. When coherent framebuffer fetch emulation kicks in, these shaders would no longer cause unnecessary barriers. Bug: angleproject:377923479 Change-Id: I0970b72f551b24409337a375cf97aa63bb511fb5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6094425 Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Roman Lavrov <romanl@google.com> Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Roman Lavrov <romanl@google.com>
Alexey Knyazev e82a2eab 2024-11-28T00:00:00 Support multisample 2D array textures on ES 3.0 contexts Supported via OES_texture_storage_multisample_2d_array enabled together with ANGLE_texture_multisample. Drive-by: Fixed exposure conditions in the OpenGL backend to match the implementation. Fixed: angleproject:382298321 Change-Id: I21b037aac7bebc35df267e9dd468088ebce35e71 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6075241 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com>
Matthew Denton 473798bf 2024-11-28T00:38:36 WGSL: @align appropriate struct members in uniforms. Structs used in the uniform address space need to have certain members aligned according to the uniform address space layout constraints (substantially similar to std140). This CL adds @align annotations where necessary, in structs used in the uniform address space. Strictly speaking, it's okay to apply @align annotations to all structs used in the WGSL program, but this CL uses a pre-pass AST traverser to records all the structs used in the uniform address space. This is to avoid more unreadable generated code, and when more transformations are applied to these structs in future CLs, less generated code overall. After this, the only types that can't yet be used in a uniform are matCx2, arrays with stride not divisble by 16 (except when the array element type is a struct), and bools. This is #1 in struct translation in https://docs.google.com/document/d/17Qku1QEbLDhvJS-JJ9lPQAbnuZtLxWhG-ha5eCUhtEY/edit?tab=t.0#bookmark=id.rudfrn2o6jv1 Bug: angleproject:376553328 Change-Id: Ibff3414043a6ecb4a01ef8e3e71dad9c1066ddfd Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6056951 Commit-Queue: Matthew Denton <mpdenton@chromium.org> Reviewed-by: Liza Burakova <liza@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Alexey Knyazev 5288ed36 2024-11-26T00:00:00 GL: Enable ANGLE_texture_multisample on OpenGL ES Trivially enabled on supported device contexts. Improved readablility of conditions for implicit GLSL version upgrades. Fixed: angleproject:381113379 Change-Id: I843f7119da2a3cffb255af97f654d714add9f482 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6055117 Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Alexey Knyazev 239ef680 2024-11-21T00:00:00 Metal: Support ANGLE_texture_multisample * Added explicit multisample texture creation support * Added support for SAMPLE_MASK frontend state * Adjusted Metal backend caps Fixed: angleproject:380475003 Change-Id: I90250e14da52869cb954b5a61d9c670e958a526c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6048958 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
Kimmo Kinnunen bfa03a84 2024-11-19T13:32:31 Metal: Fix vec swizzles to bvecs on AMD Constructing bvecs explicitly from swizzles would produce double swizzles, and this would fail validation at validateNoSwizzleOfSwizzle. Fix by folding the expression passed to coersion bvec constructor. Cannot test more in isolation for now, since AddExplicitTypeCasts uses Metal specific SymbolEnv. Bug: angleproject:379758210 Change-Id: I175941747ef1c7acb8c88683c1188843a154aa8a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6034935 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Auto-Submit: Kimmo Kinnunen <kkinnunen@apple.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 8409b41e 2024-11-20T14:38:30 Report error on unsized interface block array GLSL of forms: uniform S{...} a[]; in R{...} b[]; out Q{...} c[]; Should produce error unless the shader is tesselation or geometry shader. Fix the errors for VS and FS. GS and TS likely need more work. Bug: angleproject:379996129 Change-Id: Ib31c9a81717a8cd1c984eb4ce2e993d563bb3c4f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6038333 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Auto-Submit: Kimmo Kinnunen <kkinnunen@apple.com> Commit-Queue: Kimmo Kinnunen <kkinnunen@apple.com>
Kimmo Kinnunen ec773865 2024-11-19T14:46:29 Qualifier in const for sampler2D fails validation The commit 039660a0757e8e5b661c1850747b688b6642f56d failed to special cased "const in". Fix by special casing also on EvqParamConst. Bug: angleproject:379762012 Change-Id: Ife6966ea536972874645ae22b504712249817638 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6035505 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org> Auto-Submit: Kimmo Kinnunen <kkinnunen@apple.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 770242db 2024-11-20T17:03:07 Translator: Remove the `gimage1D` base type This is a desktop GL type, whose removal was left out of b16d105fc6. Bug: angleproject:370937467 Change-Id: I0bda5453b95ddf924ba0583de346902b333603a6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6037776 Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 1f0ac74a 2024-11-20T16:43:50 Translator: Remove SubpassInputMS ANGLE never generates multisampled input attachments, because it cannot know if the shader will be used with a single-sampled or multisampled framebuffer. The SPIR-V transformer takes care of changing the type and ops to be multisampled if needed. Bug: angleproject:37093746 Change-Id: Ic9c3057536c0a5d543512dbd3c347033453a29f4 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6039437 Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com>
Shahbaz Youssefi c4533e0a 2024-11-20T16:21:40 Translator: Remove the `double` base type This is a desktop GL type, whose removal was left out of b16d105fc6. Bug: angleproject:37093746 Change-Id: I185beef71099aafc3e350efc3dad019e2a72c0e6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6039436 Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com>
Kimmo Kinnunen 7ba69645 2024-11-14T10:07:31 Fix unnamed outs w/ initializeUninitializedLocals Fix translator initializeUninitializedLocals pass for anonymous out parameters. The parameters should be initialized to zero, similar to named but unassigned parameters. Initialization would be skipped on GLSL output, assert on Metal. Functions need to be replaced if their parameter names change. In case the function had a prototype declaration, that has to be replaced too. All calls to old functions must be replaced with calls to new function. Bug: angleproject:378584780 Change-Id: I9a990fa3840f6e26cd30f35bf6c99d9a8816f272 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6020245 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Auto-Submit: Kimmo Kinnunen <kkinnunen@apple.com> Commit-Queue: Kimmo Kinnunen <kkinnunen@apple.com>
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 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>
Matthew Denton 4a835cf2 2024-11-01T13:31:00 WebGPU: send uniforms to GPU for use in shader Basic uniforms should now be accessible in the shader during a draw call, rather than just via glGetUniform*(). This is unoptimized and creates a new GPU-side copy of all the uniforms, every time any uniform changes. This sets up the bind group layout for a pipeline and sets the bind groups in the renderer pass. Right now these bind groups only contain the default uniform blocks, but in the future will need to contain textures, samplers, and non-default uniform blocks (UBOs). Bug: angleproject:376553328 Change-Id: I50891b81ab2ee374d674213257f76319c0222120 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5980972 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Liza Burakova <liza@chromium.org> Commit-Queue: Matthew Denton <mpdenton@chromium.org>
Kimmo Kinnunen c46e6bac 2024-11-12T13:55:01 Make intermediate output symbol names consistent Make intermediate output symbol names consistent across uses in parameter names, struct names, variable names: - built-in without quotes - '' empty - #satb ANGLE internal - 'a' user-defined Previously empty parameters would output the symbol id-generated name ("sabb"), which was surprising when this is used only when the symbol is in AngleInternal namespace, and not in Empty namespace. Bug: angleproject:378584780 Change-Id: I87b13cf964a1ae3ee54b8f4ef7a00eddcd474760 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6011018 Auto-Submit: Kimmo Kinnunen <kkinnunen@apple.com> Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Kimmo Kinnunen b8b962d2 2024-11-08T14:53:00 Parse function parameters into TPublicType Parse function parameters into TPublicType instead of TType. TType holds the type info, TPublicType holds the type specification info. This helps in moving the TType::isStructSpecifier into the AST nodes, away from the type system which it is not part of. Removes duplicated code where unnamed unsized arrays would cause different error message than named unsized arrays. Bug: angleproject:377330017 Change-Id: I102b9e87823a545f7e64f971aafbdcd313a542fb Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6000009 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Kimmo Kinnunen <kkinnunen@apple.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Auto-Submit: Kimmo Kinnunen <kkinnunen@apple.com>
Kimmo Kinnunen efcb94ab 2024-11-06T15:55:02 Output the type of constant union Output the type of the constant union node in OutputTree output. This makes it easier to understand typing bugs related to the constant union. Adds a node nesting level for constant unions. This makes it easier to understand consecutive constant unions. Bug: angleproject:377330017 Change-Id: Ia83072b78c4d1713f839fd136692b254f6d2c517 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6000532 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Auto-Submit: Kimmo Kinnunen <kkinnunen@apple.com>
Shahbaz Youssefi e3011d96 2024-11-08T16:17:07 Translator: Optimize size calculation for variable arrays Bug: angleproject:373924024 Change-Id: Id3a8b844b8274c19c0c2c833842fb8b501f50174 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6004338 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org>
Kimmo Kinnunen eccfec93 2024-11-01T11:49:11 Metal: gl_ClipDistance fails validation Failure is "Found child with two parents". Result from reusing gl_ClipDistance in: float gl_ClipDistance[8]; ClipDistance_0 = gl_ClipDistance[0]; ... Fix by creating new node for each symbol access. Bug: angleproject:376718272 Change-Id: I7a866a10e389cc25d0cff4e6f18ae9c70ab376e0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5979781 Commit-Queue: Kimmo Kinnunen <kkinnunen@apple.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Auto-Submit: Kimmo Kinnunen <kkinnunen@apple.com>
Chris Dalton a05a0e15 2024-09-25T22:33:36 Validate PLS shaders against context state Add shader introspection for PLS uniforms and validate that they match context state during draw calls. Bug: angleproject:40096838 Change-Id: I76cdf8add03de8f8b0b3e772c15c0087c1d97e98 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5893962 Commit-Queue: Kenneth Russell <kbr@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org>
Kimmo Kinnunen b03f0148 2024-11-01T10:26:04 Metal: interpolateAtOffset fails validation Fix validation error Found function prototype with an invalid qualifier. The offset parameter was created with "global" qualifier. Bug: angleproject:376718268 Change-Id: I6f314a42fe1d35d54bb673cfa7d58eba526c9ea5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5979778 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Auto-Submit: Kimmo Kinnunen <kkinnunen@apple.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Kimmo Kinnunen bf29a047 2024-10-28T11:07:57 Metal: Remove uniform struct decl separation code Remove uniform specific struct declaration separation and anonymous struct naming code. This is already done by SeparateDeclarations. Removes code for NameEmbeddedUniformStructsMetal. Does not remove SeparateStructFromUniformDeclarations code as it is used for SPIRV. Bug: angleproject:375937551 Change-Id: I943d96897d97b23fd0f54155dc215a4490f63937 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5972994 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Kimmo Kinnunen <kkinnunen@apple.com>
Kimmo Kinnunen 2156cd6e 2024-10-31T14:22:31 Metal: Fix rewritten array variables clashes It was possible to generate MSL name clashes by declaring arrays, such as in: mat3 a[1] mat2 a_0; Complex GLSL outputs need to be linearized into primitive MSL types. This would happen for struct outputs, arrays and matrices. For these new MSL variables, the translator needs to invent new names that match, generated from both VS and FS. The clashes were due to the encoding scheme: For arrays, the MSL vertex output variable was named with _0 suffix for the array and _0 for the matrix row 0. In the example above, this would create a clash since also non-array mat would be linearized row-wise. For structs, field `a.b` would be encoded as `a_b`. By selecting different a and b, clashes could be generated trivially. It is redundant to encode named semantics in the out variable names. The only needed element is the discriminator which associates VS variables to FS variables. Currently this is done by using the user-provided root field name. Fix by encoding only the root variable name to the MSL variable name. The rest of the field discriminators are just a running number. Each GLSL name `a` is unique. MSL names get fixed suffix form `a_X`, and thus all of them are unique too. This is a continuation of following fixes that turned out to be incomplete: 6fe8a399dd Metal: Fix rewritten out variables with underscores 27423bffff Metal: Generate names for rewritten inputs Bug: angleproject:376417347 Change-Id: I407db373d201b3e321c6d8414bafdbecfd82cf19 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5979774 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Kimmo Kinnunen <kkinnunen@apple.com>
Kimmo Kinnunen 0624b4fb 2024-10-31T20:59:20 Metal: Make ToposortStructs compile on c++17 Use .find() != .end() instead of .contains() for std::unordered_map. Bug: angleproject:375352601 Change-Id: I2e550354e1df3b390b74fdea29427fd3a0326fe8 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5979775 Commit-Queue: Kimmo Kinnunen <kkinnunen@apple.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Kimmo Kinnunen 8d12b278 2024-03-15T15:39:39 Make separated anonymous in/out structs work better Fixes failing case for other backends than GLSL output: VS: out struct { .. } a, b; FS: in struct { .. } a, b Make the ANGLE VS-FS interface matching work by using the anonymous name as the variable structOrBlock name. Bug: angleproject:42267047 Change-Id: If8107387c02b5520134857fb210a27a8f92a2db0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5372727 Commit-Queue: Kimmo Kinnunen <kkinnunen@apple.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Auto-Submit: Kimmo Kinnunen <kkinnunen@apple.com> Reviewed-by: Kenneth Russell <kbr@chromium.org>
Kimmo Kinnunen b8d546b2 2024-10-30T15:40:58 Fix immutable string concats with ints `BuildConcatenatedImmutableString("a", 10, "b")` would construct "a\nb" because the implementation lacked int overloads and ints would be promoted to chars implicitly. Fix by implementing simpler way to calculate digits for numbers and then add useful overloads. Remove ImmutableStringBuilder::appendDecimal() since the code is already expecting << for all other types, and the bug was due to this expectation. Bug: angleproject:376417347 Change-Id: Iea5e14a6e2fede068b704754b9203db794dd5bf0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5972641 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Kimmo Kinnunen <kkinnunen@apple.com>
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 4a5b0284 2024-10-24T11:46:54 Disallow discarded uniform block references Uniform block instances cannot be used by themselves, as there is no way to refer to their type. Disallow the only typeless access pattern, discarding via expression statement: uniform MyBlock { int x; } b; void main() { b; 0, b; } Explained as disallowed in newer GLSL 300: https://github.com/KhronosGroup/WebGL/issues/3644 The comma expression form would ASSERT in CollectVariables. Bug: angleproject:42267026 Change-Id: I6c8b835482fd551bd97576c1bd24f005874da6af Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5961498 Reviewed-by: Alexey Knyazev <lexa.knyazev@gmail.com> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Kimmo Kinnunen <kkinnunen@apple.com> Auto-Submit: Kimmo Kinnunen <kkinnunen@apple.com>
Kimmo Kinnunen 898a1c12 2024-10-24T13:09:36 Metal: Fix ToposortStructs validation == failures ToposortStructs would convert mat, vec, struct == to ANGLE_equals() calls. However, the functions called were not in AST. This would cause "Found node calling previously undeclared function <validateFunctionCall>" validation error and ASSERT. Mat, vec equality calls would use prelude ANGLE_equals implementations. The MSL emit already does the conversion from == to ANGLE_equals for these builtins. For user-defined structs the logic would be: - collect struct decls, structs, create equality functions - toposort - for each sorted struct: - insert struct decl - insert equality function Move the equality function creation after the toposort: - collect struct decls, structs - toposort - for each sorted struct: - insert struct decl - create equality function - insert equality function This way the sort ensures that nested struct equality functions can refer to previously introduced equality functions. Bug: angleproject:375352601 Change-Id: I59efed98bca6d99b198abc2b5c7577cf5d1d5d83 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5961281 Auto-Submit: Kimmo Kinnunen <kkinnunen@apple.com> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Kimmo Kinnunen <kkinnunen@apple.com>
Shahbaz Youssefi 08c1724f 2024-10-11T14:29:00 Vulkan: Support GL_ARM_shader_framebuffer_fetch_depth_stencil Bug: angleproject:352364582 Change-Id: I63fd78314fa7ebccbf366c252e309a9c0f09c8c1 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5938150 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Yuxin Hu <yuxinhu@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Kimmo Kinnunen 12584049 2024-10-21T14:04:55 Make SimplifyLoopConditions testable Add ShCompileOptions::simplifyLoopConditions, so that tests can turn it on. Later edits to simplify loop condition logic are simpler to review when the testing related edits are landed separately. Test the feature by having ESSL as the input and ESSL as the natural output, to reflect how AST changes. To make the test expectations more deterministic across code changes, change SymbolTable::kLastBuiltInId to SymbolTable::kFirstUserDefinedSymbolId. This is simpler as no code needs to know exact last built in id, so we can just ensure that the user defined symbol ids do not clash with the builtin ids. Bug: angleproject:374585769 Change-Id: Iea0efb8ac2878691d0fd5ff5cfe9a49ac754515d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5946724 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Kimmo Kinnunen <kkinnunen@apple.com>
Shahbaz Youssefi 47c66901 2024-10-21T12:47:22 Vulkan: Set gl_Layer to 0 if the framebuffer is not layered Bug: angleproject:372390039 Change-Id: I29067c9488e06f6dd2e90f207fecb843267fb77c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5949263 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Yuxin Hu <yuxinhu@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi bbe68963 2024-10-21T15:11:27 Vulkan: Fix `precise` vs `mat4(...)[index]` Bug: angleproject:374801303 Change-Id: I45550abe406aaaf4d2c5eb5d7d694b2b30ab8e4e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5949528 Reviewed-by: mohan maiya <m.maiya@samsung.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com>
Shahbaz Youssefi 5c2a2fd5 2024-10-21T16:00:25 Vulkan: Fix `vec4(...).zxwy[index]` The code was actually correct, but included an unnecessary assertion. The code incorrectly assumed `.zxwy[index]` is pre-processed with a lookup table and turned into `[index']`, but it wasn't if the LHS is a constructor. The change just removes the assertion because it was correctly handling that already. Bug: angleproject:40096715 Change-Id: Ib1365f95a255ce3654831af55429361d35c026c4 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5949527 Reviewed-by: Yuxin Hu <yuxinhu@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Alexey Knyazev 4aa12e9e 2024-10-07T00:00:00 Metal: Remove macOS 11.0 availability checks Chromium now requires at least macOS 11.0. This also implies MSL 2.3 support. Bug: angleproject:371829506 Change-Id: I6aaf4d9775bfe58747df28173d3931aa11fa8d25 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5912903 Reviewed-by: Kimmo Kinnunen <kkinnunen@apple.com> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
Stephen White 4b1e58d9 2024-10-17T09:33:53 Fix for float constant precision in the GLSL backend. Increase the precision of floating point values written out via std::ostringstream. 8 digits is not sufficient to represent all floating point values. Note: the reason the locale test was modified is because it was using a value of 1.9, which has no exact fp32 representation. Increasing the precision causes it to print as 1.8999998 instead of 1.9, failing the test. I've adjusted the value to 1.5, since this does have an exact fp32 representation. (However, note that I couldn't get the test to fail when I removed the locale setting, with either 1.9 or 1.5. Perhaps the locale is being handled at a different level.) Bug: angleproject:374013421 Change-Id: Icb79eb9acd562c83d079f2cc2cdba253220e581e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5938473 Commit-Queue: Stephen White <senorblanco@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Alexey Knyazev 2f644ed8 2024-10-16T00:00:00 Implement NULL translator output Fixed: angleproject:373818287 Change-Id: If862e8e66a043ef968daea91d95717af97e3a0de Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5937827 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Alexey Knyazev e7f0d107 2024-10-03T00:00:00 Translator: Fix EXT_texture_query_lod shader types These functions are available only in fragment shaders. Bug: angleproject:368275901 Change-Id: Ief15e93d9c7042a8d5bc0f5f951df98149b44c70 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5922477 Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Alexey Knyazev ab1cdd22 2024-10-03T00:00:00 Translator: Support EXT_texture_query_lod No backend support yet. Bug: angleproject:368275901 Change-Id: I10bbc03feca485908315633cbc0f955e82994657 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5920240 Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi a8138547 2024-10-09T23:33:24 Translator: Support GL_ARM_shader_framebuffer_fetch_depth_stencil Bug: angleproject:352364582 Change-Id: I46ce6d75a76bdf04a9e8feea1a480e8a0badba2a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5924140 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yuxin Hu <yuxinhu@google.com> Reviewed-by: Charlie Lao <cclao@google.com>
Shahbaz Youssefi ae5c3b96 2024-10-08T17:02:21 Boilerplate for GL_ARM_shader_framebuffer_fetch_depth_stencil Bug: angleproject:352364582 Change-Id: I94c670db5546564a6f60bb513a6d7f3f5bd5778c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5916771 Reviewed-by: Yuxin Hu <yuxinhu@google.com> Reviewed-by: Charlie Lao <cclao@google.com>
Alexey Knyazev af33337a 2024-10-07T00:00:00 Metal: Remove unused MSL helpers These helpers are never emitted. Bug: angleproject:372169468 Change-Id: I306164aaf4db1b7070e3e4a0599f0f02a1e29c7d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5912762 Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Alexey Knyazev 0f7371ae 2024-10-07T00:00:00 Metal: Remove ANGLE_tensor macro Its replacement is never used. Fixed: angleproject:372053408 Change-Id: I1d54efcc1a1ecac1d0c6dae5ff7524b501297fe0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5912904 Reviewed-by: Kimmo Kinnunen <kkinnunen@apple.com> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
Alexey Knyazev cd10ad46 2024-09-30T00:00:00 Metal: Rework allowSamplerCompareGradient feature * AMD drivers may fail when a sample_compare function is used with explicit derivatives. To avoid such failures, the effective level is computed from the texture size, passed derivatives, and texture coordinates, if needed. The level value is then used for sample_compare instead of the explicit derivatives. * Apple2 GPUs do not support setting texture sampler compare state via Metal API. As a result, all sample_compare functions including those without LOD options do not work on Apple2 GPUs. This feature was attempting to incorrectly emulate a subset of sample_compare functions with a hard-coded compare state. There are no plans to support shadow samplers on Apple2 GPUs, as it would require non-trivial emulation, so this feature is no longer relevant for that platform. * Metal on macOS 10.15 only supports constant zero as the level parameter for sample_compare functions. Ignoring the passed derivatives and using zero LOD on old OS versions is a better fallback than dropping the derivatives altogether because many applications use the derivatives to set the level to zero anyway. Bug: angleproject:365066518 Bug: angleproject:368059227 Change-Id: I4028421b785ae49328b72658e0a9783275461779 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5903970 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
Alexey Knyazev a921694b 2024-09-30T00:00:00 Metal: Support EXT_texture_shadow_lod Bug: angleproject:365108862 Change-Id: Ieb0b53253c5d9091e0c74baccf808622d9578d5f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5907407 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
Alexey Knyazev d550d96f 2024-09-30T00:00:00 Metal: Remove allowSamplerCompareLod feature * Apple2 GPUs do not support setting texture sampler compare state via Metal API. As a result, all sample_compare functions including those without LOD options do not work on Apple2 GPUs. This feature was attempting to incorrectly emulate a subset of sample_compare functions with a hard-coded compare state. There are no plans to support shadow samplers on Apple2 GPUs, as it would require non-trivial emulation, so this feature is not needed. * Metal on macOS 10.15 only supports constant zero as the level parameter for sample_compare functions. Ignoring the requested level and using zero on old OS versions is a better fallback than dropping the parameter altogether because many applications set the level to zero anyway. Bug: angleproject:365066518 Bug: angleproject:368059227 Change-Id: I2cdc0bda5842842d62ad5663427da7f1f37bddda Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5907619 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
Shahbaz Youssefi b16d105f 2024-10-03T10:25:32 Remove Desktop GL front-end support For Desktop GL applications, please use Zink! Bug: angleproject:370937467 Change-Id: Ie734634bb62a2e98c80e1b32d8b3d34624da3c04 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5905428 Reviewed-by: Geoff Lang <geofflang@chromium.org>
Alexey Knyazev 7ff7775b 2024-09-19T00:00:00 Metal: Align internal texture wrapper names Used consistent internal names for all ESSL 3.00 texture wrappers. Bug: angleproject:368059227 Change-Id: I69c162d7b1557bb9a92cba902f4fdd5b4c30ee2d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5890621 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
Alexey Knyazev 371ab6d8 2024-09-19T00:00:00 Metal: Refactor texture wrappers * Removed variadic macros. * Removed invalid overloads. * Added MSL compile guards to not fail shader compilation on macOS 10.15. Bug: angleproject:368059227 Change-Id: I5376b410670a50cf700f1c33823f43c89c10b876 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5893780 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
Alexey Knyazev 86872374 2024-09-19T00:00:00 Metal: Refactor textureGrad wrappers * Removed variadic macros. * Removed an invalid overload. * Updated emitter to not output unused variants. * Added MSL compile guards to not fail shader compilation on macOS 10.15. Bug: angleproject:368059227 Change-Id: I816b8b96b264d0ca943bca566987755460b3a72f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5893778 Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Alexey Knyazev 39b5f5fc 2024-09-19T00:00:00 Metal: Refactor textureLod wrappers * Removed variadic macros. * Removed an invalid overload. * Updated emitter to not output unused variants. * Added MSL compile guards to not fail shader compilation on macOS 10.15. Bug: angleproject:368059227 Change-Id: If15fcb0cb772e3ee2e2e1669f894fb8de4e76578 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5896390 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
Alexey Knyazev 80e5e611 2024-09-19T00:00:00 Metal: Refactor textureGradOffset wrappers * Removed variadic macros. * Removed invalid overloads. * Updated emitter to not output unused variants. * Added MSL compile guards to not fail shader compilation on macOS 10.15. Bug: angleproject:368059227 Change-Id: I47e0c04176bd9f4b6e6abcd266ae4c673135c93b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5893503 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
Alexey Knyazev baf0c6b2 2024-09-19T00:00:00 Metal: Refactor texture[Lod]Offset wrappers * Removed variadic macros. * Removed invalid textureLodOffset overload. * Split bias variants into separate wrappers. * Updated emitter to not output unused variants. Bug: angleproject:368059227 Change-Id: I983d84685479e5154f2ecfb15b525c1acbb9e280 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5890517 Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Alexey Knyazev bc9c772d 2024-09-19T00:00:00 Metal: Refactor textureProj[Offset] wrappers * Removed variadic macros. * Split bias variants into separate wrappers. * Updated emitter to not output unused variants. Bug: angleproject:368059227 Change-Id: I6e08e92dfbc2378bfc4ccd7760dbe28f6bc64f27 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5893163 Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Alexey Knyazev b4ec5850 2024-09-19T00:00:00 Metal: Refactor textureProj(Grad|Lod)[Offset] wrappers * Removed variadic macros. * Updated emitter to not output unused variants. * Added MSL compile guards to not fail shader compilation on macOS 10.15. Bug: angleproject:368059227 Change-Id: If9d9479c056da6a76cff78c7c5b42101a0fcce1e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5893255 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
Geoff Lang fe8c0390 2024-09-25T19:00:34 WGSL: Run SeparateCompoundStructDeclarations to name structs Borrow SeparateCompoundStructDeclarations from the Metal backend to separate struct definitions and name nameless structs. Refactor id generation into a callback. Bug: angleproject:42267100 Change-Id: I8ed6f13113a5d5e450d30ce187ce1df52e572000 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5889089 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Matthew Denton <mpdenton@chromium.org>
Geoff Lang 7e249881 2024-09-25T17:31:18 HLSL: Emulate mix functions when the last parameter is a bool. Add emulation for the ESSL 310 variants of mix that use int and uint vectors and a bool selector. Bug: angleproject:369533080 Change-Id: I0491c50c65529b9d922d4745c0989131b9981048 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5892352 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: dan sinclair <dsinclair@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Chris Dalton 966739ac 2024-09-19T23:49:06 Drop PLS support for EXT_shader_pixel_local_storage Supporting this backend drastically increased the complexity of the codebase, with little return. We don't support memoryless attachments on the web anyway, and since this extension requires us to literally draw the load/store operations, input attachments on Vulkan perform better. Once this implemention is completely removed, we will delete the PLS allow list, which isn't required for the other PLS implementations. Bug: angleproject:7279 Change-Id: Ibb036d36cbd33467e7a94398ce171cda7349e4f4 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5874412 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Chris Dalton <chris@rive.app>
Matthew Denton a6ee4641 2024-09-25T11:41:47 WGSL: Output default uniform block and accesses to it Default uniforms are put into a WGSL struct, and all accesses of those uniforms now output struct accesses. Similarly to I/O vars and builtins, these are outputted in a pre-pass, but in the future it might make sense to do what Vulkan does and do an AST transformation to put the default uniforms into a UBO which should be outputted similarly. This does not handle bool, matCx2, or array of element size < 16. Bug: angleproject:42267100 Change-Id: If29e2895a8aba3212b581813316af87273c1515c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5878759 Reviewed-by: Liza Burakova <liza@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Matthew Denton <mpdenton@chromium.org>
Alexey Knyazev c2051a2d 2024-09-19T00:00:00 Metal: Refactor texelFetch[Offset] and textureSize wrappers * Removed variadic macros from texelFetch[Offset] and textureSize function wrappers. * Updated emitter to not output unused variants. * Aligned parameter types with GLSL and MSL specs. Bug: angleproject:368059227 Change-Id: I7cbd6f60e70e0357aa5ca12d6adbe1064eed94fe Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5876034 Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Amirali Abdolrashidi f0f65290 2024-09-10T15:30:30 Translator: Add check for atomic counter offset For GLSL shaders, atomic counter offset should not exceed the maximum atomic counter buffer size. This issue was seen on a dEQP test when increasing the LimitToInt() limitation from INT_MAX/2 to INT_MAX+1 or INT_MAX. * Added check to the translator to make sure the offset does not go beyond the max atomic counter buffer size. * Packed the existing checks into a single function. * (checkAtomicCounterOffsetIsValid()) * Added mMaxAtomicCounterBufferSize to TParseContext for the check. * Also added the related cap (maxShaderStorageBlockSize) for D3D11. * Increased the limitation in LimitToInt() to (INT_MAX / 2 + 1). * Added test based on dEQP test that failed on some platforms as a result of updating said limitation. * From KHR-GLES31.core.shader_atomic_counters.negative-large-offset Bug: angleproject:361369308 Change-Id: Id6128c75e12445b2a0029f4a2eb2bdb379cad48d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5851650 Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Alexey Knyazev 95664631 2024-09-19T00:00:00 Metal: Fix OES_texture_3D texture function wrappers * Removed redundant variadic macros and templates for GL_OES_texture_3D functions. * Added missing texture3D function variants. * Emit texture3DProj variant with bias only when the GLSL function call has that parameter. Fixed all failures in KHR-GLES2.texture_3d.* tests. Bug: angleproject:368059227 Change-Id: I9c0b209988563710824c38d0535997e351bbd6bd Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5875725 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
Alexey Knyazev 5eb71dc1 2024-09-19T00:00:00 Metal: Simplify ESSL 1.00 texture function wrappers * Removed redundant variadic macros and templates for ESSL 1.00 and GL_EXT_shader_texture_lod functions. * Emit texture2D, texture2DProj, and textureCube variants with bias only when the GLSL function call has that parameter. Bug: angleproject:368059227 Change-Id: I1b60d0b874a08dcdd0a92585b2642336134236e3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5872916 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
Alexey Knyazev e6c22c93 2024-09-19T00:00:00 Metal: Remove invalid ESSL 1.00 texture functions * 1D textures are not supported in GLSL ES * 2D textures do not support sampling with 3-component coordinates * Metal backend does not support rectangle texture type * Cubemap textures do not support sampling with projection Bug: angleproject:368059227 Change-Id: Iec33f4293d995b9f244274338d444604ffd23249 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5872915 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
Matthew Denton 7e462c22 2024-09-17T15:32:41 WGPU: Implement SetUniform() enough so GetUniform() works Lays out a shadow buffer for basic uniforms per-shadertype in std140, which is close to matching WGPU's layout. This does not actually pass the buffer to WGPU as a uniform buffer. GetUniform() just reads from the shadow buffer. This is copied from the VK backend and so some code is deduplicated. Bug: angleproject:42267100 Change-Id: I727dc9e09a7ccabbb617f148dd68590469883b07 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5867444 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Matthew Denton <mpdenton@chromium.org> Reviewed-by: Liza Burakova <liza@chromium.org>
Alexey Knyazev b98e6bc0 2024-09-12T00:00:00 Translator: Add EXT_texture_shadow_lod functions Added translator support for functions defined in the GL_EXT_texture_shadow_lod extension. Trivially enabled on GL and Vulkan backends. Bug: angleproject:365066518 Bug: angleproject:365108862 Change-Id: Ie1fc8f50e321a559d4506c479d9cebbb48802091 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5867416 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Mohan Maiya f2eb8781 2024-09-14T16:16:53 Vulkan: Selectively enable emulateR32fImageAtomicExchange Only emulate R32F imageAtomicExchange if shaderImageFloat32Atomics feature is not supported Bug: angleproject:42264071 Change-Id: I305ab88bf3ac918eff5d8c399f0ed02ec8c60c2d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5860814 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Matthew Denton 1a5fee10 2024-09-11T17:37:54 Fix missing include Bug: angleproject:42267100 Change-Id: Iafa56c8bfcfd898ca58bfe0cc0bb67ca253813e0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5854007 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org> Auto-Submit: Matthew Denton <mpdenton@chromium.org>
Matthew Denton c2a9300c 2024-09-10T19:33:33 WGSL: Rewrite input/output variables GLSL builtin variables and in/out variables correspond to WGSL's main function params and return value, so rewrite them accordingly. This is done by generating structs to use as main function params and return values, generating similar global structs, and copying the former into the latter so the rest of the program can just use the variables stored in the global structs. Bug: angleproject:42267100 Change-Id: Ic3e1196f6fb95b963ce03845096a59ea7599d608 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5835347 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Matthew Denton <mpdenton@chromium.org>
Shahbaz Youssefi 0a04cb90 2024-09-04T11:30:36 Translator: Limit shader size check to WebGL and Chromium shaders This is because std430 is not taken into account in the check. That can be fixed with https://chromium-review.googlesource.com/c/angle/angle/+/5835580 if ever necessary. Bug: angleproject:361369308 Change-Id: Id5eacc9bab6d959c8f9f8d09ebd87504dcfa25af Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5836785 Commit-Queue: Geoff Lang <geofflang@chromium.org> Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Rafael Cintron d1a4b0ff 2019-05-04T17:15:42 Remove Feature Level 9_3 code Feature Level 9_3 was originally added for developers creating apps for devices which did not have the DirectX 9 API and are no longer supported. Hence, we can remove the corresponding code in the 11 backend. Bug: angleproject:355462523 Change-Id: I22db15640b435c61db4d82a815edbc65cecc4e12 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5824661 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Rafael Cintron <rafael.cintron@microsoft.com>
Alexey Knyazev e13cc7df 2024-08-30T00:00:00 Metal: Add shadow sampler overloads for textureProj[Offset] Added compile guards because sample_compare with bias is not defined for older MSL versions. Fixed: angleproject:354101888 Change-Id: I3972fabc9ebe7b7475343438272e57dcfed007f4 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5828944 Reviewed-by: Kimmo Kinnunen <kkinnunen@apple.com> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Matthew Denton d263945a 2024-08-20T16:32:36 Translator: make replaceChildNode() a little more type-safe If we know the type the child node should be, instead of static_cast<>ing to the expected type, use getAs{ExpectedType}() and crash if nullptr. This would have saved me when the ReplaceVariables() AST transformaton replaced a TIntermSymbol in a TIntermGlobalQualifierDeclaration with a TIntermTyped that was not a TIntermSymbol. But TIntermGlobalQualifierDeclaration can only have a TIntermSymbol as a child, so this caused confusing crashes. Other node types have similar expectations of the types of their children. This doesn't enforce any type safety on TIntermAggregate children as those are a little more flexible and complicated. This CL also doesn't enforce non-nullptr children when the parent can't handle nullptr children. Bug: angleproject:42267100 Change-Id: Ic7fb41039705aa4f6daec052940d9bfc4974d955 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5800264 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Matthew Denton <mpdenton@chromium.org>
Kimmo Kinnunen 11724133 2024-08-06T12:02:54 Metal: Separate vars with normal types Separate compound expressions separates expressions as temporary values. Previously creating a temporary variable would copy the entire type. Qualifiers and interface block info but shouldn't ever be applied to temporary variables. This would lead to assertions during MSL output. Fix by copying the type and unsetting qualifiers and interface block info. Bug: angleproject:357622691 Change-Id: Id868cd3eaabe3710121d6c9a565304e282ddb69f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5762605 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Auto-Submit: Kimmo Kinnunen <kkinnunen@apple.com> Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Kimmo Kinnunen <kkinnunen@apple.com>
Shahbaz Youssefi 67d8d8c8 2024-07-29T13:44:37 WebGL: Reject shaders with infinite loops Bug: chromium:350528343 Change-Id: I1b2fc152cf285b0e69c4c294351c1cf2389cc234 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5746714 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org> Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org>
Geoff Lang d503f580 2024-07-30T21:15:44 WebGPU: Remove UNREACHABLEs in the compiler Update several usages of UNREACHABLE that are hit by dEQP. Change them to UNIMPLEMENTED so that ANGLE does not crash. Bug: angleproject:356399840 Change-Id: I8b4415c9481384761dbe4527acaf986946321c54 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5748442 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Shahbaz Youssefi 65f08d08 2024-07-26T22:14:49 Vulkan: Work around driver bug with nested switch Bug: chromium:350528343 Change-Id: Ie7bd58934ccb2b8f06f6ad6a8c3bf38e81b84969 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5744620 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Shahbaz Youssefi 346ba328 2024-07-30T11:42:12 Vulkan: Simplify pulling samplers out of structs The RewriteStructSampler transformation moves samplers out of structs, for example turning this struct: struct Original { sampler2D s1; vec4 f1; sampler2D s2; sampler2D s3; vec4 f2; }; into: struct Modified { vec4 f1; vec4 f2; }; This required modifying the struct-field selection nodes to remap the field indices, causing some complication. Instead, this change makes the struct definition reorder the fields as such right during parse: struct Original { vec4 f1; vec4 f2; sampler2D s1; sampler2D s2; sampler2D s3; }; As a result, the field-selection indices for non-sampler fields don't get changed when the struct is replaced with `Modified`. Bug: angleproject:42262842 Bug: angleproject:349994211 Change-Id: I76986eab780689e9887b094e3c70b87887a8ec92 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5748789 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yuxin Hu <yuxinhu@google.com> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com>
Shahbaz Youssefi 451d78d9 2024-07-25T11:56:25 Prune trivial infinite loops in WebGL contexts Bug: chromium:350528343 Change-Id: I4be19c1ffe41fc86889b49b4a0e29d8bc9c940ec Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5738743 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 568caaa0 2024-07-23T15:07:59 Prune switch(constant) with no matching case Bug: chromium:350528343 Change-Id: Iabb475b230f22086de482bbdcf2fa00b0d986622 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5735815 Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>