src/compiler/translator/Initialize.cpp


Log

Author Commit Date CI Message
Qiankun Miao c2c5fc48 2016-08-31T15:24:22 Remove CSS Shader related code CSS shader has been removed from spec and chrome code base. Remove the code in ANGLE. BUG=chromium:233383 Change-Id: I93a35437f540e51ce7af9d49f21ca60d7c0b156a Reviewed-on: https://chromium-review.googlesource.com/378739 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Martin Radev b088360f 2016-08-04T17:48:58 Add compute shader special variables Support is added for the compute shader special variables given in OpenGL GLSL ES 3.1 Revision 4, 7.1.3 Compute Shader Special Variables. Unit tests are added for legal and illegal usage of the special variables. BUG=angleproject:1442 TEST=angle_unittests Change-Id: Idb25811c15c4044c55c611c0e73ef26eb5b3e9d7 Reviewed-on: https://chromium-review.googlesource.com/366661 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Martin Radev 802abe01 2016-08-04T17:48:32 Add compute shader compilation support in the glsl compiler Support is added for compute shader compilation. There is a small extension to the parser so that 'local_size_x = ', 'local_size_y = ' and 'local_size_z = ' are supported as layout qualifiers. A few shader compilation tests are added and one which checks the AST whether the layout qualifiers are properly parsed. BUG=angleproject:1442 TEST=angle_unittests TEST=angle_end2end_tests Change-Id: I67283797d1cf13fa4ac47faa2a6e66d93a2db867 Reviewed-on: https://chromium-review.googlesource.com/362300 Reviewed-by: Olli Etuaho <oetuaho@nvidia.com> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Martin Radev e93d24ef 2016-07-28T12:06:05 Add es3.1 shader constants The patch adds all shader built-in constants. BUG=angleproject:1442 TEST=angle_unittests TEST=angle_end2end_tests Change-Id: I81cae479d6506a8faa2dce023d5fcc2c1291d521 Reviewed-on: https://chromium-review.googlesource.com/364460 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Jamie Madill e064d44b 2016-06-21T20:00:41 translator: Fix use-after-free with DepthRange. Because this builtin uses a structure, certain shaders could trigger the mangled name to be allocated during normal shader compilation. Then when the scope is popped, the mangled name for DepthRange is freed, and we're left with a dangling pointer. Fix this temporarily by enforcing mangled name construction when we initialize the builtins, but we should look for a more robust and future-proof fix. BUG=620937 Change-Id: If130c8b48a18054502abaec08f10264f282b4925 Reviewed-on: https://chromium-review.googlesource.com/354494 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Antoine Labour <piman@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Geoff Lang b66a9097 2016-05-16T15:59:14 Add support for OES_EGL_image_external and OES_EGL_image_external_essl3. BUG=angleproject:1372 Change-Id: I8489e7fd0ab409b0775041ad5e9fbf0aab53886d Reviewed-on: https://chromium-review.googlesource.com/344734 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Ian Ewell bda75597 2016-04-18T17:25:54 Finish NV12 support via streams. The main functionality for NV12 texture support through EGL streams has been added. Updates to the compiler, texture code, and stream code were added to support binding to external D3D11 NV12 textures. An end2end test was also added to test sampling of YUV textures and converting to RGB. There is also a new script to convert BMP files to an NV12 texture ready to load into D3D11 for testing purposes. BUG=angleproject:1332 Change-Id: I39b6ec393ea338e2c843fb911acc1b36cd1158a0 Reviewed-on: https://chromium-review.googlesource.com/339454 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Ian Ewell <ewell@google.com> Reviewed-on: https://chromium-review.googlesource.com/341254 Reviewed-by: Ian Ewell <ewell@google.com>
Corentin Wallez 9670b03e 2016-04-29T09:47:47 Revert "Finish NV12 support via streams." Broke Windows Clang compilation, see https://build.chromium.org/p/chromium.gpu.fyi/builders/GPU%20Win%20Clang%20Builder%20%28dbg%29/builds/3583/steps/compile/logs/stdio and search for TextureStorage11.h This reverts commit 9b8b359fa3615be7c7492239a48f61103b2e4fcc. Change-Id: I6e54305eba02b40927a35577594df39e951adb32 Reviewed-on: https://chromium-review.googlesource.com/341430 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Ian Ewell 9b8b359f 2016-04-18T17:25:54 Finish NV12 support via streams. The main functionality for NV12 texture support through EGL streams has been added. Updates to the compiler, texture code, and stream code were added to support binding to external D3D11 NV12 textures. An end2end test was also added to test sampling of YUV textures and converting to RGB. There is also a new script to convert BMP files to an NV12 texture ready to load into D3D11 for testing purposes. BUG=angleproject:1332 Change-Id: I098940e6f25e113dcc4fc8d22ffed4b5a16fd860 Reviewed-on: https://chromium-review.googlesource.com/339454 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Ian Ewell <ewell@google.com>
Corentin Wallez b076adde 2016-01-11T16:45:46 Implement gl_VertexID BUG=angleproject:1217 Change-Id: Ibb9423d7de4966bce231734925a804b6340b5059 Reviewed-on: https://chromium-review.googlesource.com/321420 Reviewed-by: Jamie Madill <jmadill@chromium.org>
Kimmo Kinnunen 5f0246ca 2015-07-22T10:30:35 Implement gl_FragDepth for GLES SL 3.0 Makes it an error to access gl_FragDepthEXT in #version 300 es shader. TODO: Lacks the feature to make "#extension GL_EXT_frag_depth : require" an error for #version 300 es. Reland of: https://chromium-review.googlesource.com/#/c/287570 BUG=angleproject:1102 TEST=angle_unittest Change-Id: I064d918d65f37539cb1e14f12173ca5591a4ea3f Reviewed-on: https://chromium-review.googlesource.com/301711 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Kimmo Kinnunen b18609b9 2015-07-16T14:13:11 Implement ES 2,3 parts of EXT_blend_func_extended for shader translation Exposes gl_SecondaryFragColor, glSecondaryFragData[] and gl_MaxDualSourceDrawBuffers to GLES SL 1.0. Relaxes rules for undefined output locations for GLES SL 3.0 and exposes gl_MaxDualSourceDrawBuffers. If the output GL context is GL ES 2.0 or 3.0: The emulation layer is expected to turn on EXT_blend_func_extended if the output GL context supports it. If the output GL context is GL: The emulation layer is expected to turn on EXT_blend_func_extended if the output GL context supports ARB_blend_func_extended or if GL context is 3.2 or later. If the source shader spec is GLES SL 2.0: The emulation layer is expected to inspect the shader compilation output variables upon linking. If output target is GL SL, the emulation layer should bind color location 0, index 1 to "angle_SecondaryFragColor" if variable "gl_SecondaryFragColorEXT" is used. Alternatively, emulation layer should bind "angle_SecondaryFragData" to locations 0,1,2,3,..., all color index 1, if "gl_SecondaryFragData" array is used. (The caller can not bind the locations or specify output variables.) If the source shader spec is GLES SL 3.0: The emulation layer is expected to do location auto-resolve of the the output variables that have undefined output locations that have not been bound by the caller. (The caller can not use gl_ built-ins, so nothing to do with those.) BUG=angleproject:1085 TEST=angle_unittest Change-Id: I5cafe205b0c29478b0dcd24aa89a7b0000f5d046 Reviewed-on: https://chromium-review.googlesource.com/287580 Reviewed-by: Zhenyao Mo <zmo@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Kimmo Kinnunen <kkinnunen@nvidia.com>
Geoff Lang e2bfe2cd 2015-07-23T21:25:45 Revert "Implement gl_FragDepth for GLES SL 3.0" assertion failures in WebGL2 CTS. This reverts commit 544809610a131fe7040f2212789c62e212bbaf24. Change-Id: I2e0c7045c5b6ef9031a6e6c5916504fe68f51077 Reviewed-on: https://chromium-review.googlesource.com/287910 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Kimmo Kinnunen 54480961 2015-07-22T10:30:35 Implement gl_FragDepth for GLES SL 3.0 Makes it an error to access gl_FragDepthEXT in #version 300 es shader. TODO: Lacks the feature to make "#extension GL_EXT_frag_depth : require" an error for #version 300 es. BUG=angleproject:1102 TEST=angle_unittest Change-Id: Ic313a0e1ed6369550d53885290f300fab1aaf304 Reviewed-on: https://chromium-review.googlesource.com/287570 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Zhenyao Mo <zmo@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Dmitry Skiba 01971113 2015-07-10T14:54:00 Cache TTypes. *re-land with build fix for Win/Release* This change saves us ~70KiB per compiler with just ~3KiB of cache. BUG=492725 Change-Id: I4382c55b2480f70b00c5d117fcb7e0c51d0dfbb4 Reviewed-on: https://chromium-review.googlesource.com/284735 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Dmitry Skiba <dskiba@google.com> Reviewed-by: Alexis Hétu <sugoi@chromium.org>
Jamie Madill 53b76107 2015-07-10T18:52:58 Revert "Cache TTypes." Unused variable warning in Release: warning C4189: 'MaxEnumValue' : local variable is initialized but not referenced I'll handle fixing this. BUG=492725 This reverts commit b25d14e4b39ee273fad3bb585c3a3a929b3f794c. Change-Id: I502fc5288d5d3c48ecd43f84acdf66b7e300ad22 Reviewed-on: https://chromium-review.googlesource.com/284863 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Dmitry Skiba b25d14e4 2015-06-23T17:43:14 Cache TTypes. This change saves us ~70KiB per compiler with just ~3KiB of cache. BUG=492725 Change-Id: I7b8053c032c9c68f646162baf61abf6db3afe52e Reviewed-on: https://chromium-review.googlesource.com/284003 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 2f232370 2015-07-07T21:57:55 Revert "Cache TTypes." Lots of compile errors. BUG=492725 This reverts commit 5377720aae042c5bfae0e8a37032c90dc3ab78cf. Change-Id: I64889b99b1f1f48d39b87ebb668f6a32a3abac45 Reviewed-on: https://chromium-review.googlesource.com/283945 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Dmitry Skiba 5377720a 2015-06-23T17:43:14 Cache TTypes. This change saves us ~70KiB per compiler with just ~3KiB of cache. BUG=492725 Change-Id: I2ee748f7271b1afe0834083cbff6f0b84104aa53 Reviewed-on: https://chromium-review.googlesource.com/281411 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Dmitry Skiba <dskiba@google.com>
Arun Patole d94f6647 2015-05-18T16:25:12 Add ANGLE support for ESSL3 variant of mix() This change adds support for ESSL3 variant of built-in function mix() that takes last argument as a boolean vector. lerp() - HLSL equivalent of mix() doesn't look to be supporting a variant that takes last argument as a boolean vector so emulated it for HLSL. BUG=angleproject:1006 TESTS=dEQP tests Fixes "no matching overloaded function found " errors in below tests: dEQP-GLES3.functional.shaders.constant_expressions.builtin_functions.common.mix_*_b* (Note: These tests still fail because of constant expression issues) Change-Id: I79b353933cb450516b8678b1fdaeabe60417e9a7 Reviewed-on: https://chromium-review.googlesource.com/271751 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Olli Etuaho 4f52da4a 2015-03-11T10:48:41 Remove no-op functionality from IdentifyBuiltIns and refactor Adding array built-ins like gl_FragData and gl_LastFragData to the symbol table with a name that included their size in brackets was incorrect and unnecessary. Remove this. The array built-ins should only be added with their proper name and with an array type. Also refactor the code to reduce unnecessary repetition of conditions. The previous version attempted to split the built-ins that had dependencies on resources into their own part of the code, but this split was not clearly defined and only made the code harder to follow and prone to issues. TEST=WebGL conformance tests Change-Id: I7a77865a594864a22f3b566f9d3da1d0ead46466 Reviewed-on: https://chromium-review.googlesource.com/258751 Reviewed-by: Nicolas Capens <capn@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Olli Etuaho 61ffec88 2015-03-11T10:35:01 Fix formatting of IdentifyBuiltIns Fix indentation of case labels, fix too long lines, put braces on their own lines and remove extraneous spacing and comments that didn't contribute to the readability of the code. TEST=WebGL conformance tests Change-Id: Ie33d0a7c4412c448081f5d879fa9f64baaf8d537 Reviewed-on: https://chromium-review.googlesource.com/258750 Reviewed-by: Nicolas Capens <capn@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Qingqing Deng 5dbece59 2015-02-27T20:35:38 Implement trunc, round, roundEven (Emulated roundEven) BUG=angle:934 Change-Id: If33256bf3707f3f0202147276c71f08c65518205 Reviewed-on: https://chromium-review.googlesource.com/254842 Reviewed-by: Olli Etuaho <oetuaho@nvidia.com> Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Olli Etuaho 687ef22c 2015-03-03T10:58:05 Fix derivatives being related to an extension on ESSL3 dFdx, dFdy and fwidth are parts of the core language in ESSL3. This fixes a regression from the patch "Set symbol extension at insertion". BUG=angle:926 Change-Id: I6c0bbce3afad1f064ff115a16e23ea79bd584e49 Reviewed-on: https://chromium-review.googlesource.com/255450 Reviewed-by: Zhenyao Mo <zmo@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Olli Etuaho <oetuaho@nvidia.com> Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Arun Patole 7749005a 2015-03-03T18:36:05 Fix min built-in function support One of the recent change that uses generic types to compact the symbol table initialization has introduced a bug in 'min' function implementation, just fixing it here. TEST= dEQP tests: dEQP-GLES3.functional.shaders.operator.common_functions.min.lowp_uvec* Change-Id: I0e3d386c89bc07c3b656ec5029b8ce57f663cf46 Reviewed-on: https://chromium-review.googlesource.com/255369 Reviewed-by: Olli Etuaho <oetuaho@nvidia.com> Tested-by: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Nicolas Capens c9d9b30a 2015-02-20T23:02:15 Set symbol extension at insertion. BUG=angle:926 Change-Id: I4c96ae89c79d720d99bde803541c3158ba4629ab Reviewed-on: https://chromium-review.googlesource.com/251662 Tested-by: Nicolas Capens <capn@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Nicolas Capens 482907eb 2015-02-23T16:56:33 Set symbol operations at insertion. BUG=angle:926 Change-Id: Ifc8f62ebe1277214a4d3fbd5c56eb5faeff8e389 Reviewed-on: https://chromium-review.googlesource.com/251650 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Nicolas Capens <capn@chromium.org> Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Nicolas Capens f3cc4aef 2015-02-23T13:51:25 Use generic types to compact the symbol table initialization. Just like in the spec text, use symbolic types that represent multiple concrete types. The few signatures that get generated more than once are only added to the symbol table once because it ignores duplicates. BUG=angle:926 Change-Id: I216f03d22502b724dbefc87c5a021d6021c3a434 Reviewed-on: https://chromium-review.googlesource.com/251620 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Nicolas Capens <capn@chromium.org>
Arun Patole 6b19d765 2015-02-19T09:40:39 Implement missing variants of abs/sign This change adds ANGLE support for abs/sign variants introduced in ESSL3. BUG=angle:923 TEST=Unit tests, dEQP tests Unit Tests: TypeTrackingTest.BuiltInAbsSignFunctionFloatResultTypeAndPrecision TypeTrackingTest.BuiltInAbsSignFunctionIntResultTypeAndPrecision dEQP tests passing 100% because of this change: dEQP-GLES3.functional.shaders.builtin_functions.common.abs dEQP-GLES3.functional.shaders.builtin_functions.common.sign Change-Id: I2a3b028611f0eaaac3c031f8926d34a0e146663d Reviewed-on: https://chromium-review.googlesource.com/251491 Reviewed-by: Olli Etuaho <oetuaho@nvidia.com> Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Jamie Madill 7c1f6f19 2015-02-19T18:56:09 Revert "Implement missing variants of abs/sign" This for some reason is failing angle_unittests: http://build.chromium.org/p/chromium.gpu.fyi/builders/Win7%20Release%20%28NVIDIA%29/builds/13296 Happens across platforms. This reverts commit 3e142e47cc5b40564bcdba4252fd326bc28ca343. Change-Id: Ideb20457546c0dec10c9584182cc8d5ead42309d Reviewed-on: https://chromium-review.googlesource.com/251160 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Olli Etuaho b6e07a6a 2015-02-16T12:22:10 Implement ESSL3 modf This is the first built-in function that has an out parameter, so l-value checks are added for built-ins. BUG=angle:918 Change-Id: Ifd5befe955224f706f864e25107879c9cdce9e9f Reviewed-on: https://chromium-review.googlesource.com/250780 Tested-by: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Arun Patole 3e142e47 2015-02-19T09:40:39 Implement missing variants of abs/sign This change adds ANGLE support for abs/sign variants introduced in ESSL3. BUG=angle:923 TEST=dEQP tests Tests passing 100% because of this change: dEQP-GLES3.functional.shaders.builtin_functions.common.abs dEQP-GLES3.functional.shaders.builtin_functions.common.sign Change-Id: If22032be2c1ed08451275262e311ef5ac613d45e Reviewed-on: https://chromium-review.googlesource.com/251060 Reviewed-by: Olli Etuaho <oetuaho@nvidia.com> Tested-by: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Arun Patole 0c1726e6 2015-02-18T14:35:02 Implement isnan/isinf This change adds ANGLE support for isnan/isinf. BUG=angle:922 TEST=dEQP tests: dEQP-GLES3.functional.shaders.builtin_functions.common.isnan.* (high precision tests still fail) Tests passing 100% because of this change: dEQP-GLES3.functional.shaders.builtin_functions.common.isinf.* Reduced number of errors in tests: EQP-GLES3.functional.shaders.constant_expressions.builtin_functions.common.isnan.* dEQP-GLES3.functional.shaders.constant_expressions.builtin_functions.common.isinf_* Change-Id: I52bf18b59365ea7031746ae840550162d7e6b96e Reviewed-on: https://chromium-review.googlesource.com/250761 Reviewed-by: Olli Etuaho <oetuaho@nvidia.com> Tested-by: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Nicolas Capens <capn@chromium.org>
Arun Patole 2b45573b 2015-02-17T20:24:59 Implement missing vector relational functions This change adds ANGLE support for following vector relational function variants introduced in GLES3: bvec lessThan(uvec x, uvec y) bvec lessThanEqual(uvec x, uvec y) bvec greaterThan(uvec x, uvec y) bvec greaterThanEqual(uvec x, uvec y) bvec equal(uvec x, uvec y) bvec notEqual(uvec x, uvec y) BUG=angle:920 TEST=dEQP tests Reduced number of errors in tests: dEQP-GLES3.functional.shaders.constant_expressions.builtin_functions.vector_relational.* Change-Id: Id45ce77b35f39403e587a577622271d8e9815225 Reviewed-on: https://chromium-review.googlesource.com/250377 Reviewed-by: Nicolas Capens <capn@chromium.org> Reviewed-by: Olli Etuaho <oetuaho@nvidia.com> Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Arun Patole 42077bb1 2015-02-16T15:32:37 Implement missing variants of min, max and clamp BUG=angle:914 TEST=dEQP tests Tests passing 100% because of this change: dEQP-GLES3.functional.shaders.operator.common_functions.min.* dEQP-GLES3.functional.shaders.operator.common_functions.max.* dEQP-GLES3.functional.shaders.operator.common_functions.clamp.* Reduced number of errors in tests: EQP-GLES3.functional.shaders.constant_expressions.builtin_functions.common.* These tests are not yet passing because of constant expressions bug (angle bug:913) Change-Id: Ibccee47ed78e994e40a0effe9afa9cf9692492b0 Reviewed-on: https://chromium-review.googlesource.com/250330 Reviewed-by: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Nicolas Capens <capn@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Gregoire Payen de La Garanderie b3dced29 2015-01-12T14:54:55 Implementing gl_InstanceID in the HLSL compiler. Fixes: dEQP-GLES3.functional.instanced.draw_arrays_instanced.instance_id dEQP-GLES3.functional.instanced.draw_arrays_instanced.mixed dEQP-GLES3.functional.instanced.draw_elements_instanced.instance_id dEQP-GLES3.functional.instanced.draw_elements_instanced.mixed BUG=angle:601 Change-Id: I6e120eebc90d00e025fc58f096064e6ed1da826b Reviewed-on: https://chromium-review.googlesource.com/246911 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Gregoire Payen de La Garanderie <Gregory.Payen@imgtec.com> Reviewed-by: Zhenyao Mo <zmo@chromium.org>
David Yen 0fbd128c 2015-02-02T14:46:09 Extension behavior is now reset between each shader translation unit. The extension behavior was being shared between translation units, this was causing states to be cached between shader compilers. This has been fixed now by adding a new ResetExtensionBehavior() function. A unit test has also been added for testing extensions when compiling shaders. A test has been included which tests that the internal state of the extension behavior is being reset properly. BUG=453543 Change-Id: Icb2a07019b5db972dc75cdbbdece4b7e9757c682 Reviewed-on: https://chromium-review.googlesource.com/245522 Tested-by: David Yen <dyen@chromium.org> Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Olli Etuaho 7700ff65 2015-01-15T12:16:29 Add basic support for ESSL3 vec2 (un)pack functions The functions are emulated on HLSL, and use the native functions on OpenGL 4.2+ and GLES3.0. Emulation for OpenGL versions <= 4.1 is not yet implemented. BUG=angle:865 Change-Id: I6803a1767dacdb3dca12f13924651fd38fcacb75 Reviewed-on: https://chromium-review.googlesource.com/240961 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Olli Etuaho abf6dadd 2015-01-14T14:45:16 Implement matrix inverse built-in Inverse is emulated in HLSL by calculating the cofactor matrix and dividing that with the determinant. This results in the transpose of the inverse as is required. Better performing options might exist especially for 4x4 matrices, but this is enough for a working implementation. BUG=angle:859 Change-Id: I5185797cc1ed86865f5f4342707abdc2977a186b Reviewed-on: https://chromium-review.googlesource.com/240331 Tested-by: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Olli Etuaho e39706d0 2014-12-30T16:40:36 Implement simple ESSL3 matrix functions Add support for built-in functions outerProduct, determinant, transpose and the variations of matrixCompMult that were previously unsupported. BUG=angle:859 Change-Id: Ie2b9cf83cd80c5a886c6d4eb190c7ce25a32d0a4 Reviewed-on: https://chromium-review.googlesource.com/239873 Reviewed-by: Nicolas Capens <capn@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Olli Etuaho <oetuaho@nvidia.com> Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Olli Etuaho 5c9cd3d1 2014-12-18T13:04:25 Implement hyperbolic function support for ESSL 3.00 Emulating arc hyperbolic functions is required on HLSL, where they do not exist natively. For this, BuiltInFunctionEmulator is split into GLSL and HLSL subclasses. The GLSL subclass handles the pre-existing built-in emulation implemented for working around OSX bugs, and the HLSL subclass handles emulating asinh, acosh and atanh on HLSL. BUG=angle:855 Change-Id: I0dfeffb862ac27ba7f9ecf5492ec31d9d952b273 Reviewed-on: https://chromium-review.googlesource.com/236861 Reviewed-by: Nicolas Capens <capn@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Olli Etuaho e8d2c072 2015-01-08T16:33:54 Implement float-integer conversions for ESSL 3.00 The implementation uses asint, asuint and asfloat in the HLSL output. BUG=angle:865 Change-Id: I6b48298e18c7b3b0bdeac522b375ebc4eab7cf4e Reviewed-on: https://chromium-review.googlesource.com/239520 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Erik Dahlström ea7a2121 2014-11-17T16:15:57 Add GLSL/ESSL validator/translator support for GL_EXT_shader_framebuffer_fetch. BUG=angle:834 Change-Id: I2d4e25909a8e1266b9bb7f1d4421324143157c8a Reviewed-on: https://chromium-review.googlesource.com/231032 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Erik Dahlström <ed@opera.com>
Jamie Madill b1a85f48 2014-08-19T15:23:24 Rename compiler intermediate source files. This prevents confusion between "TIntermediate" and "TIntermNode". BUG=angle:711 Change-Id: Ib7a086382a479db3f77bf2ab06ce321aa7b35d13 Reviewed-on: https://chromium-review.googlesource.com/212936 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Zhenyao Mo <zmo@chromium.org> Reviewed-by: Nicolas Capens <capn@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>
Nicolas Capens adfffe46 2014-06-17T02:13:36 Duplicate reused symbol table entries. BUG=angle:651 Change-Id: Ifce3c19d41a0a5a5ca5ee90ede528adf397d1da5 Reviewed-on: https://chromium-review.googlesource.com/204290 Tested-by: Nicolas Capens <nicolascapens@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shannon Woods <shannonwoods@chromium.org>
Jamie Madill 37f77d2e 2014-04-30T16:10:13 Fixes to the standalone Linux build. Several small build errors present on Linux cropped up due to different warning flags and platform quirks. BUG=angle:627 Change-Id: If8f651cacf05bb06ecb129be47b12729ccc3f69b Reviewed-on: https://chromium-review.googlesource.com/197724 Reviewed-by: Shannon Woods <shannonwoods@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Nicolas Capens 46485086 2014-04-15T13:12:50 Implement EXT_shader_texture_lod BUG=angle:551 Change-Id: I81d7574a15861f1b24ddf6147cf71adbf20e10f3 Reviewed-on: https://chromium-review.googlesource.com/194960 Tested-by: Nicolas Capens <nicolascapens@chromium.org> Reviewed-by: Shannon Woods <shannonwoods@chromium.org>
Nicolas Capens 691bd3e9 2014-02-19T17:38:45 texture(sampler2DArrayShadow, ...) should not take a bias parameter. BUG=angle:564 Change-Id: I3b86e8d52ebae0e1efd0805671bd58580a712b23 Reviewed-on: https://chromium-review.googlesource.com/187082 Tested-by: Nicolas Capens <nicolascapens@chromium.org> Reviewed-by: Shannon Woods <shannonwoods@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Nicolas Capens f7378e38 2014-02-19T17:29:32 Implement textureProjGrad and textureProjGradOffset. BUG=angle:564 Change-Id: Ice6a3715b0fda13324b3162940de875c932627c9 Reviewed-on: https://chromium-review.googlesource.com/186992 Tested-by: Nicolas Capens <nicolascapens@chromium.org> Reviewed-by: Shannon Woods <shannonwoods@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Nicolas Capens bf7db103 2014-02-19T17:20:28 Implement textureGradOffset. BUG=angle:564 Change-Id: Iad0e452f53469208d55755e14a350b5d2ca83e9d Reviewed-on: https://chromium-review.googlesource.com/186987 Tested-by: Nicolas Capens <nicolascapens@chromium.org> Reviewed-by: Shannon Woods <shannonwoods@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Nicolas Capens d11d549f 2014-02-19T17:06:10 Implement textureGrad. BUG=angle:564 Change-Id: I95dcd95a274f6d560250c197be0d6e64a5b23516 Reviewed-on: https://chromium-review.googlesource.com/187081 Tested-by: Nicolas Capens <nicolascapens@chromium.org> Reviewed-by: Shannon Woods <shannonwoods@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Nicolas Capens fc01454b 2014-02-18T14:47:13 Implement texelFetch and texelFetchOffset. BUG=angle:564 Change-Id: I7ad3484061f5d6912d7842bdadc6297de3e82ef8 Reviewed-on: https://chromium-review.googlesource.com/186990 Tested-by: Nicolas Capens <nicolascapens@chromium.org> Reviewed-by: Shannon Woods <shannonwoods@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Nicolas Capens 2adc256a 2014-02-14T23:50:59 Implement textureProjLod and textureProjLodOffset. BUG=angle:564 Change-Id: I547c69908d0aa1809f844a50230bc019e6dd5893 Reviewed-on: https://chromium-review.googlesource.com/186685 Tested-by: Nicolas Capens <nicolascapens@chromium.org> Reviewed-by: Shannon Woods <shannonwoods@chromium.org>
Nicolas Capens df86c6b9 2014-02-14T20:09:17 Implement textureProjOffset and textureLodOffset. BUG=angle:564 Change-Id: I647abed0609afd178d2e9522f139d25dd3c7fda4 Reviewed-on: https://chromium-review.googlesource.com/186684 Tested-by: Nicolas Capens <nicolascapens@chromium.org> Reviewed-by: Shannon Woods <shannonwoods@chromium.org>
Nicolas Capens 4fd5e4a3 2014-02-14T18:17:15 Use generic sampler types to compact symbol table initialization. BUG=angle:564 Change-Id: Idbca76a4c8360d34652b571227fbb068d8d017c4 Reviewed-on: https://chromium-review.googlesource.com/186683 Tested-by: Nicolas Capens <nicolascapens@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Nicolas Capens c9508842 2014-02-14T17:48:50 Simplify the creation of global types. BUG=angle:564 Change-Id: If611947f7e8ceb603001165c3c1d61d7686f1d30 Reviewed-on: https://chromium-review.googlesource.com/186681 Tested-by: Nicolas Capens <nicolascapens@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Nicolas Capens 1fbc2873 2014-01-03T14:12:09 Add textureOffset intrinsics to the symbol table. BUG=angle:541 Change-Id: Ied96edd073017a507369319a781b8ed23f60790b Reviewed-on: https://chromium-review.googlesource.com/181520 Tested-by: Nicolas Capens <nicolascapens@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shannon Woods <shannonwoods@chromium.org>
Jamie Madill 16a1c072 2013-10-22T15:42:15 Expose the textureLod functiosn to GLES 3.00 shaders. We should have support for these methods, but they were not exposed to the shaders. TRAC #23991 Signed-off-by: Shannon Woods Signed-off-by: Geoff Lang
Jamie Madill 455a6f5c 2013-10-17T10:45:46 Expose gl_MaxDrawBuffers to ESSL 3.00 shaders. Previously was only exposed in ESSL 1.00. TRAC #23990 Signed-off-by: Geoff Lang Signed-off-by: Shannon Woods
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.