src/tests/compiler_tests/ShaderVariable_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>
Brandon Schade 91b383e8 2022-01-27T10:22:17 Translator: Emit warning when identifier has double underscores OpenGL ES Shader Language 3.2 specification states that two consecutive underscores (__) are reserved. It doesn't result in an error if used but could result in unintended behavior. Update the translator accordingly. Bug: angleproject:6577 Tests: ShaderVariableTest.DoubleUnderscores* Change-Id: Ice7e0eca4f770400061f4b8f7f65106cb1926f1a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3421411 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Brandon Schade <b.schade@samsung.com>
Shahbaz Youssefi bb3adfa4 2020-12-01T15:43:13 Rename ShaderVariable::structName to structOrBlockName Bug: angleproject:3580 Change-Id: Ic53a5267972f153dad2e20948e493e9767a45d16 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2568247 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tim Van Patten 90a58622 2019-09-04T15:39:58 Refactor ShaderVariable to Remove Specializations The following structs are being refactored and moved into the parent struct ShaderVariable: VariableWithLocation Uniform Attribute OutputVariable InterfaceBlockField Varying Bug: angleproject:3899 Test: CQ Change-Id: I389eb3ab4ed44a360e09fca75ecc78d64a277f83 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1785877 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com> Commit-Queue: Tim Van Patten <timvp@google.com>
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>
Frank Henigman 0e74e059 2017-12-17T22:17:17 Fix gcc builds. Remove unused function and fix dangling else's that gcc complains about. In the gyp build specify -std=c++14. BUG=none Change-Id: I552942ccc574104a5424a9add00e6e72d6efa28a Reviewed-on: https://chromium-review.googlesource.com/830750 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Olli Etuaho 465835d6 2017-09-26T13:34:10 Support arrays of arrays in the API The ShaderVariable class that is used as an interface between the compiler and the rest of the code gets arrays of arrays support. Array of array variables are passed from the compiler just like any other variables. However, when stored in Program state each innermost array constitutes a separate variable. This is done to make the implementation match the GLES specification for program interface query APIs. This will be tested more fully once support for parsing arrays of arrays lands in the compiler. TEST=angle_end2end_tests, angle_unittests BUG=angleproject:2125 Change-Id: I0f7159000f039be92a87a52b3b68cd9a215a21cb Reviewed-on: https://chromium-review.googlesource.com/684742 Commit-Queue: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Olli Etuaho 7caa80e7 2017-11-14T15:03:14 Edit tests to reference temporary variables The shader translator is intended to prune unreferenced variables in the future. To maintain test coverage when this is done, most tests that used to have unreferenced GLSL locals and globals are edited to use built-ins or reference the necessary variables instead. BUG=angleproject:2166 TEST=angle_unittests, angle_end2end_tests Change-Id: I3964e7a80d52fc04a95f57e73da6095e433095e8 Reviewed-on: https://chromium-review.googlesource.com/768740 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Olli Etuaho e7c2857d 2017-10-23T16:29:33 Clean up direct access of ShaderVariable::arraySize This change is pure refactoring. It's intended to help with adding support for arrays of arrays. BUG=angleproject:2125 TEST=angle_unittests Change-Id: I82881a98c3c476fd6666a551ce6be255ae0de4cf Reviewed-on: https://chromium-review.googlesource.com/733127 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Jiawei Shao 4cc89e2b 2017-08-31T14:25:54 ES31: Enable 'location' layout qualifier on shader interfaces in compiler This patch enables 'location' layout qualifier for vertex outputs and fragment shader inputs when the shader version is 3.1 in ANGLE GLSL compiler and adds the check on location conflicts for these varyings. According to GLSL ES 3.1 SPEC (Chapter 4.4.1 and Chapter 4.4.2), 'location' layout qualifier is allowed on both inputs and outputs of vertex and fragment shaders. 'location' layout qualifier on shader interfaces is only valid on shaders whose version is 3.1 and above. According to GLSL ES 3.0 SPEC, vertex shader cannot have output layout qualifiers (Chapter 4.3.8.2) and fragment shader cannot have input layout qualifiers (Chapter 4.3.8.1). The 'location' qualifier on varyings is used in the shader interface matching defined in OpenGL ES 3.1. (OpenGL ES 3.1 SPEC Chapter 7.4.1). This new link rule will be added to Program.cpp in another patch. For the OpenGL ES 3.1 extension GL_OES_geometry_shader, according to GL_OES_shader_io_blocks SPEC (Chapter 4.4.1 and Chapter 4.4.2), 'location' layout qualifier is both valid on geometry shader inputs and outputs. This feature will be implemented together with other rules on geometry shader inputs and outputs. BUG=angleproject:2144 TEST=angle_unittests Change-Id: I62d85f7144c177448321c2db36ed7aaeaa1fb205 Reviewed-on: https://chromium-review.googlesource.com/645366 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jiawei-Shao df7d7c9e 2017-07-31T09:34:04 Split varyings into input and output varyings in compiler This patch intends to split all vector<Varying> into two vectors to store input and output varyings separately in the compiler. This patch is a base of implementing the built-ins, inputs and outputs of a geometry shader to ANGLE GLSL compiler. Unlike the vertex shaders (their outputs are varyings) and fragment shaders (their inputs are varyings), the inputs and outputs of geometry shaders are all varyings, so we need two vector<Varying> to store them correctly. BUG=angleproject:1941 Change-Id: I9e8cc16045d5e29e9a80a09dc31b33a7ae39b345 Reviewed-on: https://chromium-review.googlesource.com/593347 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Kenneth Russell 1d72298b 2017-06-27T14:36:03 Fix memory leaks in invariant tests. Tests weren't properly destroying the compiler instance. BUG=angleproject:2094 Change-Id: I65eb5a02ba741c6f48f09f03b84ded402581e89f Reviewed-on: https://chromium-review.googlesource.com/550569 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Kenneth Russell <kbr@chromium.org>
Jamie Madill acb4b81a 2016-11-07T13:50:29 translator: Put ShaderLang APIs in "sh" namespace. Working with glslang in Vulkan means we are static linking libANGLE with functions that have the same name as our translator APIs. We can fix this by scoping our APIs. We don't need to scope the types of the file, since they don't conflict. This will require a follow-up patch to remove the unscoped APIs once we switch over Chromium. We also scope TCompiler and some related classes to avoid multiply defined link errors with glslang. BUG=angleproject:1576 Change-Id: I729b19467d2ff7d374a82044b16dbebdf2dc8f16 Reviewed-on: https://chromium-review.googlesource.com/408337 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Qiankun Miao f69682be 2016-08-16T14:50:42 Add unittests to verify invariant doesn't leak This is a followup CL of https://chromium-review.googlesource.com/366720. Unittests is added to check invariant status does not leak across shaders. This CL also moves mInvariantVaryings and mGlobalInvariant from TSymbolTable to TSymbolTableLevel. So at the end of a compilation, the levels pop, and the settings will be cleared and will not affect the next compilation. Change-Id: I1199fade7a637276ab149ab9a599621b9977298b Reviewed-on: https://chromium-review.googlesource.com/370844 Commit-Queue: Zhenyao Mo <zmo@chromium.org> Reviewed-by: Zhenyao Mo <zmo@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org>
Kenneth Russell add0ef14 2015-12-17T15:43:31 Remove deprecated ShShaderOutput versions. These aren't referenced from Chromium code any more. BUG=chromium:550487 Change-Id: Ie4094667ec5f739efd9f1253ffdb779deaf3cebc Reviewed-on: https://chromium-review.googlesource.com/319162 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Kenneth Russell <kbr@chromium.org>
Olli Etuaho 37ad4744 2015-04-27T13:18:50 Add support for parsing ESSL3 invariant qualifiers The parser recognizes ESSL3 invariant variable declaration syntax and marks the variables as invariant. In ESSL3, invariant out variables can be linked to non-invariant in variables, so linking checks should now be different depending on shading language version. A shading language version dependent varying matching check is added to the translator API to facilitate this. Tested by deqp/data/gles3/shaders/qualification_order.html after patching Chrome to use the new linking check API. A previous revision of this change that broke API compatibility was reverted since it broke Chromium FYI bots. This revision keeps deprecated API functionality around for now so that changes can be rolled step-by-step to Chromium without breakage. TEST=WebGL 2 conformance tests, angle_unittests BUG=angleproject:987 Change-Id: Iecb64e3afd23e267ba999bc17f44390affcdfc13 Reviewed-on: https://chromium-review.googlesource.com/269940 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Jamie Madill 9e64edce 2015-05-07T14:08:06 Revert "Add support for parsing ESSL3 invariant qualifiers" Build breaks in GPU FYI bots. BUG=angleproject:987 This reverts commit 4008879357159c7850cf105f2ae842bc68dd3c18. Change-Id: Ia88ad302c403c65516c050eb7741316b5097bcfb Reviewed-on: https://chromium-review.googlesource.com/269847 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Olli Etuaho 40088793 2015-04-27T13:18:50 Add support for parsing ESSL3 invariant qualifiers The parser recognizes ESSL3 invariant variable declaration syntax and marks the variables as invariant. In ESSL3, invariant out variables can be linked to non-invariant in variables, so linking checks should now be different depending on shading language version. The varying matching check in the translator API is changed to be shading language version dependent to facilitate this. Tested by deqp/data/gles3/shaders/qualification_order.html after patching Chrome to use the new linking check API. TEST=WebGL 2 conformance tests, angle_unittests BUG=angleproject:987 Change-Id: I3982feff7380c4dfc647940ee03a020692dd0c59 Reviewed-on: https://chromium-review.googlesource.com/267663 Reviewed-by: Olli Etuaho <oetuaho@nvidia.com> Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Jamie Madill 559a2e8c 2015-03-16T17:25:51 Move the ANGLE tests project to src/ *re-re-land with fix for Chrome's angle tests* BUG=angleproject:945 Change-Id: I3c64e2edc776c299791440f65f22450855eb6dfa Reviewed-on: https://chromium-review.googlesource.com/260448 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill 96e3f556 2015-03-16T21:24:20 Revert "Move the ANGLE tests project to src/" Still causing build issues on Chrome. This reverts commit 64a3b2a92fe3bbd28972638e6759fae0b98d81b9. Change-Id: I8d40fe3dfd0a877343357153a02b8ef66d571c64 Reviewed-on: https://chromium-review.googlesource.com/260425 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 64a3b2a9 2015-03-16T11:00:20 Move the ANGLE tests project to src/ *re-land with fix for Chromium build* BUG=angleproject:945 Change-Id: I82bff1760e681987fb26e479734aa62fb845898a Reviewed-on: https://chromium-review.googlesource.com/260362 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill 5491fe66 2015-03-16T17:56:18 Revert "Move the ANGLE tests project to src/" Causing build break in Chromium. This reverts commit 71c2d85c4af2f6cb213d4f3e15f0ae16b63790f3. Change-Id: Iedf001c1f4c60a759f69009610fbce978d193d17 Reviewed-on: https://chromium-review.googlesource.com/260370 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 71c2d85c 2015-03-16T10:47:04 Move the ANGLE tests project to src/ BUG=angleproject:945 Change-Id: I2eb44ac43f65b916ddd838d39e6aae62580d7fa0 Reviewed-on: https://chromium-review.googlesource.com/258903 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Brandon Jones <bajones@chromium.org>