src/compiler/translator/CodeGen.cpp


Log

Author Commit Date CI Message
Kyle Piddington d7aa0130 2021-04-26T16:56:15 Upstream Apple's direct-to-Metal backend: compile translator. This change is meant to merge the translator changes from Apple's direct-to-Metal backend. Taken from Kyle Piddington's CL: https://chromium-review.googlesource.com/c/angle/angle/+/2857366/ The goal of this CL is to merge the translator code in a state that compiles, but not to switch the Metal backend over to use this translator backend yet. Bug: angleproject:5505 Change-Id: I68a6354604498cd5fd1eb96c13fc56f3b38f2bd0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2897536 Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Commit-Queue: Jonah Ryan-Davis <jonahr@google.com>
Le Quyen d200a77a 2019-10-10T00:44:01 Metal backend skeleton implementation. Bug: angleproject:2634 Change-Id: I34be82f4a80a6851fecb53a51e069b134d82613a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1849079 Commit-Queue: Le Hoang Quyen <le.hoang.q@gmail.com> Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@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>
Martin Radev e469de8a 2017-07-04T11:58:35 Refactor translator construction The patch adds functionality to determine whether compiler output belongs to the ESSL, GLSL, HLSL or Vulkan output family. The new functions can be now used in other parts of the compiler in which code paths are selected based on the compiler output. BUG=angleproject:2062 TEST=angle_unittests Change-Id: I45ccf63f0a756c60df47a679c2da9f60856d5918 Reviewed-on: https://chromium-review.googlesource.com/558990 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Olli Etuaho <oetuaho@nvidia.com> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Jamie Madill e794cd86 2017-01-13T17:29:51 Vulkan: Implement new GLSL translator back-end. The Vulkan GLSL translator back-end will handle validating and translating our WebGL/ESSL shaders into Vulkan-specific GLSL. glslang (the Vulkan one) accepts both GLSL and GLSL ES shaders as inputs, and both the desktop and ESSL back-ends give incompleteness warnings when used. For now, use the desktop GL 450 as a target for Vulkan GLSL. The Vulkan-specific changes are currently only to add locations to every vertex input and fragment output. BUG=angleproject:1575 Change-Id: I7c3f32f522e9d18e5f8618eb7927336bf4fbdcf2 Reviewed-on: https://chromium-review.googlesource.com/412266 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill e09bd5d3 2016-11-29T16:20:35 Vulkan: Add display creation, test and extension. With this CL we have the ability to create Vulkan test configs and run basic tests, although the only thing that works is creating a Vulkan Renderer using the extension. BUG=angleproject:1319 Change-Id: I8ad17bba01241334be7da16e68fea38762ca6a20 Reviewed-on: https://chromium-review.googlesource.com/367750 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Jamie Madill 80bfe0f4 2016-11-07T13:50:31 translator: Fix style in CodeGen.cpp. BUG=None Change-Id: I321ec7af6779c6524b83959da21520a4fb09d8e2 Reviewed-on: https://chromium-review.googlesource.com/408317 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@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>
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>
Austin Kinross 82b5ab60 2015-12-11T09:30:15 Compile out GLSL/ESSL translator output code if it's not needed In WinRT we only use the HLSL code, so the GLSL/ESSL output code is not necessary and is only adding to our binary size. BUG=angleproject:1250 Change-Id: I9363ca3981bde50a230f8353c1bcc09f6ea209cb Reviewed-on: https://chromium-review.googlesource.com/317358 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Tryjob-Request: Austin Kinross <aukinros@microsoft.com> Tested-by: Austin Kinross <aukinros@microsoft.com>
Corentin Wallez 700ad289 2015-12-07T15:57:47 Don't crash when calling ShConstructCompiler with a wrong output BUG=angleproject:446 Change-Id: Ic1c326f79105950e5c3eb8724eba12fca187a2ec Reviewed-on: https://chromium-review.googlesource.com/316610 Tryjob-Request: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Corentin Wallez <cwallez@chromium.org>
Geoff Lang 8273e006 2015-06-15T13:40:19 Add new GLSL target versions. Test the emulated GLSL functions against multiple GL versions. BUG=angleproject:1044 Change-Id: I1e12523301042f0d541ab2f4e73f02319d1584ef Reviewed-on: https://chromium-review.googlesource.com/277702 Reviewed-by: Zhenyao Mo <zmo@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Qingqing Deng ad0d0799 2015-04-08T14:25:06 Expand ShShaderOutput for different GLSL versions BUG=angleproject:968 Change-Id: I2d4c0a8e9a91a940922da4501c22124da0c0399c Reviewed-on: https://chromium-review.googlesource.com/264840 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Olli Etuaho <oetuaho@nvidia.com> Tested-by: Jamie Madill <jmadill@chromium.org>
Zhenyao Mo 05b6b7fc 2015-03-02T17:08:09 Add an SH_GLSL_CORE_OUTPUT profile. So we could generate shaders for Apple using core GL profile. By switching to core profile, we still pass most WebGL conformance tests 1.0.2 on Linux, but not all, so apparently more work is needed. However, I think it's OK to check this CL in because this output profile will be only used behind a chromium switch. BUG=angleproject:933 TEST=webgl conformance tests Change-Id: Iad70e1aebf82349d3fc5f4116c1d6bc4448193fd Reviewed-on: https://chromium-review.googlesource.com/255282 Tested-by: Zhenyao Mo <zmo@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Daniel Bratell 73941deb 2015-02-25T14:34:49 Disable the HLSL code in Angle if it is not being used. We're only using the HLSL code in Windows so it's not necessary to compile and distribute it on other platforms. This adds a defined ANGLE_ENABLE_HLSL that can be checked in files that are used by non-HLSL code as well. Mostly the HLSL code is just not include by the build system. Details of the space savings (heavily truncated) Total change: -165717 bytes =========================== -606 - Source: angle/src/common/utilities.cpp -627 - Source: angle/src/compiler/translator/FlagStd140Structs.cpp -695 - Source: /usr/include/c++/4.8/bits/stl_algo.h -710 - Source: angle/src/compiler/translator/TranslatorHLSL.cpp -713 - Source: angle/src/compiler/translator/IntermNode.h -863 - Source: /usr/include/c++/4.8/bits/stl_map.h -935 - Source: angle/src/compiler/translator/blocklayout.cpp -1515 - Source: angle/src/compiler/translator/BuiltInFunctionEmulator.cpp -1655 - Source: angle/src/compiler/translator/UnfoldShortCircuit.cpp -2375 - Source: /usr/include/c++/4.8/bits/vector.tcc -3135 - Source: angle/src/compiler/translator/RewriteElseBlocks.cpp -4656 - Source: angle/src/compiler/translator/UtilsHLSL.cpp -5265 - Source: angle/src/compiler/translator/BuiltInFunctionEmulatorHLSL.cpp -6505 - Source: /usr/include/c++/4.8/bits/stl_tree.h -11480 - Source: angle/src/compiler/translator/UniformHLSL.cpp -13580 - Source: angle/src/compiler/translator/StructureHLSL.cpp -18964 - Source: ?? (constant strings and a few vtbls) -89332 - Source: angle/src/compiler/translator/OutputHLSL.cpp Change-Id: I23ccc98abd0a21f847dd34f9482800b3ba679d56 Reviewed-on: https://chromium-review.googlesource.com/251528 Tested-by: bratell at Opera <bratell@opera.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 183bde55 2014-07-02T15:31:19 Return shader variable information using GLenum values. Instead of duplicating GL header define values, explictly return GLenum for variable queries in the shader inspection API. This reduces the duplicate defines in the shader compiler header. BUG=angle:466 Change-Id: Iddaaff597b188251fa2e546f352bf77ab3ac43bc Reviewed-on: https://chromium-review.googlesource.com/205860 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Zhenyao Mo <zmo@chromium.org> Reviewed-by: Nicolas Capens <capn@chromium.org>
Jamie Madill ce505553 2014-06-26T14:56:33 Revert "Return variable type queries using GLenum values." Breaks the FYI bots until we get Chromium patched. BUG=angle:466 This reverts commit 53221f5a0382887155d90f7f286e41190d4f5bfb. Change-Id: Ib28548df5c10a6f76f46e4cf8f2013dca5cf0ee2 Reviewed-on: https://chromium-review.googlesource.com/205850 Reviewed-by: Shannon Woods <shannonwoods@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 53221f5a 2014-06-25T16:04:59 Return variable type queries using GLenum values. Instead of duplicating GL header define values, explictly return GLenum for variable queries in the shader inspection API. This reduces the duplicate defines in the shader compiler header. BUG=angle:466 Change-Id: If631b20ce68747297a946e1371def7709027a613 Reviewed-on: https://chromium-review.googlesource.com/204937 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Nicolas Capens <nicolascapens@chromium.org> Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Geoff Lang 2b6008c9 2013-10-08T10:44:05 Merge 366229430ea056cf7f33917a4fa37b721512a42c from master. Create a static translator project and allow the previous translator project to be used in component builds.