src/compiler


Log

Author Commit Date CI Message
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>
Shahbaz Youssefi 7691cea7 2024-07-22T13:46:14 Vulkan: Remove seamful cubemap emulation Practically, the Vulkan backend is never expected to run on ES2 hardware. It _may_ for WebGL, but seamful cubemap emulation was disabled for webgl anyway. Bug: angleproject:354729454 Change-Id: Iafa20fbdbe232c4df4c777b12e7698ef7a87cf24 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5730143 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>
Roman Lavrov df90bbc5 2024-07-12T18:04:53 Refactoring: move angle::HashMap and HashSet to own header Underlying abseil includes pull in a large set of headers Bug: angleproject:42266508 Change-Id: Icee47143a8a59bb0795a054b67c0aa4ddcfca4d4 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5704137 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
angle-autoroll 6c6975af 2024-07-05T12:28:54 Manual roll vulkan-deps from 5fdd3da87369 to 17d345a0f23d (10 revisions) https://chromium.googlesource.com/vulkan-deps.git/+log/5fdd3da87369..17d345a0f23d Also rolling transitive DEPS: https://chromium.googlesource.com/external/github.com/KhronosGroup/glslang/+log/704107fda3827377f00e57dff0c21da019bff4ae..5939e32b87487fa9c72ab336ebfcc5ae26d9ab6d https://chromium.googlesource.com/external/github.com/KhronosGroup/SPIRV-Headers/+log/2acb319af38d43be3ea76bfabf3998e5281d8d12..41a8eb27f1a7554dadfcdd45819954eaa94935e6 https://chromium.googlesource.com/external/github.com/KhronosGroup/SPIRV-Tools/+log/973e791a9ac122f903c2796349a538b278cbe29b..216574bedb80d439c2533d161e7ea7897504bbb6 https://chromium.googlesource.com/external/github.com/KhronosGroup/Vulkan-ValidationLayers/+log/afeb91d6d2110717b8c842081eff410617aed1ef..96fb5396040477fbbffdc1b4439dea9447f59d80 If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/vulkan-deps-angle-autoroll Please CC abdolrashidi@google.com,angle-team@google.com on the revert to ensure that a human is aware of the problem. To file a bug in ANGLE: https://bugs.chromium.org/p/angleproject/issues/entry To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md Bug: None Tbr: abdolrashidi@google.com Change-Id: I2e1c6204e675eb8e70ed68dbe13b912bd6ffce6e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5678939 Commit-Queue: Roman Lavrov <romanl@google.com> Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Roman Lavrov <romanl@google.com>
Shahbaz Youssefi db00dee5 2024-07-05T21:11:53 Vulkan: Fix SPIR-V gen for literally indexed swizzles Translation did not take into account the fact that a swizzled vector can be indexed by a literal (like `vec.zzxy[2]`, which should translate to `vec.x`). Since this issue affects MSL generation too, such expressions are folded before they reach the output generators. Bug: b/351102615 Change-Id: I048aca165cdf22ef8cd7ccd9a8e503ccf636a55f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5680354 Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com>
Alexey Knyazev b7d4c5d1 2024-07-04T00:00:00 Metal: Disable fast math if isinf or isnan are used Fixed: angleproject:42266714 Fixed: angleproject:42267063 Change-Id: Ibf6508ffc7d458a6b91b9218b2b488b6aa5b1001 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5678416 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
Shahbaz Youssefi 397eb7c8 2024-06-29T00:22:42 Vulkan: Easier to read SPIR-V disassembly Bug: angleproject:349994211 Change-Id: I9d8da4a9fa336e1f5ecdfa39c33959ecebb2c6ea Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5667081 Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Alexey Knyazev b954755f 2024-07-02T00:00:00 Release all memory allocated in TCompiler::compile Ensured that single-page allocations from compile jobs are released to OS. Fixed: angleproject:350528355 Change-Id: I5a0d9fd7dbc065f4b4127ceecb3fd6538eb8948d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5673352 Reviewed-by: Kenneth Russell <kbr@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
Geoff Lang b6456334 2024-04-02T15:03:17 Reland: GL: Support KHR_blend_equation_advanced Combine blend equation setting when they are equal. It is invalid to set advanced blend equations for color/alpha separately. Emit blend equation layout qualifiers. This is an unchanged reland of https://chromium-review.googlesource.com/c/angle/angle/+/5415033 and depends on a GL dispatch table fix in https://chromium-review.googlesource.com/c/angle/angle/+/5670963 Bug: angleproject:42267098 Change-Id: Id669cf98ec2b7d46eab174717964f8d6daf88b29 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5659200 Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Matthew Denton 35f01e7f 2024-06-26T14:30:27 ESSL -> WGSL: Support basic control flow If/else, while, do/while, for. Return, break, continue, discard Bug: angleproject:42267100 Change-Id: I0c8ef30b45aec639a07323e333db970d4c42dec0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5661103 Reviewed-by: Liza Burakova <liza@chromium.org> Commit-Queue: Matthew Denton <mpdenton@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Matthew Denton 89ef2812 2024-06-26T11:19:54 ESSL -> WGSL: unary and binary exprs, operators, array access Array indexing is always checked to be within bounds. For runtime-sized arrays, this requires emitting a clamp(). For now this includes a bug the left-side-expression (the array itself) has any side effects, which shouldn't actually be possible but may be in future versions of WGSL. Implementing unary, binary, and remaining aggregate expressions requires implementing operators, many of which do not have exact corresponding versions between GLSL and WGSL. This implements many operators but for simplicity leaves some unimplemented and some half-implemented. See WGSLOutput_test.cpp for some code examples. Bug: angleproject:42267100 Change-Id: I3737abb5dffd156deba0429fa86570270d711d3c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5651994 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Matthew Denton <mpdenton@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Matthew Denton 7ca9f46a 2024-06-21T13:09:24 ESSL -> WGSL: Emit func calls, struct access, constants Also includes constructor calls, swizzles, and a slightly incorrect version of the ternary operator. The ternary operator doesn't exist in WGSL, only a non-short-circuiting select() builtin. For now the ternary is implemented with select() but that isn't correct if any of the true/false expressions have side effects, and may have perf implications by computing both true/false expressions. Constants are mostly done after this, however NaN and infinity are not valid constants in WGSL and it's unclear what we can do about this as WGPU implementations are allowed to assume NaNs and infinities are never operated on. Bug: angleproject:42267100 Change-Id: Ie6190091a7b95d3d372736ab7cea45868846e7be Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5648990 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Matthew Denton <mpdenton@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
ericali 016ef60d 2024-06-24T17:41:30 ValidateAST asserts when refers to builtIn struct type name Refers to build in type name looks allowed by GL but currently VK and Metal backends do not support, i.e.: refers to gl_DepthRangeParameters, this change is to add temporary check to make using reserved type name an error during parsing. Bug: angleproject:348313398 Change-Id: I6522566b1f590fe2b24534fb065625c4ac3b06c6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5645265 Auto-Submit: Erica Li <lerica@apple.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Kimmo Kinnunen <kkinnunen@apple.com> Commit-Queue: Kimmo Kinnunen <kkinnunen@apple.com>
Matthew Denton a04239d8 2024-06-18T11:38:52 ESSL -> WGSL: Emit most types and function params This emits struct declarations, as well as array/matrix/vec types. As a result this also emits function parameters. Bug: angleproject:42267100 Change-Id: Ib9c7e543fd38f7c1dfa64d8e63b054fc5111b336 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5598298 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Matthew Denton <mpdenton@chromium.org>
Shahbaz Youssefi d193d51b 2024-06-17T22:46:08 Replace issue ids post migration to new issue tracker This change replaces anglebug.com/NNNN links. Bug: None Change-Id: I8ac3aec8d2a8a844b3d7b99fc0a6b2be8da31761 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5637912 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
ericali 6164ee69 2024-06-11T15:28:06 Assertion during validateAST for mutli variables struct. When ForceInitShaderVariables is enabled, the init output variable will be rewritten based on symbol table. While SeparateDeclarations will replace the struct declaration from AST and create a new one beforehand. This proposed fix is to find output variable by loop through AST instead of symbol table to fix assertion during validateAST that the mType is different. Skipping this new added test for vulkan pixel 4 due to driver issue. Bug: angleproject:42267047 Change-Id: Id5c6ef8c4ed7bd5fcc6174ebbdd32e0605ac5cd5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5613231 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Auto-Submit: Erica Li <lerica@apple.com>
Scott Marcy 46db3d73 2024-05-31T12:21:39 Enable limitExpressionComplexity in translator_fuzzer.cpp Turns on `limitExpressionComplexity` in the translator fuzzer. Bug: angleproject:343889868 Change-Id: Ibbb3db6c2572abf43362ae59fbe8e9a4a30f5345 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5588812 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Kimmo Kinnunen <kkinnunen@apple.com> Auto-Submit: Scott M <mscott@apple.com> Reviewed-by: Kimmo Kinnunen <kkinnunen@apple.com>
Amirali Abdolrashidi ebb56cee 2024-05-31T15:10:37 Implement OES_tessellation_shader Based on the specs, there are no functional differences between OES and EXT. * Added validation for glPatchParameteriOES() and the core glPatchParameteri(). * Added the extension support for GLSL. * EXT_shader_io_blocks is implicitly enabled for the EXT geometry and tessellation shader extensions. * OES_shader_io_blocks is implicitly enabled for the OES versions of said extensions. * Added a test to make sure using this extension works instead of EXT. * Turned the repeated test code into a function: * testTessellationTextureBufferAccess * Skipped the tests that fail on various platforms. * It seems that these tests were being skipped before enabling this extension ("Not supported"). Bug: b/344030760 Bug: angleproject:345306326 Bug: angleproject:345304850 Bug: angleproject:345312771 Change-Id: I905da0132bf6525cb453dcaa613e4deb3155c4dd Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5595611 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Amirali Abdolrashidi 25374c90 2024-05-31T16:08:58 Implement OES_gpu_shader5 Based on the specs, there is no difference between the OES version and the EXT version. * Added support for use in shaders * Added test to make sure the OES extension works. * Turned the repeated test code into a function: * testArrayOfArrayOfSamplerDynamicIndex() Bug: b/344031022 Change-Id: Ifda4fa5495983d254f598940a95d0797e8a9ce67 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5595609 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com>
Matthew Denton af72bf7f 2024-05-24T15:00:44 ESSL -> WGSL: emit basic types This emits dimensionless types (no vectors, matrices, arrays). Function signatures will emit their return type (assuming it is dimensionless). Bug: angleproject:42267100 Change-Id: I0d2479f71408eb20b9c329a99c70a6bf6426a72f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5590384 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Matthew Denton d68395fe 2024-05-24T15:14:46 ESSL->WGSL: Emit basic function signatures ...signatures don't yet include types or parameters. See WGSLOutput_test.cpp for a sample translation. Bug: angleproject:8662 Change-Id: I93273156f72ba193441e737074bd1a8a054f2ea9 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5582949 Commit-Queue: Matthew Denton <mpdenton@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Liza Burakova <liza@chromium.org>
Matthew Denton e0541f1a 2024-05-29T11:36:56 Add skeleton traverser for outputting WGSL Bug: angleproject:8662 Change-Id: I0d917c65692eb0f137c7e751f65f16312a4625f2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5581744 Reviewed-by: Liza Burakova <liza@chromium.org> Commit-Queue: Matthew Denton <mpdenton@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Scott Marcy 4ebb28d7 2024-05-30T11:36:58 Fix stack overflow crash by traversing a too-deep AST This simply moves the check for a too-deep AST before the first attempts to traverse the AST (i.e., `validateAST()`). Bug: angleproject:343505104 Change-Id: Iafb658a30f74a666beab8c69745ca53d17d70dd3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5585186 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Kimmo Kinnunen <kkinnunen@apple.com> Commit-Queue: Kimmo Kinnunen <kkinnunen@apple.com> Auto-Submit: Scott M <mscott@apple.com>
Shahbaz Youssefi c33c6cd3 2024-05-27T00:06:18 Vulkan: Use OpSelect with all types with SPIR-V 1.4 SPIR-V 1.4 relaxes the types that can be used as arguments of OpSelect. Previously, the types were limited to scalars and vectors, but since SPIR-V 1.4, it's unrestricted. Writing tests for this change, another bug was discovered where support for structs and arrays with the ternary operator was disabled due to ESSL 1.0, even though that support is mandatory in ESSL 3.2. Bug: angleproject:342316794 Bug: angleproject:343218491 Bug: angleproject:3830 Change-Id: I6cff2f8178634369f773c4fb16a1ddde96928c8d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5570154 Reviewed-by: Yuxin Hu <yuxinhu@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com>
Shahbaz Youssefi c53b3405 2024-05-25T02:50:27 Vulkan: Use OpCopyLogical with SPIR-V 1.4 When shaders copy structs and arrays, this instruction saves a lot of churn in the SPIR-V. Bug: angleproject:342316794 Bug: angleproject:343218484 Change-Id: I698a8d8ee8c15113e40602a0f4953726bc9a84f7 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5570152 Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com> Reviewed-by: Yuxin Hu <yuxinhu@google.com> Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com>
Shahbaz Youssefi 5137eb99 2024-05-27T01:38:23 Translator: Fix internal inconsistency with output init When creating "zero" nodes, this transformation directly takes the TType's from the variables being initialized. This means that qualifiers such as invariant, as well as any associations with interface blocks are retained in these constructors, which is not valid. This can trip up the SPIR-V generator which does not expect constructors to be qualified as such (i.e. assumes the TypeSpec to be the default). Bug: angleproject:342866364 Bug: angleproject:342866374 Bug: angleproject:343011429 Change-Id: If5c38e18ce977bd0eb1a48e41c59f6199eb7d2e5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5570155 Reviewed-by: Yuxin Hu <yuxinhu@google.com> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 9620d4d3 2024-05-23T16:12:52 Vulkan: Emit SPIR-V 1.4 where available In preparation for optimizations possible for SPIR-V 1.4. This change makes ANGLE output SPIR-V 1.4 if supported, and SPIR-V 1.3 otherwise. It handles the following differences between the two versions: - OpEntryPoint in SPIR-V 1.4 includes all global variables, as opposed to SPIR-V 1.3 where only the Input and Output variables are listed - Storage buffers use a dedicated storage class in SPIR-V 1.4 Bug: angleproject:342316794 Change-Id: I157ed46449ff2d0f14d284b883b4ddc1b4b46fd1 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5565224 Reviewed-by: Yuxin Hu <yuxinhu@google.com> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Scott Marcy b793888a 2024-05-09T11:40:18 Deeply nested switch statements -> ambiguous error Improve the error reported (and potentially avoid a stack overflow crash) when parsing deeply nested `switch` statements. Limits the total number of nested switch and/or iterator statements to `mMaxStatementDepth` (defaults to 256). Bug: angleproject:8645 Change-Id: Iba4795db15c3859d172df8366bc7de3125c2d472 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5527630 Auto-Submit: Scott M <mscott@apple.com> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Kimmo Kinnunen <kkinnunen@apple.com> Commit-Queue: Kimmo Kinnunen <kkinnunen@apple.com>
Shahbaz Youssefi dc470fa1 2024-05-24T12:10:34 HLSL: Initialize uninitialized storage-image-related data Bug: chromium:342464439 Change-Id: I5664177ecd99fbae419bc00a17c0864e43f06776 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5570599 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Yuly Novikov <ynovikov@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Shahbaz Youssefi 98402f33 2024-05-23T10:23:29 Vulkan: Explicitly set SPIR-V version Bug: angleproject:342316794 Change-Id: Ide73e3d8b167a932338419cb9da3ea358058ebeb Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5564203 Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Reviewed-by: Yuxin Hu <yuxinhu@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
ericali 44d98861 2024-05-17T23:55:13 Assertion under IdGen::createNewName. Remove code that tries to workaround double underscores symbols name that would be introduced if user defined symbols contain underscore prefix or suffix. To avoid unexpected clashes case like '_Data' and 'Data'. Bug: b/341206126 Change-Id: I59e72e59bf483c84f5e33a21f7737f82c31c6896 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5545479 Auto-Submit: Erica Li <lerica@apple.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Kimmo Kinnunen <kkinnunen@apple.com> Reviewed-by: Kenneth Russell <kbr@chromium.org>
Alexey Knyazev 82ddb33b 2024-05-10T00:00:00 Metal: Do not separate vector and matrix constants Do not create temporary variables for already folded constant vector and matrix values. This reduces register usage and partially fixes MSL compilation errors caused by matrices present in constant initializers. Bug: angleproject:8691 Change-Id: Iedfabadd9b7bcb2e6e1e08a5ad39f48305365747 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5533925 Reviewed-by: Kimmo Kinnunen <kkinnunen@apple.com> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Scott Marcy 2ecfc5a1 2024-05-03T18:29:12 Issue 8644: Deeply nested iterator declarations can crash Avoid stack overflow crash when parsing nested iterators (especially `while` statements). Limits the number of nested iterator statements to `mMaxStatementDepth` (defaults to 256). Bug: angleproject:8644 Change-Id: I9b0fd2ab456c3cdd731b41ab97f495ae4dc0b0bb Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5519169 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Kimmo Kinnunen <kkinnunen@apple.com> Auto-Submit: Scott M <mscott@apple.com>
Geoff Lang b839e05b 2024-04-29T14:35:42 GLSL: Hardcode emulated atan functions These emulated atan functions are generated for every compiled shader, the string generation is particularly costly for small shaders (>30% of total compile time). Instead just hardcode the emualted functions, there are only 4. Bug: angleproject:8434 Change-Id: I3f8b7cc9709ca132fae19953c23d02e54538d4e7 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5498516 Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Kimmo Kinnunen 6fe8a399 2024-04-22T18:11:30 Metal: Fix rewritten out variables with underscores Fix compilation in case of output variables start with underscores. Make name emission always emit MSL name ANGLE_{name}, so that GLSL `_e` and `e` cannot clash. This regressed in angleproject:8558. Bug: chromium:335744344 Change-Id: Ibae4dba4a24888acc1461582e69d48218ba11176 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5473412 Reviewed-by: Kenneth Russell <kbr@chromium.org> Auto-Submit: Kimmo Kinnunen <kkinnunen@apple.com> Commit-Queue: Kimmo Kinnunen <kkinnunen@apple.com> Reviewed-by: Kimmo Kinnunen <kkinnunen@apple.com>
Geoff Lang 67fc293a 2024-04-05T13:25:12 WebGPU: Add shader translation and program linking stubs. Add a TranslatorWGSL which outputs the same translated shaders every time. Implement the compile and link tasks. Bug: angleproject:8662 Change-Id: I62bbd6c528e1d671d0f4becc38f15f1eceb0336c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5428807 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Matthew Denton <mpdenton@chromium.org>
Scott Marcy e088af30 2024-03-28T15:30:59 Parsing very long array declarations crash Avoid stack overflow crash when parsing arrays with a huge number of dimensions. Limits the number of array dimensions to `mMaxExpressionComplexity` (typically 256). Use `YYABORT` to abort parsing. Bug: angleproject:8610 Change-Id: Icf3914871b167c820b84ae8f3acba80dbd698af3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5424330 Auto-Submit: Kimmo Kinnunen <kkinnunen@apple.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Geoff Lang 392eca60 2024-04-10T15:36:07 Revert "GL: Support KHR_blend_equation_advanced" This reverts commit c632fae01ced6712d31c4665288eb306a980fb10. Reason for revert: Crashes on a few different devices. Bug: chromium:40277080, chromium:333443447 Original change's description: > GL: Support KHR_blend_equation_advanced > > Combine blend equation setting when they are equal. It is invalid to > set advanced blend equations for color/alpha separately. > > Emit blend equation layout qualifiers. > > Bug: angleproject:8660 > Change-Id: I1d8a88594c80027b564eed70d3b540e0b065968d > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5415033 > Commit-Queue: Geoff Lang <geofflang@chromium.org> > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > Reviewed-by: Alexey Knyazev <lexa.knyazev@gmail.com> Bug: angleproject:8660 Change-Id: I27ac64c7343831e42f5412d6c17facd0de8cd9e6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5443404 Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Shahbaz Youssefi 0a67bbaf 2024-04-08T10:14:45 SPIR-V: Fix const constructors with single scalar These constructors may be generated because of RemoveArrayLengthTraverser. Bug: chromium:332546345 Change-Id: I5b81ded59ba91b0083b14280f5a61b03b9d4ca43 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5435713 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org> Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org>
Geoff Lang c632fae0 2024-04-02T15:03:17 GL: Support KHR_blend_equation_advanced Combine blend equation setting when they are equal. It is invalid to set advanced blend equations for color/alpha separately. Emit blend equation layout qualifiers. Bug: angleproject:8660 Change-Id: I1d8a88594c80027b564eed70d3b540e0b065968d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5415033 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Alexey Knyazev <lexa.knyazev@gmail.com>
Erica Li 3b650ffa 2024-03-19T09:53:06 Metal: Assert while using gl_VertexID as ivec Metal [vertex_id] is uint while gl_VertexID is int. Replacing gl_VertexID with gl_VertexIDMetal without rewrites of the expressions would cause invalid expressions. Fix by casting uint kgl_VertexIDMetal to int kgl_VertexID instead of replacing variable during compile. Bug: angleproject:8597 Change-Id: I76acdb2a0ab5982aa05181175925b3359068e901 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5376498 Reviewed-by: Alexey Knyazev <lexa.knyazev@gmail.com> Auto-Submit: Kimmo Kinnunen <kkinnunen@apple.com> Commit-Queue: Kenneth Russell <kbr@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org>
Nisha Jain ab6dd5b2 2024-03-07T14:19:58 Avoid asserts when const folding binary ops on void variables Fix asserts for example with / and % during constant folding when the operands might be voids. Bug: angleproject:8592 Change-Id: I22275642dbcdf9066940d3a94114e8daa5cbbe41 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5416376 Auto-Submit: Kimmo Kinnunen <kkinnunen@apple.com> Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Kimmo Kinnunen <kkinnunen@apple.com>
Shahbaz Youssefi a0fa06f6 2024-03-25T14:46:56 Translator: Disallow samplers in structs in interface blocks As disallowed by the spec: > Types and declarators are the same as for other uniform variable > declarations outside blocks, with these exceptions: > > * opaque types are not allowed Bug: chromium:328859176 Change-Id: Ib94977860102329e520e635c3757827c93ca2163 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5391986 Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Geoff Lang e996d187 2024-03-19T13:29:24 Use TIntermRebuild for SeparateStructFromFunctionDeclarations This now handles the case of nested function calls to functions that define a struct in the return type all resolving to the correct re-written function. Bug: chromium:329271490 Change-Id: I43904e09ec9c284c1b51c09b2caaab253f7b29b9 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5376613 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 96f44329 2024-03-25T14:16:10 Revert "Remove few redundant ImmutableString to std::string conversions" This reverts commit ebb94b807f184f2d36cb0843c429667cd80e0675. Reason for revert: Needs a different implementation of std::string::size() to pass C++17 compilers. Original change's description: > Remove few redundant ImmutableString to std::string conversions > > Maybe removes few strlen calls. > > Bug: angleproject:8614 > Change-Id: I4fbb5f6abb8e8d21ff44a34975bab379127a0a11 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5372715 > Auto-Submit: Kimmo Kinnunen <kkinnunen@apple.com> > Commit-Queue: Geoff Lang <geofflang@chromium.org> > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > Reviewed-by: Geoff Lang <geofflang@chromium.org> Bug: angleproject:8614 Change-Id: I1a635b74674a2e1b635972bb4372c43340527a2f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5391900 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Yuly Novikov <ynovikov@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Roman Lavrov 0197826b 2024-03-22T14:42:34 Revert "Add conversion operator from ImmutableString to std::string" This reverts commit 8c0dae388bccb00f11cd94d641d719cc68325826. Reason for revert: Breaks Android rolls: external/angle/src/compiler/translator/ImmutableString.h:103:15: error: constexpr function's return type 'std::string' (aka 'basic_string<char, char_traits<char>, allocator<char>>') is not a literal type 103 | constexpr operator std::string() const { return std::string(data(), length()); } | ^ external/libcxx/include/string:4332:64: note: 'basic_string<char>' is not literal because it is not an aggregate and has no constexpr constructors other than copy or move constructors 4332 | _LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_string<char>) Original change's description: > Add conversion operator from ImmutableString to std::string > > Also use the operator in a couple of places. Sometimes saves a strlen. > > Bug: angleproject:8614 > Change-Id: I429f3ac02af04b568ac7d1adf22ab65e5007fbda > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5372728 > Reviewed-by: Geoff Lang <geofflang@chromium.org> > Auto-Submit: Kimmo Kinnunen <kkinnunen@apple.com> > Commit-Queue: Geoff Lang <geofflang@chromium.org> > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Bug: angleproject:8614 Change-Id: I46963686f9506f7029e164250b1bf81f8ab2c519 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5388255 Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Roman Lavrov <romanl@google.com>
Kimmo Kinnunen 8c0dae38 2024-03-15T16:09:04 Add conversion operator from ImmutableString to std::string Also use the operator in a couple of places. Sometimes saves a strlen. Bug: angleproject:8614 Change-Id: I429f3ac02af04b568ac7d1adf22ab65e5007fbda Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5372728 Reviewed-by: Geoff Lang <geofflang@chromium.org> Auto-Submit: Kimmo Kinnunen <kkinnunen@apple.com> Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Kimmo Kinnunen ebb94b80 2024-03-16T09:11:51 Remove few redundant ImmutableString to std::string conversions Maybe removes few strlen calls. Bug: angleproject:8614 Change-Id: I4fbb5f6abb8e8d21ff44a34975bab379127a0a11 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5372715 Auto-Submit: Kimmo Kinnunen <kkinnunen@apple.com> Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Alexey Knyazev 490ff869 2024-03-14T00:00:00 Always redeclare clip/cull distance built-ins When clip or cull distance built-in arrays are implicitly sized, various pruning passes may produce an inconsistent AST state thus causing translation or linking failures. Adjusted the dedicated validation pass to inject an explicit declaration thus bypassing the issue. Additional updates: * Ensured that API clip distance state emulation is applied when a variable is declared but not assigned * Reverted previous clip/cull distance related changes to TIntermBinary::hasSideEffects as they are redundant now * Fixed failing AST validation for MSL varying emulation * Aligned linking error messages with the specifications * Updated tests and cleaned-up obsolete code Fixed: angleproject:8591 Change-Id: Ic8cfaf37778b8532bbab32ab998d5350b85d67ef Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5372714 Reviewed-by: Kimmo Kinnunen <kkinnunen@apple.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
Kimmo Kinnunen c5f7bbeb 2024-03-15T19:03:24 Make ImmutableString::beginsWith constexpr Maybe reduces strlen calls. Bug: angleproject:8614 Change-Id: Ic63d019c185db7acde2c2645c499b5408ec23b78 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5372122 Auto-Submit: Kimmo Kinnunen <kkinnunen@apple.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@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>
Kimmo Kinnunen f7de39b6 2024-03-09T10:27:47 Make IntermRebuild available for all backends Move IntermRebuild from MSL to general translator code. Bug: angleproject:8590 Change-Id: Ie14651d09fbc320b27b94e48eb12d4ca8c79c68c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5358815 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Auto-Submit: Kimmo Kinnunen <kkinnunen@apple.com> Commit-Queue: Kimmo Kinnunen <kkinnunen@apple.com>
Kimmo Kinnunen 11a2d27f 2024-03-08T14:26:56 Check array index against unsigned array size Fix an assert during GLSL parsing when a very large array (~1U) type is indexed. Bug: angleproject:8596 Change-Id: I219ac5c8f3fa58aa4c7d679eade6f32b59eb1103 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5352653 Auto-Submit: Kimmo Kinnunen <kkinnunen@apple.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Kimmo Kinnunen <kkinnunen@apple.com>
Kimmo Kinnunen 90ae6cbe 2024-03-07T15:51:41 Avoid assert at main prototype when monomorphizing Use the same condition as for main function definition. Bug: angleproject:8594 Change-Id: I66e4af61015607660437745042976fdc577308ca Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5352247 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Auto-Submit: Kimmo Kinnunen <kkinnunen@apple.com>
Erica Li 0f110098 2024-03-08T12:40:09 Avoid assert with multiple memory qualifiers Add missing qualifier strings. Bug: angleproject:8593 Change-Id: I484571c33effd85d52712b4876f6a3a5c73d8fde Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5352255 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Auto-Submit: Kimmo Kinnunen <kkinnunen@apple.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Kimmo Kinnunen 39f29f65 2024-03-05T21:42:32 Ensure unary math op parse to an node on error Return the error node for ops like radians(). The math op parse can fail in multiple ways. Fixed: angleproject:8583 Change-Id: Ief7e150dffefe711f567d95c62d1023fc7fa1c91 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5344716 Reviewed-by: Kenneth Russell <kbr@chromium.org> Auto-Submit: Kimmo Kinnunen <kkinnunen@apple.com> Commit-Queue: Kenneth Russell <kbr@chromium.org>
Kimmo Kinnunen 4e9fbb36 2024-03-06T15:06:07 Metal: Remove AccessField(.., ImmutableString) The variant is incorrect, as ImmutableString does not describe the field name completely. Names belong to different namespaces denoted by SymbolType. Bug: angleproject:8558 Change-Id: I8332f574dfa8439d02af119fd858a6f5acdec73d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5349698 Commit-Queue: Kenneth Russell <kbr@chromium.org> Auto-Submit: Kimmo Kinnunen <kkinnunen@apple.com> Reviewed-by: Kenneth Russell <kbr@chromium.org>
Kimmo Kinnunen 51702d79 2024-03-06T14:05:45 Make 2024-03-05 changes compile with clang 15 WebKit compiles with this. Constructing with function style cast constructor is not supported when the type does not have a constructor. Use initializer list construction with explicit name instead. For MacroExpander declare a constructor. Fixed: angleproject:8585 Change-Id: I17747a277ceba62f300fcdc88cd058e04b3c3938 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5349697 Auto-Submit: Kimmo Kinnunen <kkinnunen@apple.com> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Kimmo Kinnunen 47cd0529 2024-03-04T15:19:30 Fix assert invoking #line during macro invocation Fix an assert with preprocessor content of form: f #line f() (x If the #line macro function invocation forms an invalid line number, the line directive parsing will stop and unwind the macro context stack. However, it did not do the state management related to unwinding the context: it left the f function marked as "disabled". Fix by managing the state in the unwind scenario. Also make MacroContext be allocated from the context stack vector instead of heap. Also fix all the define tests to expect a version directive call. Fixed: angleproject:8578 Change-Id: I31dbeb911b07779eebe28bf58f13cec8876aa982 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5342495 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org> Auto-Submit: Kimmo Kinnunen <kkinnunen@apple.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Kimmo Kinnunen 27423bff 2024-03-05T17:57:24 Metal: Generate names for rewritten inputs When expanding multi-component fields to multiple single-component fields, use AngleInternal namespace for the new names. The names are generated with form "someField_0" where _0 is the component index. If these are not created in AngleInternal, caller is able to create a name clash by introducing single-component field "someField_0". Fixes an assert where the vec4(a_) + vec4(a) would assert on size mismatch because the variable lookup for "a_" would find a rewritten variable for the expanded matrix row of "a". Bug: angleproject:8558 Change-Id: I64b7a755d7d534543fdb0f4c43008dd5c63f4aad Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5323060 Auto-Submit: Kimmo Kinnunen <kkinnunen@apple.com> Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Kenneth Russell <kbr@chromium.org> Reviewed-by: Kyle Piddington <kpiddington@apple.com>
Kimmo Kinnunen 0ad73958 2024-03-04T11:17:36 Deduplicate and fix ConstStrLen implementations Move multiple implementations to one angle::ConstStrLen. Some of the implementations were partially incorrect, too. Fixed: angleproject:8569 Change-Id: I760c173a5b75932f4ae2fabcc4916329247d3cb5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5332384 Commit-Queue: Kenneth Russell <kbr@chromium.org> Auto-Submit: Kimmo Kinnunen <kkinnunen@apple.com> Reviewed-by: Kenneth Russell <kbr@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Kimmo Kinnunen 3fa8d578 2024-03-04T10:06:57 Make appendDecimal use the last char of the buffer ImmutableStringBuilder(1) means 1 char usable payload and \0. This this should fit appendDecimal(1) but did not. Fix the off by one error calling snprintf. Also: * removes const & from uint32_t argument * removes const & from operator<<, to stay consistent * Removes a redundant static_cast * Implements operator<< const char* with potentially better operator<<(const ImmutableString&) (may get compile time strlen) Fixed: angleproject:8567 Change-Id: Ibfff59f6846add0498d06e963266e50ec19baf80 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5332381 Auto-Submit: Kimmo Kinnunen <kkinnunen@apple.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Kenneth Russell <kbr@chromium.org>
Kimmo Kinnunen 871a309c 2024-03-04T14:43:10 Fix layout(index=) parse assert on es 100 shaders Remove invalid assert about layout index qualifier being present only if EXT_blend_func_extended is present. The layout qualifier gets parsed to support EXT_shader_framebuffer_fetch in ES 100 shaders to support "layout(incoherent) mediump vec4 gl_FragData[gl_MaxDrawBuffers]" Fixed: angleproject:8570 Change-Id: I0d0d99bcc882a0befd97c2510dec4a8ccf1690bd Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5340249 Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Kenneth Russell <kbr@chromium.org> Auto-Submit: Kimmo Kinnunen <kkinnunen@apple.com>
Dan Glastonbury 5a4bfd61 2024-01-12T17:15:39 Metal: Separate struct definition from function return The EmitMetal pass in shader translator does not handle writing the defintion of a structure that is declared in the return type of a function, such as: struct Foo { float val; } foo() { ... } This change adds a new pass, SeparateStructFromFunctionDeclarations, to separate the definition and declaration of struct variables in function prototypes into two statements, such as: struct Foo { float val; } foo(); struct Bar { int val; } bar() { ... } void main() { ... } Foo foo() { ... } into: struct Foo { float val; }; Foo foo(); struct Bar { int val; }; Bar bar() { ... } void main() { ... } Foo foo() { ... } Fixed: angleproject:8302 Change-Id: Id8b6ba256d3c8375dd889facd70e4715261c1ca3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5191644 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Kimmo Kinnunen 2b1ef00a 2024-02-20T15:45:34 Metal: Fix validation for anonymous struct arrays Fix validation failure for accessing an element of array of anonymous struct. SeparateCompoundStructDeclarations would create new Structures to name unnamed structures. The Structure instance of the array index accessor node was incorrect, it was the old Structure. Use same pattern as in SeparateStructFromUniformDeclarations. Bug: angleproject:8551 Change-Id: I04684e5ad99cc2b9038a0cc21c7eefcc6cf247df Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5310074 Commit-Queue: Kimmo Kinnunen <kkinnunen@apple.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org> Auto-Submit: Kimmo Kinnunen <kkinnunen@apple.com>
Kimmo Kinnunen 9d453e57 2024-02-16T22:28:18 Fix ASSERT in non-global precise var decls Precise was treated as invariant. Precise can be declared for non-global variables. Bug: angleproject:8550 Change-Id: Ia0d00d67d0d1504b78294ee2256785fe3da3e399 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5300976 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Auto-Submit: Kimmo Kinnunen <kkinnunen@apple.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org>
Alexey Knyazev 40dfb3a8 2024-02-12T00:00:00 Fix length() translation for clip/cull distance arrays * Fixed a failing assertion when the arrays are resized. * Added a compile error for length() when the arrays are unsized. Fixed: angleproject:8527 Change-Id: I6379336c546b008095f0875e5b5b4e8e0e5ba3e6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5293914 Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Kimmo Kinnunen 197beb4d 2024-02-13T15:47:32 Metal: Crash if for loop body is optimized away Loops might have their bodies optimized away. For case like `for(;;) if(false);` the constant pruning happens at parse phase. The else branch (e.e. no else branch, nullptr) would be selected as the body. Some code treated the body as optional, some code treated it as required. Define it as required, and remove all conditional code related to the loop body. Bug: angleproject:8532 Change-Id: Ic35f1bf78e63ceb2cee7b96ba99e788efc282e6f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5291554 Auto-Submit: Kimmo Kinnunen <kkinnunen@apple.com> Commit-Queue: Kimmo Kinnunen <kkinnunen@apple.com> Reviewed-by: Kenneth Russell <kbr@chromium.org>
Kimmo Kinnunen 9d344b5c 2024-02-13T17:54:12 Uniform block reference in constuctors crash Passing uniform block instance name to a built-in constructor would cause type confusion. Block this by failing to parse. Bug: angleproject:8533 Change-Id: I5a676b41e2f3d766ece4ed472debc1c874753293 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5290897 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Kimmo Kinnunen <kkinnunen@apple.com> Auto-Submit: Kimmo Kinnunen <kkinnunen@apple.com>
Alexey Knyazev cb7d3cc2 2024-02-09T00:00:00 Treat clip/cull distance built-ins as having side effects The sizes of these built-in arrays may be affected by indexing them with constant integral expressions so such operations should not be optimized out. Fixed related failures during MSL and HLSL translation. Fixed: angleproject:8525 Change-Id: I8460aa03b997ebc4142ee2d9f81eeefe13661336 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5285436 Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Kimmo Kinnunen ab71d751 2024-02-07T14:25:32 Fix an assert on multidim array constructors Fail early instead of asserting when trying to parse a multidimensional array constructor call with unsized argument array argument. int A[]; int B[int[][](A)]; Bug: angleproject:8519 Change-Id: Iee2c70318eebd2def57ffab8db709d1076692922 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5272434 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Auto-Submit: Kimmo Kinnunen <kkinnunen@apple.com> Commit-Queue: Kimmo Kinnunen <kkinnunen@apple.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 3fdf576a 2024-01-26T14:37:42 Vulkan: Workaround Nvidia driver bug with OpSelect Bug: angleproject:8503 Change-Id: I4bd2580056df3d970a1316d0dbeaaad7590aa947 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5237873 Reviewed-by: Yuxin Hu <yuxinhu@google.com> Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Yuxin Hu <yuxinhu@google.com>
Geoff Lang 9318a143 2024-01-11T15:58:44 Add __asm__("") statements to loop bodies in MSL. This prevents erasure of infinite loops during optimization passes. Bug: chromium:1513738 Change-Id: I84a305b5e7fd824531d9e3ebae5496ddec030bac Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5191166 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Alexey Knyazev <lexa.knyazev@gmail.com>
Alexey Knyazev 02aa605a 2024-01-25T00:00:00 Metal: Include only the <metal_stdlib> header Removed the logic for generating individual include macros as <metal_stdlib> provides all functions. Fixed: angleproject:8504 Change-Id: I8c83ca8cc2443a4b64e4e022a3a694c7643be569 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5237274 Reviewed-by: Kimmo Kinnunen <kkinnunen@apple.com> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com> Reviewed-by: Kenneth Russell <kbr@chromium.org>
Alexey Knyazev 7d30cf9f 2024-01-22T00:00:00 Metal: Simplify sign function translation Check whether a float or an integer variant is needed and emit only what is necessary. Fixed: angleproject:8502 Change-Id: I7061a5faa7cf09519b30e64ff90c42bbe392908a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5234350 Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
Alexey Knyazev 600a1a80 2024-01-22T00:00:00 Metal: Clamp vector element index references Ensured that vector elements passed by reference are within the number of vector components. Fixed: angleproject:8492 Change-Id: I2defbd8dfd418256ddb87f8ce1a74ac09a8a1b7b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5229957 Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
Alexey Knyazev 2431d4df 2024-01-18T00:00:00 Metal: Skip array index clamp for constant values Do not wrap constant array indices with ANGLE_int_clamp when their values could be statically validated. Fixed: angleproject:8488 Change-Id: I3ad183475e1847cb7db1a07df3598c7d39767d7e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5220233 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi c6fbf93d 2024-01-19T09:57:12 Vulkan: Fix input attachments leaking into uniform list To communicate the existence of input attachments added to the shader, the translator was adding `ShaderVariable`s for each to the list of uniforms exported from the shader. This was incorrect, as this list is visible to the application through `glGetActiveUniform`. Additionally, this was unnecessarily causing these uniforms to go through program link. Reserving SPIR-V ids for these uniforms, all that is needed from the translator is the mere existence of these input attachments. This change removes the addition of uniforms, and instead exports a bitset. Elsewhere, that bitset is consulted and reserved SPIR-V ids are used. Bug: b/320563594 Bug: angleproject:5792 Change-Id: Id93846cbc3996248f391fd2d5a65af1e48d6d46e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5215089 Reviewed-by: mohan maiya <m.maiya@samsung.com> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Alexey Knyazev fc742305 2024-01-18T00:00:00 Metal: Simplify geometry functions translation Check whether a vector or a scalar variant is needed and emit only what is necessary. Reduced the generated MSL for: - atan/atan2 - length - distance - dot - normalize - faceforward - reflect - refract Fixed: angleproject:8487 Fixed: angleproject:8489 Change-Id: I3be39e55997062136aae2782269a65c0c738d6cf Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5217532 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
Shahbaz Youssefi 175514c6 2024-01-12T14:43:33 Translator: Bundle metadata flags coming out of the translator In preparation for a follow up change that adds more such metadata. Bundling them together makes it convenient to retrieve, save and load all those flags. Bug: b/320563594 Change-Id: I4f95b32acfb0842cc5d9e72c1788a827bee2c760 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5209450 Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Alexey Knyazev 950d054a 2024-01-11T00:00:00 Metal: Do not defer global const initializers Since MSL supports constant global variables, they should not be included in the DeferGlobalInitializers operation. This reduces temporary register usage and thus makes shaders that use large const arrays more compatible with Apple GPUs. Fixed: angleproject:8479 Change-Id: If1cd17a0a194173e60e6b5152297054fc384c0b2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5189165 Reviewed-by: Kimmo Kinnunen <kkinnunen@apple.com> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
Alexey Knyazev 473dd389 2024-01-04T00:00:00 Metal: Fix out/inout parameter aliasing Ensured that MSL-internal structs are included in the parameter aliasing checks. Fixed the following tests: dEQP-GLES2.functional.shaders.function .global_variable_aliasing_fragment .global_variable_aliasing_vertex dEQP-GLES3.functional.shaders.function .global_variable_aliasing_fragment .global_variable_aliasing_vertex Fixed: angleproject:7145 Change-Id: Ia1e40e72a69e2f91b480ef5fbb75ff0f0a1a772a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5176988 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
Alexey Knyazev a6b9a744 2023-12-21T00:00:00 Metal: Implement vertex attribute aliasing When vertex attribute aliasing is supported, the external vertex input struct is filled post-link to account for potentially aliased attributes. Fixed the following tests: dEQP-GLES2.functional.attribute_location.bind_aliasing .cond_float .cond_vec2 .cond_vec3 .cond_vec4 .cond_mat2 .cond_mat2_offset_1 .cond_mat3 .cond_mat3_offset_1 .cond_mat4 .cond_mat4_offset_1 dEQP-GLES3.functional.attribute_location.bind_aliasing .cond_float .cond_vec2 .cond_vec3 .cond_vec4 .cond_mat2 .cond_mat2_offset_1 .cond_mat3 .cond_mat3_offset_1 .cond_mat4 .cond_mat4_offset_1 .max_cond_float .max_cond_vec2 .max_cond_vec3 .max_cond_vec4 .max_cond_mat2 .max_cond_mat3 .max_cond_mat4 Fixed: angleproject:6297 Change-Id: Ifa6b82e0d7d4e12115ec19e342cfb82ab4389f5a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5148210 Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
Alexey Knyazev 3c8501b3 2023-12-21T00:00:00 Metal: Handle embedded uniform struct arrays Preserve arrayness type information when replacing uniform declarations. Fixed: angleproject:6525 Change-Id: I09ea79ffa5bf74e06503985d4f90ccbe0bf25570 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5150729 Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
Alexey Knyazev e172c104 2023-12-07T00:00:00 Metal: Fix temporary array initialization Ensure that temporary array declarations have literal initializers to bypass Metal compiler issues. Fixed the following tests on Apple silicon: dEQP-GLES2.functional.shaders.indexing.tmp_array .float_const_write_dynamic_loop_read_fragment .float_const_write_dynamic_loop_read_vertex .float_const_write_dynamic_read_fragment .float_const_write_dynamic_read_vertex Fixed: angleproject:7058 Change-Id: Id4a360b0a5a15da43ce4626c6dfe03556cc9d0f0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5115898 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Geoff Lang f8fae1ff 2023-12-08T13:20:36 Validate Uniform variable limits with each iteration VariablePacker would loop over all variables and sum up the total row counts before validating. Each variable can take hundreds of rows so it is possible to overflow the counters before validating them. Validate the limits with each iteration and early-out when the limits are exceeded. https://bugzilla.mozilla.org/show_bug.cgi?id=1864587 Bug: chromium:1864587 Change-Id: Ic235ada1516a0d5a9948d82b22f6316a037c09ca Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5106408 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Auto-Submit: Geoff Lang <geofflang@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi dc4b1acd 2023-11-30T15:42:32 Translator: Limit private variable size to 64KB This is indirectly fixing an issue where passing large arrays in SPIR-V such that an internal cast is needed (such as array inside interface block copied to local varaible) causes an overflow of the instruction length limit (in the absence of OpCopyLogical). By limiting the size of private variables to 32KB, this limitation is indirectly enforced. It was observed that all the test shaders added in this CL fail on the Nvidia OpenGL drivers, so such a limit seems to be reasonble. Bug: chromium:1505009 Change-Id: Ia36134b2bf8501a5b875814db3566be28b183e0f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5077408 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Alexey Knyazev 6d9f0aee 2023-11-30T00:00:00 Metal: Ensure helper invocations when derivatives are used Set sample coverage mask to ensure that fragment shader helper invocations are performed when derivatives are used. Fixed the following tests on Apple silicon: dEQP-GLES2.functional.texture.mipmap .2d.projected.nearest_linear_repeat .2d.projected.linear_linear_repeat .cube.projected.linear_nearest .cube.projected.linear_linear dEQP-GLES3.functional.texture.mipmap .2d.projected.nearest_nearest_mirror .2d.projected.linear_nearest_clamp .2d.projected.linear_nearest_repeat .2d.projected.linear_nearest_mirror .2d.projected.nearest_linear_repeat .2d.projected.linear_linear_clamp .2d.projected.linear_linear_repeat .3d.projected.nearest_nearest_mirror .3d.projected.linear_nearest_clamp .3d.projected.linear_nearest_repeat .3d.projected.nearest_linear_clamp .3d.projected.nearest_linear_mirror .3d.projected.linear_linear_clamp .3d.projected.linear_linear_repeat Fixed: angleproject:8443 Fixed: angleproject:7023 Change-Id: I13fc52532b94de098dcf3e9f5f02d48a6c8913c7 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5089131 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
Alexey Knyazev 5d70a41c 2023-11-30T00:00:00 Metal: Use a separate struct for last fragment data Used a separate MSL struct type for reading from framebuffer attachments to not fetch unnecessary draw buffers and to be able to set a sample mask. Removed TranslatorMSL::isSampleMaskAllowed() Ensured that the lastFragmentOut variable is not added when PLS does not use framebuffer fetch. Fixed: angleproject:8442 Change-Id: Ia3320fc6063277479b5aa9b7fea34457465add75 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5079450 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
Chris Forbes a1cd2198 2023-12-04T11:42:13 Fix yuv_2_rgb and rgb_2_yuv GLSL function emulation The color conversions themselves were already correct, but Y was assumed to be full range, and u,v assumed to be centered on zero. This change folds the range expansion and chroma bias into the transforms. In order to accomplish the bias the matrices are extended to be mat4x3, and the provided color value is extended to a vec4 with w=1. Various other methods are possible (and potentially more efficient if the standard is not a constant) but just folding everything into the matrices is the most straightforward. Test: atest CtsNativeHardwareTestCases Bug: b/308437613 Change-Id: I33f797450c9ad9e758100eb8530d86548939f4ed Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5082558 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Charlie Lao 90767546 2023-12-01T12:27:15 Vulkan: Add test for __samplerExternal2DY2YEXT then swizzle Added a correctness test SourceYUVTextureTargetExternalRGBSampleYUVSampleWithSwizzle for applying swizzle after sampler. Also removed some bug workaround for VVL and drivers since they are fixed now. Bug: b/309480316 Change-Id: If82b2251745a96335b535c67b6e0c0847268b25b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5080497 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: mohan maiya <m.maiya@samsung.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi caa5e4ea 2023-11-30T14:12:42 Translator: Fail compilation if too many struct fields If there are too many struct fields, SPIR-V cannot be produced (as it has a hard limit of 16383 fields). The Nvidia GL driver has also been observed to fail when there are too many fields. Bug: chromium:1505009 Change-Id: If9b01716c1cab35a6e537da64421e29fe0eda91e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5074629 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Roman Lavrov <romanl@google.com>
Shahbaz Youssefi 6df603ed 2023-11-30T13:53:00 Translator: Optimize field-name-collision check As each field of the struct was encountered, its name was linearly checked against previously added fields. That's O(n^2). The name collision check is now moved to when the struct is completely defined, and is done with an unordered_map. Bug: chromium:1505009 Change-Id: If28d738254a541450912eba4ed168424dad9d8be Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5077407 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Roman Lavrov <romanl@google.com>
Sergey Kataev 75e13e68 2023-11-29T22:19:46 Metal should not inline non-const global initialisers Bug: angleproject:8403 Change-Id: Iaa6126d7043931a16104ea84c5f7e737017dabc3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5076256 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Sergey Kataev <sergeyka@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Alexey Knyazev edcfab40 2023-11-23T00:00:00 Metal: Implement textureCubeGrad transformation for AGX Wrapped all affected built-in function calls with helpers that transform derivative values. Fixed all *.texturegrad.* dEQP failures on Apple silicon. Fixed: angleproject:7021 Fixed: angleproject:8433 Change-Id: I16b023840ad267ab72d31fde3cb0fa7048e5310c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5071254 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
Alexey Knyazev d696b40f 2023-11-23T00:00:00 Metal: Use precise tanh for highp result types When fast math is enabled, default tanh does not pass dEQP precision tests. Explicitly request precise tanh when the result type has high precision. Bug: angleproject:8287 Change-Id: I07c8c2638b5f0a51feacbeadb78382152a95b03c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5057298 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
Alexey Knyazev e8923a62 2023-11-14T00:00:00 Clamp gl_PointSize to both bounds Ensure that point size values smaller than ALIASED_POINT_SIZE_RANGE[0] are clamped as the spec requires. Fixed: angleproject:8416 Change-Id: I3cfd2b1d3c1f34788d062ff4ca4b809ce3b5aaa9 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5033198 Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Shahbaz Youssefi 4c500944 2023-11-08T16:16:23 Translator: Mark most builtins as not having side effect This helps the translator eliminate stray uses of these builtins. Bug: angleproject:6061 Change-Id: Ic0e72bddad5730fb1f906a4c8e53191ab3318d29 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5012988 Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 6eeb11bd 2023-11-08T15:54:13 Translator: Unmark dFdx, dFdx and fwidth as having side effect These were marked as having a side effect in https://chromium-review.googlesource.com/c/angle/angle/+/924155, but it's unknown why. This change separately unmarks them as having a side effect, so if they are there to prevent a driver bug or such things, it can be isolated to this change. Bug: angleproject:6061 Change-Id: I8694ffdbb0142d330c8e2d73562f8004158023b3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5012986 Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Jamie Madill aea43399 2022-08-29T10:44:41 Mark texture2D() functions as not having side effects. This should allow the shader translator to remove unused variables and cut out sampling instructions in apps like T-Rex. Bug: angleproject:6061 Change-Id: If543c9c737cdbcfdea1433876cd425e7335e5297 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3862383 Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>