src/compiler/translator/DirectiveHandler.cpp


Log

Author Commit Date CI Message
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>
Geoff Lang 197d5294 2018-04-25T14:29:00 Wrap all preprocessor code in the angle namespace. BUG=836820 BUG=801364 Change-Id: I08b6a2f9f12b689e09df6efd916c313e71e8a051 Reviewed-on: https://chromium-review.googlesource.com/1028581 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Olli Etuaho 2a1e8f95 2017-07-14T11:49:36 Refer to GLSL extensions through TExtension enum Extensions are now referred to by enum values instead of strings most of the time. This gets rid of unnecessary copying of strings. The code is easier to work with than before as typoing the extension enum names will be caught by the compiler. BUG=angleproject:2147 TEST=angle_unittests Change-Id: Ifa61b9f86ef03211188fc23bc23a5ce4e4d8c390 Reviewed-on: https://chromium-review.googlesource.com/571002 Commit-Queue: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Olli Etuaho 77ba408a 2016-12-16T12:01:18 Unify Diagnostics interface Use the same kind of interface for reporting preprocessor errors as for reporting regular compiler errors, and make global errors like having too many uniforms also go through Diagnostics. Also don't create std::string objects unnecessarily. Includes cleanups of some dead code related to reporting errors. BUG=angleproject:1670 TEST=angle_unittests Change-Id: I3ee794d32ddeec1826bdf1b76b558f35259f82c0 Reviewed-on: https://chromium-review.googlesource.com/421527 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Olli Etuaho 4de340ac 2016-12-16T09:32:03 Remove extraInfo parameter from compiler diagnostic functions This makes error messages more consistent. It was not clear what was supposed to go to the extraInfo parameter, and previously it was mostly being misused, resulting in poorly formatted error messages. Sometimes the order of parameters to the diagnostic functions like error() and warning() was wrong altogether. The diagnostics API is simpler when there's only the "reason" and "token" parameters that have clear meaning and that are separated by consistent punctuation in the output. Fixes error messages like "redifinition interface block member" to be grammatically reasonable like the rest of the error messages. For other error messages, punctuation is added to make them clearer. Example: "invalid layout qualifier location requires an argument" is changed to "invalid layout qualifier: location requires an argument". Extra spaces are also removed from the beginning of error messages. BUG=angleproject:1670 BUG=angleproject:911 TEST=angle_unittests Change-Id: Id5fb1a1f2892fad2b796aaef47ffb07e9d79759c Reviewed-on: https://chromium-review.googlesource.com/420789 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Jamie Madill d7b1ab58 2016-12-12T14:42:19 Fix up translator style. Using git cl format. BUG=angleproject:650 Change-Id: I7d3f98d2b0dcfb0a8de6c35327db74e55c28d761 Reviewed-on: https://chromium-review.googlesource.com/419059 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@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>
Martin Radev 1be913cf 2016-07-11T17:59:16 Add support for ES31 context creation The dEQP test for context creation passes. SH_WEBGL3_SPEC has been added, but it should be considered whether we should keep it, remove it or rename it. It was added so that there is a webgl mapping to es 310 shaders. Check Compiler.cpp. The bison file has been modified so that some tokens from es3 can be also used in es31 as well. A separate macro ES3_1_ONLY is added so that some tokens are limited only for es 310 shaders. BUG=angleproject:1442 TEST=angle_unittests Change-Id: I2e5ca227c96046c30dc796ab934f3fda9c533eba Reviewed-on: https://chromium-review.googlesource.com/360300 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Olli Etuaho 5f80d016 2016-01-11T11:16:01 Disallow invariant(all) pragma in ESSL 3.00 fragment shaders ESSL 3.00.4 section 4.6.1 says that using #pragma STDGL invariant(all) in a fragment shader is an error, so make it an error. This spec language is not found in ESSL 1.00, and it's been removed in ESSL 3.10. BUG=angleproject:1276 TEST=angle_unittests Change-Id: I2022f35475f867304b55dfb142f8568f6df28830 Reviewed-on: https://chromium-review.googlesource.com/321240 Tryjob-Request: Olli Etuaho <oetuaho@nvidia.com> Tested-by: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Zhenyao Mo <zmo@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org>
Olli Etuaho 391befef 2015-08-12T16:30:38 Revert "Add pragma errors for malformed pragmas." Since this commit was made, dEQP tests were fixed to check that unrecognized pragma tokens only generate warnings, not errors. This applies to both ESSL1.00 and ESSL3.00, which specify this behavior in section 3.4 Preprocessor. BUG=angleproject:989 TEST=dEQP-GLES2.functional.shaders.preprocessor.pragmas.* This reverts commit d3c29f57aaeb451b149bbb9fd17b3f1f99101c52. Change-Id: Ie4e0ec061fa3164d6f3872ac0016a063056ed110 Reviewed-on: https://chromium-review.googlesource.com/293181 Tested-by: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang d3c29f57 2015-04-28T11:23:02 Add pragma errors for malformed pragmas. Instead of always warning on invalid pragmas, only warn when the pragma type is not recognized and error when the syntax is invalid. Fixes: dEQP-GLES2.functional.shaders.preprocessor.pragmas.invalid_pragma_invalid_debug_vertex dEQP-GLES2.functional.shaders.preprocessor.pragmas.invalid_pragma_invalid_debug_fragment dEQP-GLES2.functional.shaders.preprocessor.pragmas.invalid_pragma_invalid_token_vertex dEQP-GLES2.functional.shaders.preprocessor.pragmas.invalid_pragma_invalid_token_fragment BUG=angleproject:989 Change-Id: Ibd584dc08a2436e163dfc52eeffdf2dac8a22cb8 Reviewed-on: https://chromium-review.googlesource.com/267639 Reviewed-by: Zhenyao Mo <zmo@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Olli Etuaho d57e0db3 2015-04-24T15:05:08 Remove separate compilerdebug.h in favor of debug.h This unifies the behavior across the compiler and rest of ANGLE - for example, one can use #define ANGLE_TEST_CONFIG to disable UNIMPLEMENTED asserts in both the compiler and the rest of ANGLE. Compiler traces from asserts also go to the same TRACE_OUTPUT_FILE as other traces instead of being directed through ParseContext. The compiler build already includes the common sources, so no changes to build config are needed. The original version of this change was reverted due to release mode build issues. This version adds UNUSED_ASSERTION_VARIABLE where needed. TEST=angle_unittests, angle_end2end_tests, dEQP-GLES3.functional.shaders.* BUG=angleproject:983 Change-Id: I36929020a04251b8bc834fbb3c069e10128c3082 Reviewed-on: https://chromium-review.googlesource.com/267411 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Olli Etuaho <oetuaho@nvidia.com> Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Jamie Madill a656490d 2015-04-27T14:30:32 Revert "Remove separate compilerdebug.h in favor of debug.h" Causing compile warnings in Release: 1>compiler\translator\CallDAG.cpp(238): error C2220: warning treated as error - no 'object' file generated 1>compiler\translator\CallDAG.cpp(238): warning C4189: 'op' : local variable is initialized but not referenced 1>compiler\translator\IntermNode.cpp(1495): error C2220: warning treated as error - no 'object' file generated 1>compiler\translator\IntermNode.cpp(1495): warning C4189: 'replaced' : local variable is initialized but not referenced 1>compiler\translator\IntermNode.cpp(1517): warning C4189: 'replaced' : local variable is initialized but not referenced This reverts commit 5271025865b34685da71d0309131c5aff2e32f71. Change-Id: Icdf1c37eef22a13d083767609ab0b0285d3dc517 Reviewed-on: https://chromium-review.googlesource.com/267359 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Olli Etuaho 52710258 2015-04-24T15:05:08 Remove separate compilerdebug.h in favor of debug.h This unifies the behavior across the compiler and rest of ANGLE - for example, one can use #define ANGLE_TEST_CONFIG to disable UNIMPLEMENTED asserts in both the compiler and the rest of ANGLE. Compiler traces from asserts also go to the same TRACE_OUTPUT_FILE as other traces instead of being directed through ParseContext. The compiler build already includes the common sources, so no changes to build config are needed. TEST=angle_unittests, angle_end2end_tests, dEQP-GLES3.functional.shaders.* BUG=angleproject:983 Change-Id: Ifca4d16f667b1e5cf9c2e7cc4139940091917a1c Reviewed-on: https://chromium-review.googlesource.com/266993 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Zhenyao Mo <zmo@chromium.org> Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Olli Etuaho 853dc1ab 2014-11-06T17:25:48 Add mediump and lowp precision emulation support for GLSL output This implements the rounding as specified in WEBGL_debug_shader_precision extension proposal for desktop GLSL and ESSL output. The bulk of the new functionality is added in the form of a new EmulatePrecision AST traverser, which inserts calls to the rounding routines angle_frm and angle_frl in the appropriate places, and writes the rounding routines themselves to the shader. Compound assignments which are subject to emulation are transformed from "x op= y" to "angle_compound_op_frm(x, y)", a call to a function which does the appropriate rounding and places the result of the operation to x. The angle_ prefixed names should not clash with user-defined names if name hashing is on. If name hashing is not on, the precision emulation can only be used if the angle_ prefix is reserved for use by ANGLE. To support the rounding routines in output, a new operator type is added for internal helper function calls, which are not subject to name hashing. In ESSL output, all variables are forced to highp when precision emulation is on to ensure consistency with how precision emulation performs on desktop. Comprehensive tests for the added code generation are included. BUG=angle:787 Change-Id: I0d0ad9327888f803a32e79b64b08763c654c913b Reviewed-on: https://chromium-review.googlesource.com/229631 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Zhenyao Mo 94ac7b78 2014-10-15T18:22:08 Invariant related processing. * Fix a bug in PreProcessor for STDGL pragma. * Record all invariant settings and set them in ShaderVariable. * Write #pragma STDGL invariant(all) in GL BUG=angle:776 TEST=https://www.khronos.org/registry/webgl/sdk/tests/conformance/glsl/misc/shaders-with-invariance.html Change-Id: Ie28b75480deed79f0c9f26e3b98f1778d1290182 Reviewed-on: https://chromium-review.googlesource.com/223610 Tested-by: Zhenyao Mo <zmo@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Shannon Woods 7f2d7945 2013-11-19T15:07:58 Manual merge of Ehsan Akhgari's patch to rename Diagnostics enums to avoid collision with Windows.h (See https://chromium-review.googlesource.com/#/c/177181/3) Change-Id: I2978d06ec96789b3ee1696b65a84c2a9f31f7ba4
Geoff Lang 17732823 2013-08-29T13:46:49 Moved the compiler source files into directories based on their project and added a compiler.gypi to generate the compiler projects.