src/tests/gl_tests/GLSLTest.cpp


Log

Author Commit Date CI Message
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 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>
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>
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>
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>
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 b3ab67d3 2024-03-14T15:06:02 tests: Remove unnecessary .get() from RAII objects Bug: chromium:40942995 Change-Id: I82509869bce3ad8f51811188fe04267f2de04786 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5370904 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
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>
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>
Shahbaz Youssefi 195c142d 2024-02-14T15:09:54 GLSL test for side effects in prune-able loop Bug: angleproject:8532 Change-Id: Ie872e957b78454d725575b05721f9b3f213889f6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5297407 Reviewed-by: Yuxin Hu <yuxinhu@google.com> Commit-Queue: Yuxin Hu <yuxinhu@google.com> Auto-Submit: 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>
Shahbaz Youssefi f794c9c2 2024-01-22T09:56:08 Tests for out-of-bounds LOD in texelFetch Bug: chromium:1504556 Change-Id: I3a92da00d9a8781122c7218f22a681839783dc7e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5225080 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yuxin Hu <yuxinhu@google.com>
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 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>
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>
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>
Shahbaz Youssefi 64eb87af 2021-05-12T00:02:22 Add test for VectorizeVectorScalarArithmetic bug Bug: chromium:1201084 Change-Id: Icfb659ae5195f8dd80fecd0904cb90b77697fa70 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2889601 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Roman Lavrov <romanl@google.com> Commit-Queue: Roman Lavrov <romanl@google.com>
Geoff Lang f441e3ee 2023-11-01T15:22:55 Metal: Fix missing mix(float,float,bool) overload ANGLE has an ANGLE_mix_bool overload when the last parameter is a bool but it is not needed when the other parameters are scalar. Bug: chromium:1493243 Change-Id: I6ea904ed63055b49cf3eaded475eafa607ca5976 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4995278 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Geoff Lang 59f7467a 2023-11-01T14:53:42 Metal: Add missing ScalarMatrix ops Translations for the following built-ins were missing: scalar - matrix scalar + matrix scalar / matrix Bug: angleproject:7525 Change-Id: I5da85781829c195906cc689ffee55cb681f0337c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4995668 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Shahbaz Youssefi 1cab871c 2023-09-27T22:11:25 GL: Fix ScalarizeVecAndMatConstructorArgs vs precision If the constructor being expanded has no precision (such as if it's entirely made up of constants and bools), the workaround didn't produce a precision for the helper function, leading to GLES compilation errors. Bug: chromium:1420130 Bug: angleproject:8361 Change-Id: I0de312dfd1bfbf45317db4fb88d685a843052817 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4898697 Reviewed-by: Yuxin Hu <yuxinhu@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Shahbaz Youssefi 6ff209bc 2023-08-30T00:02:30 Clean up InfoLog usage during link The info log doesn't really belong to ProgramExecutable; it belongs to ProgramState. However, it is placed there for convenience since many functions access it. This change cleans up usage of InfoLog so the one in ProgramExecutable is consistently used, but also that is turned into a reference to ProgramState's InfoLog. This is necessary for a follow up change that restores the previous executable on link failure (and would thus otherwise lose the info log of the failing link). Bug: angleproject:8297 Change-Id: I088408e3fce9ebb35b1ec4ad3dc599bdb90bf5c5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4825624 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Yuxin Hu <yuxinhu@google.com>
Jonah Ryan-Davis 1ab5d01d 2023-08-29T13:31:07 Metal: Fix dropped out arguments from functions with many args. RewriteOutArgs has an early-exit if it spots a potentially aliased arg. It's also responsible for marking out args as references, which caused an issue in Google Earth. Removing the early-exit fixes both issues. Bug: chromium:1474736 Change-Id: Ib68dd3f3e2e0a1e773e4e09edcdfa3a4bdfc1ef2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4823006 Commit-Queue: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Roman Lavrov 59b0c7d7 2023-03-27T10:10:11 Add regression test for VVL AlphaToCoverage bug https://github.com/KhronosGroup/Vulkan-ValidationLayers/issues/5520 Bug: b/264062978 Change-Id: I0619cb28495c16d0d8d83635ad7a93f0c47cea6b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4374098 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Auto-Submit: Roman Lavrov <romanl@google.com> Commit-Queue: Roman Lavrov <romanl@google.com>
Shahbaz Youssefi 4a195ce0 2023-08-10T11:28:31 Vulkan: Fix SPIR-V id assignment to user-defined webgl_* names The code was incorrectly assuming that webgl_* names are only from ANGLE variables. An explicit check that the symbols are AngleInternal was missing. Bug: b/287166117 Change-Id: Ib8140cfabd74000492d12c11163f318a9ec3b98f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4770236 Commit-Queue: Solti Ho <solti@google.com> Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Solti Ho <solti@google.com>
Shahbaz Youssefi f5ad056b 2023-07-10T22:13:34 GL: Fix ScalarizeVecAndMatConstructorArgs and move to gl/ This transformation was buggy and was disabled. Originally, it was intended to be used everywhere. It is now needed for a GL driver workaround. This change reimplements this transformation and uses it as a GL workaround. Bug: chromium:1420130 Change-Id: I42d63fa5844bcf683ac41e61925aa637e033ca2e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4676634 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Shahbaz Youssefi 67994c6f 2023-07-05T16:18:44 Workaround app bug with using ESSL 100 extension in ESSL 310 An app has been found that uses GL_OES_EGL_image_external and GL_OES_texture_3D which are ESSL-100-only extensions in an ESSL 310 shader. Workaround this app bug by allowing these extensions to be used in all versions. Bug: b/285871779 Change-Id: I82262fc407db48d1fdd66967681c8102029cd0b6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4666351 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Steven Noonan 113f847b 2023-06-26T12:07:52 centralize basic OS/platform detection functions We had multiple different places that defined these, and with varying naming schemes. Centralize them to be defined in platform_helpers.h. Also renaming the IsApple(uint32_t) functions to IsAppleGPU(uint32_t) to avoid ambiguous meaning: "IsApple" should mean "is Apple-vended OS" while "IsAppleGPU" should mean "is Apple GPU vendor ID". Bug: angleproject:8229 Change-Id: If4e3fc5ac1b5b8ad416663950a1b2ee912ccad99 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4647291 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Steven Noonan <steven@uplinklabs.net> Auto-Submit: Steven Noonan <steven@uplinklabs.net> Reviewed-by: Roman Lavrov <romanl@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 9b1ff7b1 2023-05-25T14:13:13 Translator: Fix SPIR-V translation without "variables" flag This flag is now assumed to always be true for the SPIR-V (and MSL) translators. They use the collected variables during translation. Bug: chromium:1447314 Change-Id: I69d31ce8144aec0bd2a7263bad6e5a366e922740 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4567830 Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 3f633521 2023-05-18T21:27:00 Vulkan: Fix handling inactive unnamed I/O blocks in SPIR-V When an unnamed I/O block already exists, later inactive unnamed I/O blocks were not being added to the list of inactive varyings, causing the SPIR-V transformer to trip up Bug: b/283017896 Change-Id: Ida5b38e1a03da2b336d5904caa44f53dbdfb8aa3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4544590 Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Charlie Lao <cclao@google.com>
Shahbaz Youssefi 336bfd60 2023-03-30T00:16:40 GL: Fix the RewriteRepeatedAssignToSwizzled workaround This transformation splits chained assignments where the LHS is assigning to a swizzle. However, instead of retaining the assignment operator (like *=, += etc), it was accidentally unconditionally using `=`. Bug: chromium:1394345 Change-Id: Icaef159e1fb57e720e08d4b4f6603f08d9cd2bfe Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4381648 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yuxin Hu <yuxinhu@google.com>
Shahbaz Youssefi 57dd0e5f 2023-03-27T13:05:36 Translator: Initialize out arguments too for WebGL Local variables were initialized for WebGL, but not `out` arguments. However, `out` arguments completely overwrite the passed-in variable at call site, so they should also be zeroed out. Bug: chromium:1425685 Change-Id: Ib2f61a962eea74c4933aafa4d5ad377189cec578 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4375137 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Alexey Knyazev 1ee27fcd 2023-03-24T00:00:00 Fix translation of noperspective interpolation qualifier Auxiliary storage qualifiers used with 'noperspective' interpolation must be retained during ESSL translation * Added new qualifiers: * EvqNoPerspectiveCentroid * EvqNoPerspectiveCentroidIn * EvqNoPerspectiveCentroidOut * EvqNoPerspectiveSample * EvqNoPerspectiveSampleIn * EvqNoPerspectiveSampleOut * Adjusted GLSL and SPIR-V output * Adjusted 'sample' rank to be the same as 'centroid' Fixed: angleproject:4388 Change-Id: Iffc80a7a3b057beffd3bcbbc9446eeed77183c99 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4368471 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
Alexey Knyazev afc1e5dc 2023-03-27T00:00:00 GL: Support OES_sample_variables Bug: angleproject:8097 Change-Id: I983d6e83fe9ca942c91cbdf7274b46306e38f11f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4368476 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
Alexey Knyazev f5695244 2023-03-21T00:00:00 Fix sample qualifier validation * `smooth sample` is the same as `sample` * `flat sample` is the same as `flat` Bug: angleproject:3589 Change-Id: I8615fa73f4b0cea729b8e09d86f1b8183669de2b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4356666 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Mike Schuchardt 4cbe8548 2023-02-28T21:12:17 Expose shader extensions based on ESSL version Previously, all suported extensions were always exposed in the preprocessor. This broke some games which relied on ESSL1-only extension macros not being defined in ESSL3 shaders. This change adds min/max version information to list of extensions so the preprocessor can conditionally expose extensions based on the shader language version, both via the extension name macros and the #extension directive. Test: angle_unittests --gtest_filter="VersionTest.*" Test: angle_end2end_tests --gtest_filter="*ESSL*ExtensionMacros*" Test: Run com.gameloft.android.ANMP.GloftGGHM on Pixel 6 Bug: b/268091452 Change-Id: I2332a6cb964f54c47d23e2ef6b24e99a0b5c8202 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4304907 Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Mike Schuchardt <mikes@lunarg.com>
Shahbaz Youssefi facd07ec 2023-02-14T14:11:00 Vulkan: Prune all statements without side effect Bug: chromium:1417461 Bug: angleproject:6061 Change-Id: I6e2b74589021ee60c99448e43ee3eb7f06796ede Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4250278 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 9d84ad7d 2023-02-14T10:47:54 Translator: Fix sampler-in-struct when struct is unused Standalone symbols as statements are also pruned. For example in the below: ``` x; g(); ``` The line that only contains `x;` is pruned. In particular, this was causing a bug with sampler-in-struct processing where the code ASSERTs that if an instance of the struct is visited during traversal, that it's already processed as part of an index chain (like s.member), but in the above situation that is not true. Bug: chromium:1416152 Change-Id: I49e9a5826fc4d8c1fef1fa6f1d38c65f33f8acfd Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4247584 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yuxin Hu <yuxinhu@google.com>
Kenneth Russell 70b5620e 2023-01-10T17:16:41 Metal: skip out variable rewrite for array element references. ANGLE_elem_ref already returns a reference which is incompatible with the ANGLE_out and ANGLE_inout builtins. Skip the rewrite for this builtin, similarly to swizzle_ref for which it was already skipped. Add a small regression test which catches this bug. Fixed: angleproject:7939 Change-Id: Iff8ead697220466ceb063ea2f8eebdb7d9e5896d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4152866 Commit-Queue: Jamie Madill <jmadill@chromium.org> Auto-Submit: Kenneth Russell <kbr@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi 78e28cb8 2022-11-03T11:05:48 Vulkan: Remove glslang fallback ANGLE's SPIR-V generator is battle tested by now. Bug: angleproject:6210 Change-Id: I2ed88642e3ede435e3f906fbd701133be6873fb7 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4002868 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Cody Northrop 03eccad2 2022-10-18T10:39:53 Tests: Add reduced crashing shader test Reduced case of a shader that crashes an app during SPIR-V compile. Test: GLSLTest_ES3.NestedPowFromUniform Bug: b/217922015 Change-Id: I8d0ccd8b2c4f4e8e51ac39c9dbfaafbf48423157 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3965051 Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Cody Northrop <cnorthrop@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Yuxin Hu 70c434b2 2022-08-29T17:09:23 Check max shader storage blocks support in test If the shader source code uses shader storage buffer objects, we need to check the corresponding GL_MAX_*_SHADER_STORAGE_BLOCKS is at least of size 1. Bug: angleproject:7583 Change-Id: I7f0e537e4dcfca8414cccb0088be8d34735633d1 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3863111 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Yuxin Hu ac2aeccd 2022-08-25T17:43:43 Check GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS in test If the vertex shader uses shader storage buffer objects, we need to check GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS is at least of size 1. Bug: angleproject:7185 Change-Id: I98d83f9f0cc30e92fdcaee15541fdde96652b38e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3858144 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Eddie Hatfield 955adb77 2022-08-12T10:14:48 Cache compiled shader By storing the compiled shader in the blob cache, the time to recompile the same shader is reduced. Based on work by <hckim.kim@samsung.com> Bug: angleproject:7036 Change-Id: I884ae40e715c49a9ccd12903012e8327811e3557 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3808235 Commit-Queue: Cody Northrop <cnorthrop@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Kyle Piddington 58392791 2022-04-07T16:14:12 Translator: Fix crashes with monomorphizing loops Monomorphize functions crashes when trying to deep-copy a while loop, and a continue statement. Null check these values before performing a copy, as this is still valid AST syntax. Bug: angleproject:7190 Change-Id: I822c0aa062ed844f86aa2b603899d73cbd48255e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3573079 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Kyle Piddington <kpiddington@apple.com> Reviewed-by: Kenneth Russell <kbr@chromium.org>
Kyle Piddington aef9603f 2022-08-02T18:30:08 Separate Struct declarations earlier Metal translator backend asserts with compound struct definitions. Move SeparateCompoundStructDeclarations before SeparateCompoundExpressions. This change does revert some changes for angleproject:6386, but the tests fixed there continue to pass. Bug: angleproject:6489 Change-Id: I6adc606ac0b14453eb5e3e90f6501bf02c2d2768 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3806616 Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Gregg Tavares <gman@chromium.org> Commit-Queue: Kyle Piddington <kpiddington@apple.com>
Shahbaz Youssefi 6f80f0f0 2022-08-06T02:29:19 Translator: Clean up the compile flag passing interface Historically, compile flags were sent to the translator as a bitmask. Recently, we were getting close to running out of bits. Additionally, direct-to-metal work had started to introduce constants to be passed to the translator, which were misplaced in ShBuiltInResources and Caps. Recent work on Pixel Local Storage adds even more constants, aggravating the situation. In this change, the interface to passing compile flags is reworked. A struct is passed (instead of a bitmask) that has one bit for each flag. This can be indefinitely extended. Additionally, the constants needed by metal and PLS are also placed in this struct. In turn, the backends can set these options directly, and don't have to hack them into Caps to further get hacked into ShBuiltInResources. Bug: angleproject:7559 Change-Id: If93f1e1b8818ad3a0ac708ab04ab93b4b397d114 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3812562 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com> Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 8474a95e 2022-08-05T22:15:04 Translator: Don't validate structs on non-root nodes Struct validation needs to know about structs that may have been defined outside the scope of the node, so this validation (similar to variable and function call validation) is disabled when validation a subtree of the AST. Bug: angleproject:7531 Bug: b/239207278 Change-Id: Id6dcee041a40f09f0c36a9ef3bfc238433b69c58 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3812047 Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Yuxin Hu <yuxinhu@google.com> Reviewed-by: Yuxin Hu <yuxinhu@google.com>
Shahbaz Youssefi 4e046256 2022-07-25T17:17:28 Translator: Fix deep copy of loops and branches Fixed nullptr dereference when the loop or branch doesn't have an expression. Bug: angleproject:7518 Change-Id: Ib888634e409dcbc27ef060bb46017e8911097eef Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3785294 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 3baa867c 2022-07-14T23:08:42 Vulkan: Fix image arguments passed to functions in GLSL It's impossible to provide the format qualifier to an image function parameter in GLSL, because `layout()` is not acceptable there. SPIR-V doesn't accept formatless image parameters without the StorageImageReadWithoutFormat and StorageImageWriteWithoutFormat capabilities, which are not universally available. Instead, this change monomorphizes functions with image parameters. Note that this was already previously done for R32F images for emulation purposes. Bug: angleproject:7484 Change-Id: Id287c4a93b32deb3fd8be982c32fa58fd2c848d8 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3763074 Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Kyle Piddington eaf77ef3 2022-07-07T10:25:16 Metal fails to compile uniform blocks in ternary statements When creating an intermediate type for type expansion, Metal was copying over information about which uniform block a type appeared in. This led to a later pass, RewriteNamelessUniformBlocks, failing. This patch helps address a compile failure in the Godot engine. Bug: angleproject:7487 Change-Id: If0724f93017e41260ff11e59a5c28e8578563891 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3751106 Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Kyle Piddington <kpiddington@apple.com> Reviewed-by: Gregg Tavares <gman@chromium.org>
Chris Dalton 3e5de4ac 2022-07-05T10:22:54 Add a test that passes image2D handles as function args Bug: angleproject:7484 Change-Id: I3565bd42deeefa22566d4556a25ec9778c6f8550 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3747098 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Geoff Lang 785353fd 2022-05-24T12:40:16 Support Desktop OpenGL context creation in end2end tests Validation of Desktop GL versions and profile masks is unimplemented. Bug: angleproject:7360 Change-Id: Ifae94215b6aada895c2b02318a1d05c9515e9b96 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3664916 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Eddie Hatfield 89e38b57 2022-06-22T15:04:08 Refactor to use ANGLETest vs ANGLETestWithParam Bug: angleproject:6747 Change-Id: I72ad52d0268eae0e1a401f12f3e94cc5efa402f2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3719002 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Shahbaz Youssefi 79185677 2022-06-22T16:22:35 Translator: Fix validation of struct with same-name struct field In the following: ``` struct S { S s; }; ``` The `S` in the field refers to a previous declaration of `S` in an outer scope. The validation code mistakenly attempted to ensure it refers to the same `S` being declared. Bug: chromium:1337628 Change-Id: I86184be63bc59e608fe5b24369cd4c40b3bb3b31 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3716965 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yuxin Hu <yuxinhu@google.com> Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org>
Chris Dalton d9a2027f 2022-05-19T16:52:28 Add a test for volatile aliases of the same shader image Bug: angleproject:3032 Bug: angleproject:7343 Bug: angleproject:7398 Change-Id: I6ea6abea0b9dafd93bc297499df23be27904c996 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3656314 Reviewed-by: Stephen White <senorblanco@chromium.org> Commit-Queue: Stephen White <senorblanco@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Rohit Rao 4b911686 2022-06-06T22:25:37 Converts from sprintf() to snprintf(). sprintf() is deprecated in Xcode 14, so update to safer equivalents in order to keep the compiler happy on iOS and macOS. Bug: chromium:1331345 Change-Id: Id5348088bf69cbd360d9251e6323596cb710666d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3690747 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Chris Dalton 9800a3cf 2022-05-19T16:52:28 Add a test for imageLoad after glClear to the texture Bug: angleproject:7355 Change-Id: Ib1ddf685f2fa6cb24161615224971a7185234000 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3659504 Auto-Submit: Chris Dalton <chris@rive.app> Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Kenneth Russell <kbr@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 98c2e169 2022-05-20T16:17:49 Vulkan: Reduce pre-rotation spec const to bool The specialization constant now only dictates whether x and y should be swapped. The complete 8 possible states of rotation and y-flip are achieved by using this swap in combination with a driver uniform for x and y flip. Swapping is still a specialization constant to avoid degrading performance of dFdx/dFdy which otherwise would need both to be evaluated instead of one. On platforms which don't support pre-rotation, the specialization constant will never change and driver uniforms entirely govern y-flip. On platforms that do support pre-rotation, only two variations of the pipeline are needed. Bug: angleproject:7366 Change-Id: I73f84e89fa9349d2098fa5b21573aee57d93a30c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3663151 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Lingfeng Yang <lfy@google.com> Reviewed-by: Charlie Lao <cclao@google.com>
Stephen White b4ec8eac 2022-04-12T12:16:40 D3D11: implement image load/store for non-compute shaders. Output image metadata and image2d replacement string in other shader types. Implement the actual HLSL transform for fragment shaders. Re-enable problematic test. Bug: angleproject:7121 Change-Id: I49b815695757e822e6fdfe599e07ceb5b1d6a75c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3550544 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Stephen White <senorblanco@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang c8c4109c 2022-05-02T11:29:24 HLSL: Disambiguate functions that have int/uint parameters. If a bit-shift expression is passed as a function parameter in HLSL, the compiler cannot tell if it is intended as a uint or int when doing overload resolution. Explicitly disambiguate functions that have int and uint parameters when generating the HLSL. Bug: chromium:1319332 Change-Id: I11c9518e060e9940550bbb04dd7cb953d99c2bb8 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3621316 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Lingfeng Yang <lfy@google.com> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Antonio Caggiano 5b4f180c 2022-04-29T16:56:34 Fix formatting Unrelated changes created by running "git cl format" Bug: None Change-Id: I880c7d50aead70353f22502d953efa7aa60ff5d5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3616882 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi fc828287 2022-04-24T00:12:11 Tests for Nvidia/Vulkan bugs with tessellation control Bug: angleproject:7236 Change-Id: I9fec5ef0fe03e1bb5e11067d6d3cf2e7c0b560fa Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3604077 Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Charlie Lao 3b38b379 2022-04-20T10:44:24 Vulkan: Add feature avoid HOST_VISIBLE and DEVICE_LOCAL combination Discrete GPUs device local memory usually is not CPU accessible. This adds a feature flag to control that. Fixed bug in BufferVk that when mapRangeImpl is called from angle internal, unmapImpl was using front end mapping parameters that is incorrect. We have to cache the mapping parameters in the backend to hangle the mapRangeImpl/unmapImpl calls from internal. Fixed the test bug in ComputeShaderTest.BufferImageBufferMapWrite that we are calling glMapBufferRange with GL_MAP_READ_BIT but are actually writing to the map pointer. This should result in undefined behavior per spec. Fixed the test bug in GLSLTest.* that VerifyBuffer calls glMapBufferRange, but was giving incorrect length which result in data only been partially copied. This bug was hidden due to previously all buffers are CPU accessible and there is no copy needed. Fixed the test bug in ReadPixelsPBOTest.* and ReadPixelsPBONVTest.* that calls glMapBufferRangeEXT, but was giving incorrect length which result in data only been partially copied. This bug was hidden due to previously all buffers are CPU accessible and there is no copy needed. Added new skipped syncval messages. Because this CL triggers a copyToBuffer call for some of the buffers and that changes the syncval message signature for the same reasons (i.e, feedback loop or synval does not know the exact range of buffer been used for vertex buffers etc). Bug: angleproject:7047 Change-Id: I28c96ae0f23db8e5b51af8259e5b97e12e8b91f2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3597711 Reviewed-by: Yuxin Hu <yuxinhu@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Charlie Lao <cclao@google.com>
Lubosz Sarnecki 039660a0 2022-04-14T13:32:33 Translator: Drop const from opaque parameter types `const` is ineffective on opaque types like sampler2D. That qualifier is now dropped as it was tripping SPIR-V gen up. New validation is added to make sure such parameters are not reintroduced. Test credit of Lubosz Sarnecki <lubosz.sarnecki@collabora.com> Test: angle_end2end_tests --gtest_filter="GLSLTest.ConstSamplerParameter*/*_Vulkan" Bug: angleproject:7201 Bug: angleproject:7205 Change-Id: I310a47a8eb162ddafb2ab44682520f546f8a5512 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3587345 Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 797e627e 2022-04-08T22:49:51 Autogenerate list of features as enum The WithX() and WithNoX() helpers are removed and replaced with enable() and disable() member functions that take the name of the feature (as a Feature::X enum constant). This has two benefits: - Adding tests that override a feature no longer requires additional helper functions to be written. - There's no mistaking the feature name. This change doesn't yet fix the main issue in anglebug.com/6435, but does fix the following helpers using an old feature name (so they were ineffective): - WithMetalForcedBufferGPUStorage - WithNoVulkanViewportFlip A follow up would remove the old way of overriding features in tests and replaces them with the new way. Bug: angleproject:6435 Change-Id: Ida02b26ec72bc40d7a8938c76a93815bb903ca05 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3580982 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Jamie Madill 6b94a71c 2022-04-01T10:12:07 Vulkan: Lift SwS suppressions. Bug: angleproject:4092 Change-Id: I0e72b95ba5ba2b60420d5b685349c405864c2e6e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3563513 Auto-Submit: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@google.com>
Shahbaz Youssefi cd3c74af 2022-03-30T11:48:41 SPIR-V Gen: Fix aliasing out parameters In ANGLE, when an unindexed lvalue was passed as an out parameter to a function, SPIR-V was generated such that the lvalue is passed in directly. A Skia test revealed a difference in SPIR-V and GLSL semantics where aliasing out parameters are expected to work on local copies until the end of the function. Bug: b/226904235 Change-Id: I476af01eb7d065272825967111cd208faf88c275 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3561278 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Cody Northrop ce964d66 2022-03-26T18:56:50 Vulkan: Add tessellation to GetPipelineStage helper The tessellation stages were missing from a helper, which was silently returning an invalid value. Add a test and an assert, which fires before the fix. Test: GFXBench Car Chase Test: GLSLTest_ES31.TessellationTextureBufferAccess Bug: angleproject:7135 Bug: b/218314686 Change-Id: I2bc8d374300fc1470e52affabab7491698c99cee Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3554575 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Cody Northrop <cnorthrop@google.com>
Shahbaz Youssefi 40afbe4b 2022-03-20T23:39:57 Translator: Fix SimplifyLoopConditions producing dead code This causes the tree to fail validation. Dead code could be generated if the loop body ended in a branch. In such a case, no additional instructions are added to the transformed loop body after the original body. Bug: chromium:1300782 Change-Id: I4ec46c170ab5a45fa9b9b73d4e2b62c9c4fa24a3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3539442 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Xu Xing 7eb7596a 2022-03-10T14:32:58 Ensure non float uniform are actively used In mesa, the non float uniforms are optimized out when they are not active. This change ensures the unforms are active. Reference: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6119 Bug: angleproject:7091 Change-Id: Iedff4a4b72a7204348c226778cfe940374632a4a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3515640 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jiajia Qin <jiajia.qin@intel.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi 8dc9e83e 2022-02-16T21:48:53 Translator: Fix RunAtTheEndOfShader w.r.t discard RunAtTheEndOfShader wrapped main() if it ended in discard. However, it didn't account for the fact that the discard instruction could be wrapped in a block. This change makes RunAtTheEndOfShader more conservative w.r.t discard and has it wrap main() on any encounter of discard. The change additionally adds AST validation to ensure transformations don't generate dead code after branches. Test credit to Cody Northrop. Test: GLSLTest_ES3.ConstantConditionGuardingDiscard Test: GLSLTest_ES3.NestedUnconditionalDiscards Bug: angleproject:7033 Change-Id: Ie9d5210a5cfbb13449720a8a3f44666df9443d98 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3471014 Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Kyle Piddington eeddb050 2022-01-27T11:36:10 Metal: Incorrect parenthization for assignment expressions Fix for Webgl tests conformance/ogles/GL/build/build_017_to_024.html Create intermediate values for assign-equals operations, as they cause issues on expansion later. Bug: angleproject:6489 Change-Id: I7fea162bd1f59c7c765868af739d6ddfc1c1747f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3421527 Reviewed-by: Kenneth Russell <kbr@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Kyle Piddington <kpiddington@apple.com>
Brandon Schade 06edae72 2022-01-11T11:13:20 Vulkan: Allow duplicated block name in different shader interface In OpenGL ES 3.2 Shading Language specification(4.3.9), A block name is allowed to have different definitions in different shader interfaces within the same shader. Bug: angleproject:5557 Test: KHR-GLES32.core.tessellation_shader.single.max_patch_vertices Change-Id: I49f149cfd8f6f063fc5045aa154cc401d3e38cfb Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3429684 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Brandon Schade <b.schade@samsung.com>
Shahbaz Youssefi 72529c19 2022-01-31T14:37:42 Vulkan: Fix a few framebuffer fetch bugs A few fixes to framebuffer fetch: - The built-in symbol for coherent and non-coherent are now the same for gl_LastFragData, so extension check can choose one or the other. - The temporary variable used in a transformation is renamed to not be gl_LastFragData. - inout usage is now validated correctly for shader type and version. Bug: angleproject:6951 Bug: angleproject:6905 Bug: angleproject:6907 Change-Id: I9af341a3e8e01ed375a8230618184494813d3ece Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3427577 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Brandon Schade aadc6434 2022-01-24T18:28:19 Vulkan: Fix to correctly redefine gl_PerVertex in GS Angle translator structures were inconsistent of data lookup of gl_PerVertex data when it is user defined. Bug: angleproject:5579 Test: KHR-GLES32.core.geometry_shader.api.getProgramiv3 Test: GLSLTest_ES31.PerVertex* Change-Id: Ied9ea25ce86ade29261f4f75ce0b48af15061760 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2962352 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Brandon Schade <b.schade@samsung.com>
Gregg Tavares b9f2d9cc 2021-12-16T13:08:22 Use text expectations to skip a test This instead of exiting the test in C++. Bug: angleproject:6826 Change-Id: I1e91f38f0f581821178b3b54ba809e59570b440a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3345615 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Gregg Tavares <gman@chromium.org>
Gregg Tavares a0924015 2021-11-22T19:44:05 Metal:Fix GLSLTest_ES3.GLVertexIDIntegerTextureDrawElements Metal The test was failing if the "first" argument to glDrawElements was odd. When odd the offset was not a multiple of 2 bytes and the code was going down a different path than when the offset was event. The fix for that just removes a check for alignment to 4 bytes. Checking with UNSIGNED_BYTE indices though and it still failed. That was because it was encoding the index conversion path on one command buffer and the provoking index prep on another and so they were happening out of order. Putting both on the same command buffer fixes that. Bug: angleproject:6688 Change-Id: I89b68ba965d073e0fa70b6d5b444dc743b5e34a7 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3296631 Commit-Queue: Gregg Tavares <gman@chromium.org> Reviewed-by: Kyle Piddington <kpiddington@apple.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Jamie Madill edc2cfe5 2021-11-19T14:57:16 Fix signed integer overflow in angle_end2end_tests. The test math was causing an signed overflow in the most extreme case. Test: GLSLTest_ES3.GLVertexIDIntegerTextureDrawArrays/ES3_Vulkan_SwiftShader Bug: angleproject:5795 Change-Id: Id6b845577cb6ce585ec67251dcb6111d5773012f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3289942 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Gregg Tavares d87d10cd 2021-11-12T11:02:01 Fix ASAN issue with GLVertexIDIntegerTextureDrawElements Was GLint clearData[] = {42}; glClearBufferiv(GL_COLOR, 0, clearData); Now GLint clearData[4] = {42}; glClearBufferiv(GL_COLOR, 0, clearData); Bug: angleproject:6688 Change-Id: Ia8fa0c7d406626046a32e613fda3a165a06941b6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3278489 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Gregg Tavares c6d86da2 2021-11-11T15:30:41 Add test for gl_VertexID and DrawElements This fails on the WebGL CTS conformance2/rendering/vertex-id.html. Repoing here to make it easier to debug/find/fix. Bug: angleproject:6688 Change-Id: I0a4bafc5700c77e0b6c44b067167fc4a60e63c22 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3276708 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Gregg Tavares <gman@chromium.org>
Shahbaz Youssefi 5a5996aa 2021-11-09T21:42:43 Vulkan: Handle missing decorations in SPIR-V precision fixer Bug: angleproject:6674 Change-Id: Ibfc72f14b9eeb17d7c70cf6d2384d970b2e66650 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3271551 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 52d6e363 2021-11-03T12:46:10 Translator: Fix zero-init of nameless I/O blocks Bug: angleproject:6609 Change-Id: I680fec85d53709f9abd3680a9dc5794ecfae6588 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3260326 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi e10768f0 2021-11-03T12:23:11 Translator: Fix zero-init of I/O block arrays Bug: angleproject:6609 Change-Id: I8245e868fe6bc4798e74088916e1d8cdd0727b6b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3260325 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 5c914b57 2021-10-28T13:27:04 Vulkan: SPIR-V Gen: Fix float+matrix Found by a fuzzer, float+matrix was not handled correctly by the SPIR-V output. Bug: chromium:1264212 Change-Id: I09b13c3e48374621228f5fab4de68c33973ddfd4 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3251585 Reviewed-by: Tim Van Patten <timvp@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 066fb91b 2021-10-18T15:31:27 Vulkan: SPIR-V Gen: Handle scalar(const) produced by index clamp Normally scalar(const) is folded into a constant. The index clamp transformation may produce such a code where the index looks dynamic at first (for example `false ? uniform_value : constant`), but becomes constant after folding. This change makes SPIR-V generation robust in that case. A potential future change could avoid the clamp entirely by making FoldExpressions adjust the op of the EOpIndexIndirect node whose index is being replaced with a constant with EOpIndexDirect (and apply the clamp on the argument). Bug: chromium:1260651 Change-Id: I552b7527d821d1cb52e0e53212cc481285674861 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3226311 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com>
Shahbaz Youssefi ef237faf 2021-10-18T16:22:40 Translator: Validate precision for function args In fragment shaders, float does not have a default precision. Any declaration of this type must therefore specify the precision if a default one is not provided. This was not validated for function arguments. Bug: chromium:1255089 Change-Id: I0d17e226ec88610692ec7dd18793cf4d471f12e7 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3226314 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 7f87a326 2021-10-18T13:06:29 Vulkan: SPIR-V Gen: Fix crash in array of struct constant Bug: chromium:1260690 Change-Id: I51fe85a2ebc23c3fcaa3c961c4ebf84688bbed31 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3226309 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com>
Shahbaz Youssefi f3d5dac3 2021-08-23T17:25:15 Vulkan: SPIR-V Gen: Drop dependency to glslang The SPIR-V gen path is now made default. Compilation through glslang is still supported for debugging, and is enabled on the GLSL* end2end tests for smoke testing. On release builds, glslang is not supported. To test with glslang, add the following gn arg (only necessary if dcheck is disabled): angle_enable_spirv_gen_through_glslang = true Then enable the generateSPIRVThroughGlslang feature. This can be done by setting an environment variable: ANGLE_FEATURE_OVERRIDES_ENABLED=generateSPIRVThroughGlslang ./angle_deqp_gles2_tests Binary size saving: - 1.3MB on Linux (SPIR-V gen itself: 240KB) - 730KB on Android (SPIR-V gen itself: 140KB) Perf tests: - LinkProgramBenchmark.Run/vulkan_compile_single_thread * Through glslang: truncated mean: 1287033.36 * Direct SPIR-V Gen: truncated mean: 244495.91 (~80% reduction) - LinkProgramBenchmark.Run/vulkan_compile_multi_thread * Through glslang: truncated mean: 4565894.83 * Direct SPIR-V Gen: truncated mean: 1158164.10 (~75% reduction) Bug: angleproject:4889 Bug: angleproject:6210 Change-Id: I486342702977c8114e90073b97183aba115a8b2d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3115140 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com>
Jamie Madill 44bef8ae 2021-10-08T15:01:37 Remove traces of Feature Level 9_3 support from tests. Bug: angleproject:1284 Bug: angleproject:3042 Change-Id: Ic2f77d315e98c3b15c5fc8b0359168bce00867d4 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3213294 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 0f66c861 2021-10-07T09:32:35 Add test that covers HLSL compiler bug. Bug: angleproject:2445 Change-Id: I820b2dba3748bd10ca516ef47f226ff537b78849 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3212328 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jonah Ryan-Davis 212f4592 2021-09-22T12:02:47 Enable direct-to-metal backend by default We are switching over to Apple's direct-to-metal backend instead of generating SPIRV in the metal backend. This CL enables the direct-to-metal generation by default, but the SPIRV backend is still accessible by overriding the feature directMetalGeneration. This CL comes with a change in test expectations to catch new failures and clean up newly passing tests. Bug: angleproject:6080 Change-Id: I4b10ad93c641b88857079a08fb45d3dc575d71f1 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3175664 Reviewed-by: Gregg Tavares <gman@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Jonah Ryan-Davis <jonahr@google.com>
Shahbaz Youssefi daaaba0a 2021-10-04T22:28:56 Translator: Fix uniform/struct separation for anonymous arrays When a uniform array of anonymous structs was separated into a struct declaration and uniform array, the uniform symbol was being replaced, but not the intermediate nodes that index it. This caused an AST validation error. Bug: angleproject:4740 Change-Id: Ib9d0115bd01c39d1a007f644e46b5e35c12c9304 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3204590 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com>
Shahbaz Youssefi dde409be 2021-10-04T22:05:47 Translator: Produce error on func(void, int) If void is specified, another parameter cannot follow. This change ensures that this produces an error. Bug: angleproject:6338 Change-Id: I18602ea4b52c96e498f4f2dc627d4ba2210d6fa7 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3203795 Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Jamie Madill 234ebd58 2021-10-05T08:34:12 Lift old AMD/Win/GL expectations. No longer tested on the bots. Bug: angleproject:1643 Change-Id: I5e1ca8b9c2f673ebcb44c67879829f9fd346edf0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3205795 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>