src/tests/compiler_tests/ShaderValidation_test.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 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>
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>
Nicolas Capens 07c03b6d 2020-09-11T14:43:37 Validate GLSL attribute location range The location index of a vertex shader input's layout qualifier must be less than GL_MAX_VERTEX_ATTRIBS to link successfully. We can check for this during shader compilation to not rely on other layers to handle pathological cases. While strictly speaking only 'active' attributes are considered during shader linking, this is merely intended to allow for 'uber' shaders to declare more inputs than GL_MAX_VERTEX_ATTRIBS but only use a subset of them. There is no known reasonable use case for a manually specified location to exceed the valid range. Note that according to http://opengl.gpuinfo.org, the highest GL_MAX_VERTEX_ATTRIBS value at the time of writing is 32. Also, D3D12_VS_INPUT_REGISTER_COUNT = 32. Hence the unit test's value of 1000 should be sufficiently future proof. Also address the case where the uniform location might be close to INT_MAX and not be detected as out-of-range due to numeric overflow. Bug: chromium:1110800 Change-Id: I9985c8eab3bb8a2a59b8f985e8f5b6884756383c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2405368 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Nicolas Capens <capn@chromium.org>
Shahbaz Youssefi 2d1d9d35 2020-01-27T12:09:41 Fix atomicAdd validation w.r.t to swizzles Bug: angleproject:4150 Change-Id: I22c0c0382a2b208dd983fa1981ffc75f1b1945e9 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2022359 Reviewed-by: Ian Elliott <ianelliott@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 230e14dd 2020-01-21T23:32:06 Add support for layout(early_fragment_tests) in; Bug: angleproject:4314 Change-Id: I37b228f37201cc4188834e68459cd7294727c3ac Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2014240 Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi e181f2f7 2019-12-10T22:57:42 Validate that image array indices are constant Also adds compiler tests for dynamic indexing of SSBOs and images. Bug: angleproject:3569 Change-Id: I84b90813840ffad5a9a3cd8e7f12bd637a57b327 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1961095 Reviewed-by: Jiajia Qin <jiajia.qin@intel.com> Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Jiajie Hu a2f89c00 2019-10-12T13:40:03 Add sampler array index validation for ESSL 3.00 onwards In Section 12.30 of the ESSL 3.00 spec on p143-144: Indexing of arrays of samplers by constant-index-expressions is supported in GLSL ES 1.00. A constant-index-expression is an expression formed from constant-expressions and certain loop indices, defined for a subset of loop constructs. Should this functionality be included in GLSL ES 3.00? RESOLUTION: No. Arrays of samplers may only be indexed by constant- integral-expressions. Bug: chromium:985032 Change-Id: Iad9e4b8000b442a6631e1d2295c2670c4a79d486 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1849452 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@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>
Ian Elliott fab397e5 2019-07-25T10:18:50 Vulkan: Enforce an error when initializing a global with a non-const The ESSL 1.0 spec is clear that "initializers must be a constant expression." Yet, because of "legacy" applications (apparently just WebGL applications), the code was only issuing a warning and not an error. The "KHR-GLES2.shaders.negative.initialize" test requires an error be generated. This change splits the semantics, allowing GLES applications to get an error, and WebGL applications to get a warning. Note: This change is related to https://chromium-review.googlesource.com/829138 (for angleproject:2285). Bug: angleproject:3381 Change-Id: Ie243b7dd72102aeb52df506d121d1d2a8f6974d3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1716617 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Ian Elliott <ianelliott@google.com>
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>
Olli Etuaho 5476e805 2018-10-05T13:23:03 Fix constructing void array zero nodes Correctly sized void arrays can be needed after parsing has recovered from an error and the code is trying to evaluate the constant value of a node. Since now we just have a generic EOpConstruct op instead of different ops for different types, we can simply remove the special handling for void arrays in CreateZeroNode to create the arrays in the correct size. BUG=chromium:890581 TEST=angle_unittests Change-Id: I48d96c9ef1d695cd8583a845fd4bd24a7aaf535c Reviewed-on: https://chromium-review.googlesource.com/c/1264515 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Olli Etuaho 1dfd8ae2 2018-10-01T15:59:59 Improve test coverage of constant folding Clean up some TODOs in the code as well as add tests to make sure that ANGLE treats expressions indexing into constant arrays as constant expressions in different contexts. This complements the existing tests in ConstantFoldingTest. BUG=angleproject:2298 TEST=angle_unittests Change-Id: I779bf03891f7d06f14d293e69101c05d7dbf57b6 Reviewed-on: https://chromium-review.googlesource.com/1254067 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Olli Etuaho fd643283 2018-04-04T16:12:09 Disallow case statements nested in blocks The GLSL ES 3.00.6 spec is a bit unclear on this, but it does disallow case statements "inside control flow". GLSL ES 3.10 clarifies this and disallows any nesting of case or default labels within other statements. BUG=angleproject:2452 TEST=angle_unittests Change-Id: I289bb39abb5227eab7117638af388b0a57dc5dd8 Reviewed-on: https://chromium-review.googlesource.com/995478 Commit-Queue: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Olli Etuaho 59c5b897 2018-04-03T11:44:50 Validate gl_FragData and gl_FragColor access after parsing After this simply declaring both variables invariant is not treated as static use. This simplifies ParseContext a bit, but the effect on compiler performance tests seems marginal. BUG=angleproject:2450 TEST=angle_unittests Change-Id: Ib90cb1d2bd1331542d1cd37732f24efb7833036a Reviewed-on: https://chromium-review.googlesource.com/992112 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Olli Etuaho 94bbed1e 2018-03-20T14:44:53 Collect static use information during parsing We now collect metadata for variables in the symbol table. The metadata is stored in a map using the variable unique id as a key, so we can store the variables themselves as constexpr while still having dynamic metadata. For now we collect whether a variable is statically read or written. This can be used to more accurately determine whether a variable is statically used, but can also enable more optimizations in the future, such as pruning variables that are never read or folding variables that are never written after initialization. The collection is done during parsing, so that nothing is pruned from the AST before the static use is recorded. Static writes are flagged in ParseContext::checkCanBeLValue, as that function is already called for all variables that are written. Static reads are flagged whenever there's an operation that requires a variable to be read. This includes: * Unary and binary math ops * Comma ops * Ternary ops * Assignments * Returning the variable * Passing the variable as an in or inout argument to a function * Using the variable as a constructor argument * Using the variable as an if statement condition * Using the variable as a loop condition or expression * Using the variable as an index * Using the variable as a switch statement init expression In case there are statements that simply refer to a variable without doing operations on it, the variable is being treated as statically read. Examples of such statements: my_var; my_arr[2]; These are a bit of a corner case, but it makes sense to treat them as static use for validation purposes. Collecting correct static use information costs us a bit of compiler performance, but the regression is on the order of just a few percent in the compiler perf tests. BUG=angleproject:2262 TEST=angle_unittests, angle_end2end_tests Change-Id: Ib0d7add7e4a7d11bffeb2a4861eeea982c562234 Reviewed-on: https://chromium-review.googlesource.com/977964 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Olli Etuaho b1de5a7e 2018-03-28T14:07:57 Prevent stack overflow due to recursive swizzle of an l-value Long chains of recursive swizzling could previously cause a stack overflow in checkCanBeLValue. Fold recursive swizzling when it is parsed to prevent this. BUG=angleproject:2439 TEST=angle_unittests Change-Id: I83b4c27442185709f6762d5ec23b93244010da05 Reviewed-on: https://chromium-review.googlesource.com/983593 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Olli Etuaho d05f964b 2018-03-05T12:13:26 Last case in switch statement can't be empty in ESSL 3.10 This is based on recent discussion in Khronos, though public specs have not yet been updated to reflect this. BUG=angleproject:2388 TEST=angle_unittests Change-Id: I66a0d03b3c2bb9740772a813b543f8f6c6bb2a28 Reviewed-on: https://chromium-review.googlesource.com/947977 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Olli Etuaho 92e4e079 2018-03-02T13:34:56 Test shader builtin accessibility from different stages Test that fragment, vertex or compute shader exclusive builtins are not accessible from another shader stage. This will protect against regressions when refactoring the symbol table. BUG=angleproject:2267 TEST=angle_unittests Change-Id: I50f97cbde3f1c5cb4584568e3008f1dab724b769 Reviewed-on: https://chromium-review.googlesource.com/941953 Commit-Queue: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Olli Etuaho e765e215 2018-03-01T12:00:48 Test that ESSL 300 standard derivatives compile successfully These functions have the same name in the ESSL 100 extension, creating a possibility for conflicts. This adds a convenient way to test for regressions when refactoring the symbol table. BUG=angleproject:2267 TEST=angle_unittests Change-Id: I9716524a0ea85064ba5f3ee8e7adfbdfc59d257e Reviewed-on: https://chromium-review.googlesource.com/945989 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Olli Etuaho 3582c0e2 2018-02-22T14:38:09 Add a test for redefining an unavailable built-in This is going to guard against regressions when symbol table init is optimized. TEST=angle_unittests BUG=angleproject:2267 Change-Id: Iec7b9814f4af215dc0b3e8a39c8cfab004451836 Reviewed-on: https://chromium-review.googlesource.com/931883 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Jiawei Shao e41df655 2018-02-09T14:31:39 ES31: Add shader version check for CS and GS This patch adds the missing check on the shader version for compute and geometry shaders, which can fix a bug that ANGLE GLSL compiler doesn't report a compile error when compiling an empty compute or geometry shader in version 100 or 300. This patch also updates the original compiler tests on the check of shader version. In these tests, the compile errors are all caused by illegal layouts instead of shader versions, which is against the purpose of the tests. This patch also fixes an incorrect case that used an empty compute shader in version 300. BUG=angleproject:1442, angleproject:1941 TEST=angle_unittests Change-Id: Ic26bb8eb312dbc0cec6a879997d0ae7a2e625a0f Reviewed-on: https://chromium-review.googlesource.com/910715 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Olli Etuaho 7c8567a3 2018-02-20T15:44:07 Always add most extension symbols to symbol table An error will be generated either way if the extension symbols are used incorrectly since each use of an extension function or variable checks whether the extension is enabled. We now also track extension in unmangled built-in names, so that redefining built-ins of extensions that are not enabled can be supported. This includes refactoring the shader extension tests to share a common helper class ShaderExtensionTest. BUG=angleproject:2267 TEST=angle_unittests Change-Id: I9cc5e9bd62fa07796e69256a6a9a493531a62446 Reviewed-on: https://chromium-review.googlesource.com/926526 Commit-Queue: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Olli Etuaho b60d30f7 2018-01-16T12:31:06 Make TVariable type immutable This enables using constexpr types for built-in variables and some of the variables created in AST transformations. BUG=angleproject:2267 TEST=angle_unittests Change-Id: Ie85b3c9872a071a7c023ced013b14ad91cff7cee Reviewed-on: https://chromium-review.googlesource.com/868134 Commit-Queue: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Olli Etuaho ea22b7a5 2018-01-04T17:09:11 Constant fold array indexing and comparison A virtual function to get the constant value of an AST node is added to TIntermTyped. This way a constant value can be retrieved conveniently from multiple different types of nodes. TIntermSymbol nodes pointing to a const variable can return the value associated with the variable, constructor nodes can build a constant value from their arguments, and indexing nodes can index into a constant array. This enables constant folding operations on constant arrays, while making sure that large amounts of data are not duplicated in the output shader. When folding an operation makes sense, the values of the arguments can be retrieved by using the new TIntermTyped::getConstantValue(). When folding an operation would result in duplicating data, the AST can just be left to be written out as is. For example, if the code contains a constant array of arrays, indexing into individual elements of the inner arrays can be folded, but indexing the top level array is left in place and not replaced with duplicated array literals. Constant folding is supported for indexing and comparisons of arrays. In case constant arrays are only referenced through foldable operations, the variable declarations will be pruned from the AST by the RemoveUnreferencedVariables step. BUG=angleproject:2298 TEST=angle_unittests Change-Id: I5b3be237b7e9fdba56aa9bf0a41b691f4d8f01eb Reviewed-on: https://chromium-review.googlesource.com/850973 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Olli Etuaho 765924f0 2018-01-04T12:48:36 Fold ternary and comma ops only after parsing is done In case folding a ternary op or a comma op would change the qualifier of the expression, the folding is deferred to a separate traversal step. After this there are no more cases where the type of a TIntermSymbol node needs to differ from the type of the variable it is referring to. There are still some cases where some parts of TIntermSymbol type are changed while keeping the TVariable type the same though, like when assigning array size to gl_PerVertex nodes or sanitizing qualifiers of struct declarations. BUG=angleproject:2267 TEST=angle_unittests, angle_end2end_tests Change-Id: I1501c8d361f5f765f43ca810d1b7248d9e2c5986 Reviewed-on: https://chromium-review.googlesource.com/850672 Commit-Queue: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Olli Etuaho f095799b 2017-12-22T11:10:04 Fix accessing the name of a nested struct definition When generating an error message about the struct nesting limit, the code should make sure that the struct definitions are not nested. While nested struct definitions by themselves are also an error, they're not a syntax error so parsing will continue after encountering them. This fixes a regression from commit: Don't allocate name strings for empty symbols. BUG=chromium:797156 TEST=angle_unittests Change-Id: I4149fbe874c0e7ec90e690aec078ccaf7313eab0 Reviewed-on: https://chromium-review.googlesource.com/842643 Commit-Queue: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Olli Etuaho a2d98141 2017-12-15T14:18:55 Fix allowing non-constant ternary global initializer Check the qualifier of a node resulting from the folding of a ternary node correctly. The folded node might even be a TIntermConstantUnion with a non-constant qualifier. BUG=angleproject:2285 TEST=angle_unittests Change-Id: I74516e44ce9d78bc54093a5b58d14cf33a57e6e5 Reviewed-on: https://chromium-review.googlesource.com/829138 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Jiawei Shao bd924af1 2017-11-16T15:28:04 ES31: Remove support of GL_OES_geometry_shader in compiler This patch intends to remove the support of GL_OES_geometry_shader in ANGLE compiler. To make the implementation simpler, currently we decide to only support "GL_EXT_geometry_shader" as the extension string of geometry shader in ANGLE. This patch also updates all the related shaders in angle_unittests into R"()" format. BUG=angleproject:1941 TEST=angle_unittests Change-Id: Ife9858abeedfb46b02c5c2fb1cda16fa27198511 Reviewed-on: https://chromium-review.googlesource.com/773451 Commit-Queue: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Olli Etuaho f13cadd8 2017-11-28T10:53:09 Fix checking negative index when indexing matrix/vector It's important that the test against the maximum of the valid range is only done if the index is positive, so the sanitized index value is guaranteed to end up in the valid range. This fixes a regression from commit "Add GLSL support for runtime-sized arrays in SSBOs". BUG=chromium:789029 TEST=angle_unittests Change-Id: Ic7125e383a64e46994b072df6d7e642432c521af Reviewed-on: https://chromium-review.googlesource.com/792935 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Jiajia Qin a3106c58 2017-11-03T09:39:39 ES31: Add atomic memory functions BUG=angleproject:1442 TEST=angle_unittests, angle_end2end_tests dEQP-GLES31.functional.compute.shared_var.atomic* dEQP-GLES31.functional.compute.basic.shared_atomic_op* dEQP-GLES31.functional.ssbo.atomic.* Change-Id: I82b54fde3a852d3bd917b1e19680baa1c28fce4d Reviewed-on: https://chromium-review.googlesource.com/765061 Commit-Queue: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Corentin Wallez <cwallez@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 7af63727 2017-11-13T15:03:40 Fix nullptr dereference on struct parameter error Function parameter name string does not necessarily exist, so it's better to use the function name as the token in the error message. BUG=chromium:784158 TEST=angle_unittests Change-Id: I8f3b8604fd702bdc9486b8d721a5f60de1ff3fa7 Reviewed-on: https://chromium-review.googlesource.com/765972 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Olli Etuaho ef7fb388 2017-11-07T16:33:49 Size const unsized arrays without an initializer The array size for unsized arrays needs to be sanitized in all cases, since subsequent checks on array indexing depend on all arrays being sized. BUG=chromium:781729 TEST=angle_unittests Change-Id: I3af6c08bb249a19f7c2ef169c877a2b863eb31d3 Reviewed-on: https://chromium-review.googlesource.com/757101 Commit-Queue: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Olli Etuaho d80f2944 2017-11-06T12:44:45 Struct definition not allowed as function parameter type Struct definitions are not allowed as a function parameter type now. This is specified in ESSL 3.00.6 section 12.10. ESSL 3.00.6 section 6.1.1 contradicts this, but that seems like a mistake, it's been fixed in subsequent spec versions. BUG=angleproject:2225 TEST=angle_unittests Change-Id: I6b97d120c440f0c0a45d31bbfaf292fb497160ce Reviewed-on: https://chromium-review.googlesource.com/754606 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Olli Etuaho b8ee9dd3 2017-10-30T12:43:27 Validate empty statements in switch statements Even an empty statement like ";" is a statement according to the grammar. They should not be allowed in switch statements before the first case statement, but on the other hand a switch statement that has just an empty statement after the last statement is valid. Now the parser creates AST nodes from empty statements so that we can validate switch statements correctly. However, they are pruned shortly after parsing completes in PruneNoOps, so they don't affect further processing of the AST. BUG=angleproject:2181 TEST=angle_unittests Change-Id: I1085056fc34b146142546fc5f2b7f3124b910ab9 Reviewed-on: https://chromium-review.googlesource.com/743621 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Olli Etuaho 722bfb51 2017-10-26T17:00:11 Fix detecting duplicate field names in structures Previously field names that were listed in the first declarator list inside a struct declaration were not checked against each other. BUG=angleproject:2204 TEST=angle_unittests Change-Id: Ibf821d45556f6dfe0223dae673644f6795daf4cb Reviewed-on: https://chromium-review.googlesource.com/739825 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Olli Etuaho 9cd7163e 2017-10-26T14:43:20 Fix setting array sizes on a constructor Take any array sizes that have been explicitly specified in the shader text into account, and only set the ones that are unsized according to the arguments. BUG=angleproject:2125 TEST=angle_unittests Change-Id: I37d08a86c25f7cd4f3ce5689f2c9fad444e7d5ad Reviewed-on: https://chromium-review.googlesource.com/738141 Commit-Queue: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Olli Etuaho 55bde916 2017-10-25T13:41:13 Parse array specifier with a separate grammar rule This brings the grammar closer to the GLSL ES 3.10 spec. Some corner cases related to handling unsized arrays are fixed. BUG=angleproject:2125 TEST=angle_unittests, angle_end2end_tests Change-Id: I9bcf87b17b97da0e2ec2954d32037c272fde3080 Reviewed-on: https://chromium-review.googlesource.com/738233 Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jiawei Shao 8e4b355b 2017-08-30T14:20:58 ES31: Implement Geometry Shader inputs and outputs This patch intends to implement Geometry Shader inputs and outputs in ANGLE GLSL compiler. 1. Only accept arrays as the inputs of a Geometry Shader. 2. Allow unsized arrays as the inputs of a Geometry Shader after a valid input primitive declaration and assign size to them. 3. Implement Geometry Shader outputs. 4. Allow Geometry Shader inputs and outputs using interpolation qualifiers ('flat', 'smooth', 'centroid'). 5. Allow using 'location' layout qualifier on Geometry Shader inputs and outputs. BUG=angleproject:1941 TEST=angle_unittests Change-Id: Ia7e250277c61f45c8479437b567c2831ff26b433 Reviewed-on: https://chromium-review.googlesource.com/650211 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Olli Etuaho cbcb96fc 2017-10-19T14:14:06 Fix switch/case last case validation for ESSL 3.10 No statement should be required after the last case label of a switch statement in ESSL 3.10. The validation is still kept for ESSL 3.00 for dEQP compatibility. If the dEQP tests are changed in the future, we might consider just issuing a warning regardless of shader version. BUG=angleproject:2189 TEST=angle_unittests Change-Id: Ic53e71e0176668a7dbffa315712885846e217f03 Reviewed-on: https://chromium-review.googlesource.com/727802 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Olli Etuaho 923ecef6 2017-10-11T12:01:38 Fix switch statement validation corner cases The grammar needs to generate AST nodes even for no-op statements, since they might be the last statement in a switch statement that is required for switch statement validity. Change the grammar to generate nodes from empty blocks and empty declarations. We also need to do some further processing of the AST. This is because PruneEmptyDeclarations will still remove empty declarations, and at least the NVIDIA driver GLSL compiler doesn't accept some types of no-op statements as the last statement inside a switch statement. So after parsing has finished we do rudimentary dead code elimination to remove dead cases from the end of switch statements. BUG=angleproject:2181 TEST=angle_unittests Change-Id: I586f2e4a3ac2171e65f1f0ccb7a7de220e3cc225 Reviewed-on: https://chromium-review.googlesource.com/712574 Commit-Queue: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
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>
Martin Radev 84aa2dcf 2017-09-11T15:51:02 Add textureGather and textureGatherOffset The patch adds new built-ins and extends the semantic parser to add support for textureGather and textureGatherOffset. BUG=angleproject:1442 TEST=angle_unittests TEST=angle_deqp_gles31_tests.exe --deqp-case=dEQP-GLES31.functional.texture.gather* --deqp-egl-display-type=angle-gl Change-Id: Iaf98c3420fbd61193072fdec8f5a61ac4c574101 Reviewed-on: https://chromium-review.googlesource.com/660124 Commit-Queue: Martin Radev <mradev@nvidia.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jiawei Shao e8ef2bc4 2017-08-29T13:38:57 Add compile error on using inputs with interpolation qualifier as l-value This patch intends to fix a compile error in ANGLE GLSL compiler when parsing an expression with inputs which has interpolation qualifiers ('flat', 'smooth' and 'centroid'). The compiler should report a compile error when a shader input with interpolation qualifier is used as a l-value. BUG=angleproject:2140 TEST=angle_unittests Change-Id: I7c059d53bf001ac31d34519a98e5289797833ce7 Reviewed-on: https://chromium-review.googlesource.com/640075 Commit-Queue: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jiawei Shao 7e1197e0 2017-08-24T15:48:38 Fix crash when indexing unsupported interface blocks by variable This patch intends to fix a compiler crash when indexing an unsupported interface blocks. We should not use UNREACHABLE() here because the compiler will continue parsing when this kind of error is generated. Instead, we use an ASSERT to ensure the compile error must have been reported before when the parsing reaches here. BUG=chromium:758159 Change-Id: I4bc63316d156d51f721123fe963106d1e81d8d32 Reviewed-on: https://chromium-review.googlesource.com/631797 Reviewed-by: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jiawei Shao d27f5c8d 2017-08-23T09:38:08 ES31: Implement GL_OES_geometry_shader built-ins in GLSL compiler This patch intends to implement all built-in constants, variables and functions defined in OpenGL ES 3.1 extension GL_OES_geometry_shader in ANGLE GLSL compiler. 1. Add all built-in constants defined in GL_OES_geometry_shader. 2. Add built-in functions EmitVertex() and EndPrimitive() required in Geometry Shader. 3. Add built-in variables gl_PrimitiveIDIn and gl_InvocationID to Geometry Shader. 4. Add built-in variables gl_PrimitiveID and gl_Layer to both Geometry Shader and Fragment Shader when GL_OES_geometry_shader is enabled. BUG=angleproject:1941 TEST=angle_unittests Change-Id: I92821553ed0efee2ccb77fead6e065e7799819d0 Reviewed-on: https://chromium-review.googlesource.com/627670 Commit-Queue: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Olli Etuaho 977ee7eb 2017-07-21T11:38:27 Add gl_ViewportIndex to the symbol table gl_ViewportIndex is a GLSL built-in that's needed to implement instanced multiview. It is a bit of a special case: it only exists in desktop GLSL and not ESSL, and it shouldn't be exposed to the parser. We add a new level to the symbol table that's hidden from the parser to make adding this kind of builtins in AST transforms consistent with the way ESSL builtins are supported. BUG=angleproject:1490 TEST=angle_unittests Change-Id: I51b2d983950b38c8e85e4b6ed00c6b39f9b3cb03 Reviewed-on: https://chromium-review.googlesource.com/580953 Commit-Queue: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Olli Etuaho 0ce8ef33 2017-08-18T12:00:28 Add arrays of arrays negative test coverage Arrays of arrays have not been implemented yet, but these tests can already be enabled. This is useful to make sure that we don't accidentally enable arrays of arrays where they shouldn't be enabled and that the initial implementation generates errors correctly and doesn't crash on malformed inputs. BUG=angleproject:2125 TEST=angle_unittests, angle_deqp_gles31_tests Change-Id: I538e5ae1f0903c42e06cfce352124130f160649d Reviewed-on: https://chromium-review.googlesource.com/620706 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Olli Etuaho 85d624a5 2017-08-07T13:42:33 Fix null pointer dereference in redeclaration error message When a function parameter name conflicts with another, the pointer returned to ParseContext will be null. BUG=chromium:745242 TEST=angle_unittests Change-Id: Ie53bb06b0c6660e382d85aeda41f3a1b7df5a917 Reviewed-on: https://chromium-review.googlesource.com/603368 Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Shao b5cc1198 2017-07-06T10:47:20 ES31: Add Geometry Shader layout qualifiers in GLSL compiler This patch intends to implement Geometry Shader layout qualifiers required in OpenGL ES 3.1 extension GL_OES_geometry_shader in ANGLE GLSL compiler. 1. Add support to the shader type GL_GEOMETRY_SHADER_OES. 2. Implement Geometry Shader layout qualifiers in the GLSL compiler: (1) Add support to OpenGL ES 3.1 extension "GL_OES_geometry_shader". (2) Add validations of the input and output primitive declarations in the Geometry Shader layout declarations. (3) Add 'invocations' and 'max_vertices' support in the Geometry Shader layout declarations 3. Add unit tests to cover all the new features added in this patch. BUG=angleproject:1941 TEST=angle_unittests Change-Id: Ie693e11f8a00dab3552626ed63e9336c7fbd3cb8 Reviewed-on: https://chromium-review.googlesource.com/560647 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Jiajia Qin bc58515e 2017-06-23T15:42:17 ES31: Add 'buffer' qualifier support in shader This change added 'buffer' qualifier support in shader which corresponds to ESSL 3.1 spec, session 4.3.7 'Buffer Variables'. BUG=angleproject:1951 TEST=angle_unittests:BufferVariablesTest Change-Id: I2ecb5317d5ea9d378a60b03f86bdae04dbd89e9f Reviewed-on: https://chromium-review.googlesource.com/534960 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Olli Etuaho 37d96cce 2017-07-11T14:14:03 Fix accepting arrays as array indices Previously, arrays were being incorrectly accepted as array indices. This was because the isScalar() check only checked that the type was not a vector or matrix, but still returned true for scalar arrays. This patch changes the isScalar() check so that it returns false for arrays. This makes usage of the term "scalar" more consistent in the shader translator. Most of the code using isScalar() was compatible with this change. Code in util.cpp that used to assume that isScalar() doesn't care about arrayness is refactored to work with the new behavior. BUG=angleproject:2102 TEST=angle_unittests Change-Id: I2a7f4c30fca7917d1099d0400efe3de859338b2a
Olli Etuaho 56229f1b 2017-07-10T14:16:33 Remove TIntermediate::addConstantUnion This includes asserts in TConstantUnion to reveal incorrect usage of union - reading a different field of an union that has last been set is undefined behavior in C++. Existing issues with accessing incorrect fields of constant unions are fixed. BUG=angleproject:1490 TEST=angle_unittests Change-Id: Idd6b7a871d73e2928f117a9348c92043612fab82
Olli Etuaho d7cd4ae5 2017-07-06T15:52:49 Check that function declarations don't use a reserved name Reserved function names are now caught if the function is just declared without being called in the shader source. Actually, function calls don't need to be checked for reserved names, since that just generates a redundant error message if function declarations are being checked. Includes some cleanup of ParseContext::checkIsNotReserved. It doesn't need special handling of built-in symbols, as they are never passed to the function. BUG=chromium:739448 TEST=angle_unittests Change-Id: I7115e1a7509626b5109b5c054c0704b0c3c19c58 Reviewed-on: https://chromium-review.googlesource.com/561457 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Shao 77891c0a 2017-06-23T16:30:17 Fix wrong assignment of maxUniformVectors in GLSL compiler This patch intends to fix a bug in ANGLE GLSL compiler. In TCompiler::Init(resources), we should initialize maxUniformVectors by resource.maxComputeUniformComponents / 4 when we attempt to initialize a compiler for compute shader instead of resource.maxFragmentUniformVectors. BUG=angleproject:2083 Change-Id: I4901f71ef5ac4f5770e2d5f8ee21786fcf19fbca Reviewed-on: https://chromium-review.googlesource.com/545190 Commit-Queue: Jiawei Shao <jiawei.shao@intel.com> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Olli Etuaho 487b63ab 2017-05-23T15:55:09 Disallow structs as scalar/vector constructor arguments The spec isn't very explicit about disallowing this, but conversions from structs are not among the conversion constructors or specified in any other way either. BUG=angleproject:2036 TEST=angle_unittests Change-Id: I23f2ceda1d1348cec0d3bba38a7a013275ff84eb Reviewed-on: https://chromium-review.googlesource.com/514002 Commit-Queue: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Olli Etuaho 9405005f 2017-05-08T14:17:44 Disallow interface blocks in arithmetic expressions Interface blocks were mistakenly being allowed in some types of unary, binary and ternary expressions, when they should not have been. BUG=angleproject:2030 TEST=angle_unittests Change-Id: Ie75833ee208e1b7fef8f77fa91b90da278bc6498 Reviewed-on: https://chromium-review.googlesource.com/500269 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
jchen10 b4cf5656 2017-05-05T18:51:17 Validate opaque operands against binary operators Add checks that opaque operands can only be used with array indexing and field section, as mentioned in ESSL 3.10 section 4.1.7. BUG=angleproject:2028 Change-Id: I41b7f10785bf712dfc999f85ebff925341c51911 Reviewed-on: https://chromium-review.googlesource.com/497767 Commit-Queue: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
jchen10 cc2a10e9 2017-05-03T14:05:12 Unify opaque type validation in GLSL parsing Refactor separate sampler and image validations into unified opaque type handling. This paves way for adding atomic counter, another new opaque type. BUG=angleproject:1729 Change-Id: I201d28e31c84534db43e656d518650e378bab76c Reviewed-on: https://chromium-review.googlesource.com/493618 Reviewed-by: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Olli Etuaho bb7e5a7c 2017-04-24T10:16:44 GLSL parser: Fix empty declaration qualifier checks The shader validation now does the same checks for qualifier combinations regardless of if a declaration is empty, as is specified. Some of these checks used to be in singleDeclarationErrorCheck, and have now been moved to a new function declarationQualifierErrorCheck. The other parts of singleDeclarationErrorCheck are under a renamed nonEmptyDeclarationErrorCheck. The patch also contains another related cleanup: Unnecessary symbol nodes won't be created for empty declarations any more. BUG=angleproject:2020 TEST=angle_unittests Change-Id: I1c864a5e151c52703926d8c550450b2561bfcbb2 Reviewed-on: https://chromium-review.googlesource.com/493227 Commit-Queue: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Olli Etuaho 193c0950 2017-05-02T15:51:47 Fix assert when attempting to create a void array node TIntermTyped::CreateZero can be reached with a void array type in an error case. Handle this gracefully instead of asserting. Also remove an assert that wasn't really checking anything in CreateZero. type.isScalar() || type.isVector() || type.isMatrix() can only be false in case of a struct, and struct type was being checked in the condition on the line above. BUG=chromium:717385 TEST=angle_unittests Change-Id: Iff0811d18d399d7b32b2b46deea5df172412eb8c Reviewed-on: https://chromium-review.googlesource.com/492887 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Olli Etuaho 4336489f 2017-02-13T16:00:12 Parse binding layout qualifier for opaque types This patch adds binding layout qualifier support for opaque types. Binding layout qualifier on blocks is not yet supported. This includes support for GLSL output and some minor simplification of related functionality in ParseContext. TEST=angle_unittests, dEQP-GLES31.functional.layout_binding.* BUG=angleproject:1442 Change-Id: I53fb505b5a539bccee70613f3969fba81965ae84 Reviewed-on: https://chromium-review.googlesource.com/441586 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Olli Etuaho 485eefdd 2017-02-14T17:40:06 Fix checking image memory access Checks for image memory access used to assume that image nodes are symbol nodes, but they can also be array indexing nodes. In invalid shaders struct indexing nodes of an image type may also appear after error recovery. TEST=angle_unittests, dEQP-GLES31.functional.layout_binding.* BUG=angleproject:1442 Change-Id: Ib45728d38485cb78c594e080f3decec1233a0046 Reviewed-on: https://chromium-review.googlesource.com/442764 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Jamie Madill 34bf2d93 2017-02-06T13:40:59 translator: Fix ASSERT in array init corner case. This ASSERT was benign and can be turned into an error check. The pattern in question is to initialize an array with another array as the first argument, but dereferencing the array with "." instead of "[]". This would trip up our error handling. BUG=chromium:662702 Change-Id: Ie0e44af7b9d1a66cad03cefae9bf931f8e216cd9 Reviewed-on: https://chromium-review.googlesource.com/437599 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Corentin Wallez 17a5c062 2017-01-22T15:20:53 IntermTyped::CreateZero: handle non-basictypes CreateZero is called in ParseContext so it should handle types which don't necessarily make sense to call it with. BUG=chromium:680961 Change-Id: I8627850e49eb9a4f4ecde61ca2d68371ea6a8dd6 Reviewed-on: https://chromium-review.googlesource.com/431001 Commit-Queue: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Olli Etuaho 78d13744 2017-01-18T13:06:10 Validate main() prototype declarations with incorrect parameters Instead of just validating definitions of main(), do the validation for all function headers for functions named "main", including headers in prototype declarations. BUG=angleproject:1712 TEST=angle_unittests Change-Id: Ia34a2a756e1cc27b241b27e8c01c6ef09bffba71 Reviewed-on: https://chromium-review.googlesource.com/430010 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Olli Etuaho 7e735e48 2017-01-12T15:42:01 Change remaining compile-time folding errors to warnings The GLES working group has decided to amend the spec so that implementations are not allowed to generate compile errors on undefined values detected at compile time. Change the remaining folding errors to warnings to follow the newly clarified rules. The end2end_tests covering this are removed, since they're redundant with the more efficient unit test. BUG=angleproject:1703 TEST=angle_unittests Change-Id: I97d2fd532dbe5733581bdc4aa40a5d7d3734fc0d Reviewed-on: https://chromium-review.googlesource.com/427799 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
JiangYizhou 4021932f 2016-12-09T09:50:51 translator: Add ES3.1 multisample texture support. Implement shader objects, [iu]sampler2DMS, textureSize(gsampler2DMS). as well as texelFetch(gsampler2DMS,P,sample) for the glsl. BUG=angleproject:1590 TEST=angle_unittests TEST=angle_end2end_tests Change-Id: I781023f7bec34ad0264af69f34bb182b50bd1fbd Reviewed-on: https://chromium-review.googlesource.com/423175 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Martin Radev d7c5b0aa 2016-07-27T14:04:43 Add support for barriers in the compiler The patch adds support for barriers in vertex, fragment and compute shaders. BUG:angleproject:1442 TEST:angle_unittests Change-Id: Ic85c3337911851a93a3f56bd935774181600eddd Reviewed-on: https://chromium-review.googlesource.com/380641 Commit-Queue: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Olli Etuaho 09b04a2f 2016-12-15T13:30:26 Add shader translator support for OVR_multiview The OVR_multiview and OVR_multiview2 extensions add gl_ViewID_OVR to shaders. gl_ViewID_OVR can be translated either as is in GLSL output or as a uniform by setting the SH_TRANSLATE_VIEWID_OVR_AS_UNIFORM compiler flag. If WebGL output is selected, the shaders will be validated according to proposed rules in the WEBGL_multiview spec. BUG=angleproject:1669 TEST=angle_unittests Change-Id: I19ea3a6c8b4edb78be03f1a50a96bfef018870d0 Reviewed-on: https://chromium-review.googlesource.com/422848 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Olli Etuaho 842f23f8 2016-12-19T22:37:36 Rename MalformedShaderTest to ShaderValidationTest Lots of these tests aren't actually testing malformed shaders, so the name was misleading. ShaderValidationTest reflects the content of the tests better. Some test classes that needlessly used different API spec versions are also merged. BUG=angleproject:1673 TEST=angle_unittests Change-Id: Ib842af153a09d3887f9bb857709fd0cd29bcc9c4 Reviewed-on: https://chromium-review.googlesource.com/422368 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>