src/tests/compiler_tests/UnrollFlatten_test.cpp


Log

Author Commit Date CI Message
Shahbaz Youssefi 02e7f967 2023-05-25T14:54:49 Translator: Remove the "variables" option Variable collection is invariably enabled by the front-end as well as other major users of ANGLE such as Firefox. All translator backends except GLSL force-enable variable collection either way. This change removes this compile option and enables variable collection unconditionally. The flag itself remains in ShCompileOptions until references to it are removed from Chromium. Bug: chromium:1447314 Change-Id: I4d3b30c1bfbd345c5ad269abc62c0a6a59de2f56 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4568524 Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
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>
Stuart Morgan 9d737966 2019-08-14T12:25:12 Standardize copyright notices to project style For all "ANGLE Project" copyrights, standardize to the format specified by the style guide. Changes: - "Copyright (c)" and "Copyright(c)" changed to just "Copyright". - Removed the second half of date ranges ("Y1Y1-Y2Y2"->"Y1Y1"). - Fixed a small number of files that had no copyright date using the initial commit year from the version control history. - Fixed one instance of copyright being "The ANGLE Project" rather than "The ANGLE Project Authors" These changes are applied both to the copyright of source file, and where applicable to copyright statements that are generated by templates. BUG=angleproject:3811 Change-Id: I973dd65e4ef9deeba232d5be74c768256a0eb2e5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1754397 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill b980c563 2018-11-27T11:34:27 Reformat all cpp and h files. This applies git cl format --full to all ANGLE sources. Bug: angleproject:2986 Change-Id: Ib504e618c1589332a37e97696cdc3515d739308f Reviewed-on: https://chromium-review.googlesource.com/c/1351367 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Corentin Wallez c16678a2 2017-02-22T15:24:55 ASTMetadataHLSL: handle WebGL2 gradient builtins BUG=angleproject:1915 Change-Id: Id54e6dd417a1a288c71355e74184366d1492e92b Reviewed-on: https://chromium-review.googlesource.com/446521 Reviewed-by: Kenneth Russell <kbr@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Jamie Madill 45bcc784 2016-11-07T13:58:48 translator: Scope all classes with "sh". I was seeing an odd problem with our PoolAlloc conflicting with the glslang/Vulkan TIntermNode, so the fix was to move everything to a separate namespace. The bison grammars are also regenerated. No functional changes. BUG=angleproject:1576 Change-Id: I959c7afe4c092f0d458432c07b4dcee4d39513f3 Reviewed-on: https://chromium-review.googlesource.com/408267 Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Olli Etuaho 9b4e8626 2015-12-22T15:53:22 Redesign samplers in shaders on D3D11 Translation of samplers to HLSL on D3D11 is changed as follows: Instead of passing around HLSL sampler and HLSL texture references in shaders, all references to ESSL samplers are converted to constant indices within the shader body. Each ESSL sampler is identified by an unique index. In the code generated to implement ESSL texture functions, these indices are used to index arrays of HLSL samplers and HLSL textures to get the sampler and texture to use. HLSL textures and samplers are grouped into arrays by their types. Each unique combination of a HLSL texture type + HLSL sampler type gets its own array. To convert a unique sampler index to an index to one of these arrays, a constant offset is applied. In the most common case of a 2D texture and a regular (non-comparison) sampler, the index offset is always zero and is omitted. The end goal of this refactoring is to make adding extra metadata for samplers easier. The unique sampler index can be used in follow-up changes to index an array of metadata passed in uniforms, which can contain such things as the base level of the texture. This does not solve the issues with samplers in structs. The interface from the point of view of libANGLE is still exactly the same, the only thing that changes is how samplers are handled inside the shader. On feature level 9_3, the D3D compiler has a bug where it can report that the maximum sampler index is exceeded when in fact it is not. This can happen when an array of samplers is declared in the shader. Because of this the new approach can't be used on D3D11 feature level 9_3, but it will continue using the old approach instead. BUG=angleproject:1261 TEST=angle_end2end_tests, dEQP-GLES3.functional.shaders.texture_functions.* (no regressions) dEQP-GLES3.functional.texture.units.* (no regressions) Change-Id: I5fbb0c4280000202dc2795a628b56bd8194ef96f Reviewed-on: https://chromium-review.googlesource.com/320571 Reviewed-by: Zhenyao Mo <zmo@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Olli Etuaho <oetuaho@nvidia.com> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com> Tryjob-Request: Olli Etuaho <oetuaho@nvidia.com>
Corentin Wallez 477b243b 2015-08-31T10:41:16 Change the FLATTEN heuristic to "ifs with a loop with a gradient" This heuristic makes more sense than the previous "ifs with a discontinuous loop" as the reason we need to flatten is that we need gradients to be in branchless code. Change the UnrollFlatten test accordingly. Tested with: - the WebGL CTS - dev.miaumiau.cat/rayTracer "Skull Demo" - THe turbulenz engine GPU particle demo - Lots of ShaderToy Samples (inc. Volcanic, Metropolis and Hierarchical Voronoi) - Google Maps Earth mode - Lots of Chrome experiments - madebyevan.com/webgl-water BUG=524297 Change-Id: Iaa727036fffcfde3952716a1ef33b6ee0546b69d Reviewed-on: https://chromium-review.googlesource.com/296442 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Corentin Wallez <cwallez@chromium.org>
Corentin Wallez 11865105 2015-08-27T17:55:17 angle_unittests add forgotten VariablePacker test. Also add a warning on top of the UnrollFlatten test that it works only when HLSL is enabled. BUG=angleproject:1140 Change-Id: Ide961bbed70dc9ed2a604f13273e4209b1dec29b Reviewed-on: https://chromium-review.googlesource.com/295125 Reviewed-by: Zhenyao Mo <zmo@chromium.org> Tested-by: Corentin Wallez <cwallez@chromium.org>
Cooper Partin 4d61f7ed 2015-08-12T10:56:50 Reland Fixed compiler warning C4267 'conversion from 'size_t' to 'type', possible loss of data' Additional warnings found with more testing and added C4267 warning disable only for angle_libpng BUG=angleproject:1120 Change-Id: Ic403dcff5a8018056fa51a8c408e64207f3362eb Reviewed-on: https://chromium-review.googlesource.com/293028 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Olli Etuaho 7adfb184 2015-06-09T15:49:41 Refactor common compiler test functionality into helper functions Refactor translating a ESSL shader string into a target language so that compiler initialization and cleanup code can be reused between test classes. BUG=angleproject:817 TEST=angle_unittests Change-Id: Idb229dceb9e17b13ed6ad2a68ab55ed5c968780e Reviewed-on: https://chromium-review.googlesource.com/275814 Tested-by: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Corentin Wallez a1884f2b 2015-04-29T10:15:16 Fixes for the tagging of discontinuous loops The first fix was for all loops being considered discontinuous in OutputHLSL because of a typo that produced a tautology. The error was not detected by the unit tests because as an optimization we do not generate Lod0 calls when they are not needed for the callee function (which was correctly detected by the analysis in this case). Fixed the unit tests by adding a call to a builtin gradient operation. The second fix was for discard not being taken into account in the analyses of the AST, which caused a WebGL test regression after the first fix for conformance/glsl/bugs/conditional-discard-in-loop BUG=angleproject:982 Change-Id: I1315eac1ad36f726be52d7fda5facf3104341b1f Reviewed-on: https://chromium-review.googlesource.com/267814 Tested-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Corentin Wallez 1239ee94 2015-03-19T14:38:02 Use the AST analyses to narrow the usage of [[loop]] and [[unroll]] These attributes are now used exactly in the loops and ifs that require them, limiting the number of failed compilations due to excessive unrolling and flattening. Also output Lod0 functions only when needed. Adds unit tests for LOOP, FLATTEN and Lod0 generation. The patch was tested against the WebGL CTS 1.0.4 for which all the failures existed prior to this patch and seem to be unrelated to this change. It also works correctly on the following sites that had trouble with [[loop]] and [[unroll]]: * dev.miaumiau.cat/rayTracer "Skull Demo" * The turbulenz engine particle demo * Lots of ShaderToy samples (including "Volcanic" and "Metropolis") * Google Maps Earth mode * Lots of Chrome Experiments * Lagoa * madebyevan.com/webgl-water * SketchFab * Unit Tests BUG=angleproject:937 BUG=395048 Change-Id: I856de9025f10b79781929ec212dbffc2064a940e Reviewed-on: https://chromium-review.googlesource.com/264791 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Corentin Wallez <cwallez@chromium.org>
Corentin Wallez 938f0029 2015-04-08T19:35:40 Revert "Use the AST analyses to narrow the usage of [[loop]] and [[unroll]]" Caused linking failures on mac because the unit test asks for TranslatorHLSL which is not compiled. This reverts commit 3342e01f2a29343ea95961f0194f9d4f422cb840. Change-Id: I02b2f54ca5b90611f11b7a549e75bf2e8310639d Reviewed-on: https://chromium-review.googlesource.com/264790 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Tested-by: Corentin Wallez <cwallez@chromium.org>
Corentin Wallez 3342e01f 2015-03-19T14:38:02 Use the AST analyses to narrow the usage of [[loop]] and [[unroll]] These attributes are now used exactly in the loops and ifs that require them, limiting the number of failed compilations due to excessive unrolling and flattening. Also output Lod0 functions only when needed. Adds unit tests for LOOP, FLATTEN and Lod0 generation. The patch was tested against the WebGL CTS 1.0.4 for which all the failures existed prior to this patch and seem to be unrelated to this change. It also works correctly on the following sites that had trouble with [[loop]] and [[unroll]]: * dev.miaumiau.cat/rayTracer "Skull Demo" * The turbulenz engine particle demo * Lots of ShaderToy samples (including "Volcanic" and "Metropolis") * Google Maps Earth mode * Lots of Chrome Experiments * Lagoa * madebyevan.com/webgl-water * SketchFab * Unit Tests BUG=angleproject:937 BUG=395048 Change-Id: If7baddae1cdae0b3a414aa49e5a4c4babedbfe50 Reviewed-on: https://chromium-review.googlesource.com/261263 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Tested-by: Corentin Wallez <cwallez@chromium.org>