src/compiler/translator/ShaderLang.cpp


Log

Author Commit Date CI Message
Jamie Madill 3f647b1b 2019-11-09T16:24:50 Vulkan: Improve Bresenham line emulation. Clamps the vertex position to the subpixel grid before interpolation. This will give more correct results on systems that have less than 8 bits of subpixel accuracy. Also uses a more accurate formulation for the emulation filter in the fragment shader using dfdx and dfdy. Fixes line raster CTS tests on SwiftShader. Still does not produce spec conformant lines. Updates the public docs to indicate this. Bug: angleproject:2830 Change-Id: Ib9a268df3e7d986bd2b1348be664389fe8fc0ef2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1826598 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com>
Tim Van Patten 90a58622 2019-09-04T15:39:58 Refactor ShaderVariable to Remove Specializations The following structs are being refactored and moved into the parent struct ShaderVariable: VariableWithLocation Uniform Attribute OutputVariable InterfaceBlockField Varying Bug: angleproject:3899 Test: CQ Change-Id: I389eb3ab4ed44a360e09fca75ecc78d64a277f83 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1785877 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com> Commit-Queue: Tim Van Patten <timvp@google.com>
Stuart Morgan 9d737966 2019-08-14T12:25:12 Standardize copyright notices to project style For all "ANGLE Project" copyrights, standardize to the format specified by the style guide. Changes: - "Copyright (c)" and "Copyright(c)" changed to just "Copyright". - Removed the second half of date ranges ("Y1Y1-Y2Y2"->"Y1Y1"). - Fixed a small number of files that had no copyright date using the initial commit year from the version control history. - Fixed one instance of copyright being "The ANGLE Project" rather than "The ANGLE Project Authors" These changes are applied both to the copyright of source file, and where applicable to copyright statements that are generated by templates. BUG=angleproject:3811 Change-Id: I973dd65e4ef9deeba232d5be74c768256a0eb2e5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1754397 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
shrekshao cdab03aa 2019-06-18T17:24:54 Add flags to shader translator to emulate gl_BaseVertex and gl_BaseInstance Adds support for translating gl_BaseVertex and gl_BaseInstance for implementation of GL_ANGLE_base_vertex_base_instance. They will only be available in WebGL 2. Since there's no gl_VertexID and gl_InstanceID in WebGL 1. It won't be very useful to add them to WebGL 1. Mostly follow pattern of gl_DrawID of GL_multi_draw BUG=angleproject:3402,chromium:891861 Change-Id: Ifcd990c52d12f6814127b904e61a779b8d382e0c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1666361 Commit-Queue: Shrek Shao <shrekshao@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Cody Northrop 4fbbdb15 2019-06-28T14:17:13 texture3D: Compiler changes for sampler3D Bug: angleproject:3188 Change-Id: Iac1408f8b91c6a6610a63cef236205b7dcdbd2c4 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1682781 Reviewed-by: Lingfeng Yang <lfy@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Cody Northrop <cnorthrop@google.com>
Mingyu Hu ebab670c 2019-04-19T14:36:45 Adding new extension GL_OVR_multiview GL_OVR_multiview functions exactly the same as GL_OVR_multiview2. All GL_OVR_multiview2 tests now also repeat the same test using GL_OVR_multiview Bug: angleproject:3341 Change-Id: I7e5294fb6bbf7692535174a15da6a42e1b5fc4e2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1575904 Commit-Queue: Rafael Cintron <rafael.cintron@microsoft.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Mingyu Hu 7d64c486 2019-03-12T14:27:40 GL_ANGLE_multiview has been renamed to GL_OVR_multiview2. changes include: 1) GL_OVR_multiview to GL_OVR_multiview2 extension directive change 2) Removal of all references to side by side. We no longer support multiple views in a single 2DTexture. Only 2DTextureArray's are supported 3) WebGL 2 (ES3) is required for multiview Bug: angleproject:3341 Change-Id: Ie0c1d21d7610f8feebdb2e4d01c6947f57e69328 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1552023 Commit-Queue: Rafael Cintron <rafael.cintron@microsoft.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Xinghua Cao f3179a6a 2018-07-12T16:22:06 ES31: Implement bindImageTexture binds a single layer on D3D backend Dynamically generate image2D variables' declaration and function definition in libANGLE. Bug: angleproject:1987 TEST=angle_end2end_tests.ComputeShaderTest.* Change-Id: Idacc756f7bd15f22eccb1d689e18e997f3e74159 Reviewed-on: https://chromium-review.googlesource.com/c/1142885 Commit-Queue: Xinghua Cao <xinghua.cao@intel.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill b980c563 2018-11-27T11:34:27 Reformat all cpp and h files. This applies git cl format --full to all ANGLE sources. Bug: angleproject:2986 Change-Id: Ib504e618c1589332a37e97696cdc3515d739308f Reviewed-on: https://chromium-review.googlesource.com/c/1351367 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Austin Eng 7cf9cd24 2018-10-09T15:27:32 Add flags to shader translator to emulate gl_DrawID Adds support for translating gl_DrawID for implementation of GL_ANGLE_multi_draw. Currently the change only supports and allows emulation of the draw id using a uniform variable named `gl_DrawID`. This uniform is mapped in the translated shader to a hashed name that does not use the gl_ namespace Bug: chromium:890539 Change-Id: I08a246ca911e88e733ccdf22f1ed69dcae948e05 Reviewed-on: https://chromium-review.googlesource.com/c/1271957 Commit-Queue: Austin Eng <enga@chromium.org> Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Yizhou Jiang c4533eae 2018-09-19T15:23:29 Enable ANGLE_texture_multisample in glsl in es 3.0 Enable gsampler2dMS, texelFetch, textureSize in glslang in es 3.0 if ANGLE_texture_multisample is supported. Bug: angleproject:2275 TEST=SamplerMultisampleEXTTest.TextureMultisampleEXTEnabled Change-Id: Ibfa367970db3ae790f3822e57eb50090843dc6db Reviewed-on: https://chromium-review.googlesource.com/c/867521 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Yizhou Jiang <yizhou.jiang@intel.com>
Qin Jiajia a602f906 2018-09-11T14:40:24 ES31: Support shader storage buffer in D3D-API side. Bug: angleproject:1951 Test: angle_end2end_tests Change-Id: I0d8a4f8cf00fc7fd2d85315138e2b7457fd0b90c Reviewed-on: https://chromium-review.googlesource.com/1242846 Commit-Queue: Jiajia Qin <jiajia.qin@intel.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Olli Etuaho f0d0408a 2018-08-28T16:02:13 Use OES_texture_storage_multisample_2d_array There's an OES extension for multisample texture arrays, OES_texture_storage_multisample_2d_array. Change references from ANGLE_texture_multisample_array to the native extension in the shader compiler. ANGLE still needs to have robust behavior for out-of-range texel fetches that's not found in the original extension, but this does not need to be spelled out in the extension spec. BUG=angleproject:2775 TEST=angle_unittests Change-Id: Ie80ae767cc92ccaf7389af28789f45547f86978f Reviewed-on: https://chromium-review.googlesource.com/1193266 Commit-Queue: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Olli Etuaho 8ca60805 2018-08-23T14:10:02 Add 2D MS array sampler support to compiler This also places textureSize(gsampler2DMS) correctly in the ESSL 3.10 builtins instead of ESSL 3.00 builtins. BUG=angleproject:2775 TEST=angle_unittests Change-Id: Ieb0f7a7424a5558a5569af6d4fcbcc9b12ec9840 Reviewed-on: https://chromium-review.googlesource.com/1186466 Commit-Queue: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Rafael Cintron 05a449a7 2018-06-20T18:08:04 Replace reinterpret_cast with safer or no cast When casting types to one another in C++, the weaker the cast, the better. This change replaces instances of reinterpret_cast with static_cast or no cast where it safe and correct to do so. BUG=angleproject:2683 Change-Id: I99c9033614a65282ae1d78cf0f4b80fabd75877a Reviewed-on: https://chromium-review.googlesource.com/1109396 Commit-Queue: Rafael Cintron <rafael.cintron@microsoft.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jiawei Shao 4ed05da2 2018-02-02T14:26:15 ES31: Add link validation on geometry shader itself This patch intends to support program link validation on geometry shader itself. A link error should occur when linking a program with a geometry shader that lacks input primitive or output primitive or the declaration of 'max_vertices'. This patch also adds the support of linking a program with geometry shader in angle_end2end_tests. BUG=angleproject:1941 TEST=angle_end2end_tests dEQP-GLES31.functional.shaders.linkage.es31.geometry.varying.rules.unspecified_* Change-Id: I25fb08514753102f5dd3ab86211c05d2ca4fd185 Reviewed-on: https://chromium-review.googlesource.com/898842 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
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 ebee5b3b 2017-11-23T12:56:32 Add GLSL support for runtime-sized arrays in SSBOs The GLSL parser now allows a runtime-sized array as the last member in a shader storage block. Clamping indexing against the memory bounds is done by determining the array length at runtime. Runtime-sized arrays are used in dEQP tests for many compute shader tests, so these now work on the OpenGL backend. BUG=angleproject:1951 TEST=angle_unittests, dEQP-GLES31.functional.shaders.linkage.shader_storage_block.* dEQP-GLES31.functional.shaders.builtin_functions.*compute* Change-Id: Ibecca24623ca8e4723af6f0e0421fe9711ea828d Reviewed-on: https://chromium-review.googlesource.com/787976 Commit-Queue: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Jiawei Shao 89be29a5 2017-11-06T14:36:45 ES31: Implement creation and attaching geometry shader on OpenGL This patch intends to implement the creation of a geometry shader and attaching a geometry shader to a program on OpenGL back-ends. This patch also adds all geometry shader related dEQP-GLES31 test failures to deqp_gles31_test_expectations.txt. BUG=angleproject:1941 TEST=angle_end2end_tests Change-Id: Ib0b497030255b15dacd967e48bc59eef0009af46 Reviewed-on: https://chromium-review.googlesource.com/757979 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@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 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 d7487b13 2017-08-09T15:45:13 Clean up checking variable packing limits This encapsulates expanding struct variables inside the VariablePacker class that packs variables according to the GLSL ES spec. The variable expansion step is no longer run twice when checking uniforms against the max uniforms limit. BUG=angleproject:2068 TEST=angle_unittests Change-Id: I012ddaa249f71c0a78d937c98007c61352e64888 Reviewed-on: https://chromium-review.googlesource.com/608367 Commit-Queue: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jiajia Qin 9b11ea4f 2017-07-11T16:50:08 Gather UniformBlock and ShaderStorageBlock separately Refactor InterfaceBlocks since it only stands for UniformBlock before ES31. But for ES31, uniform block and shader storage block both belong to interface block. This CL will add GetUniformBlocks and GetShaderStorageBlocks in ShaderLang.h. Meanwhile, keep GetInterfaceBlocks which can return all the interface blocks together. BUG=angleproject:1951 Change-Id: I3036e201aadfbd490575ed03538c81bcc3793ff3 Reviewed-on: https://chromium-review.googlesource.com/582546 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jiawei-Shao df7d7c9e 2017-07-31T09:34:04 Split varyings into input and output varyings in compiler This patch intends to split all vector<Varying> into two vectors to store input and output varyings separately in the compiler. This patch is a base of implementing the built-ins, inputs and outputs of a geometry shader to ANGLE GLSL compiler. Unlike the vertex shaders (their outputs are varyings) and fragment shaders (their inputs are varyings), the inputs and outputs of geometry shaders are all varyings, so we need two vector<Varying> to store them correctly. BUG=angleproject:1941 Change-Id: I9e8cc16045d5e29e9a80a09dc31b33a7ae39b345 Reviewed-on: https://chromium-review.googlesource.com/593347 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
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>
Martin Radev 318f9aa5 2017-05-17T17:47:28 Initialize ANGLE_multiview caps and workaround state The patch checks whether ANGLE_multiview can be supported in the OpenGL renderer, updates the caps and adds a workaround field to enable multiview support through the NV_viewport_array2 extension. BUG=angleproject:2062 TEST=angle_end2end_tests Change-Id: I99dae10564db7bcca41d7624f8de272c1d996e09 Reviewed-on: https://chromium-review.googlesource.com/567934 Reviewed-by: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
jchen10 af713a24 2017-04-19T09:10:56 ES31: Implement binding layout for uniform blocks The binding point of uniform blocks can be specified in shaders with this CL. See spec ESSL 3.10, section 4.4.4, page 58 for more info. dEQP-GLES31.functional.ubo.* still can't completely pass as the missing of arrays-of-arrays feature. Neither can dEQP-GLES31.functional.layout_binding.ubo.* due to the incomplete implementation of program interface APIs. TEST=angle_end2end_tests:UniformBufferTest BUG=angleproject:1442 Change-Id: If95d468fc109834a132b9b817730d3fdc3a615da Reviewed-on: https://chromium-review.googlesource.com/483848 Commit-Queue: Jie A Chen <jie.a.chen@intel.com> Commit-Queue: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Yunchao He f81ce4a3 2017-04-24T10:49:17 Refactoring: replace NULL by nullptr for pointers (3rd CL). This CL mainly handles passing/returning NULL to/from a function. BUG=angleproject:2001 Change-Id: I34802f792e710e3d7ff697cbe4701dc1bf5ab009 Reviewed-on: https://chromium-review.googlesource.com/485060 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Yunchao He d7297bfb 2017-04-19T15:27:10 Code refactoring: replace NULL by nullptr for pointers. This is the frist change to replace NULL by nullptr. It handles the initialization and assignment for pointers. BUG=angleproject:2001 Change-Id: I6d4bb198a72e38b867cd2f65a6e6f2f61339a0b5 Reviewed-on: https://chromium-review.googlesource.com/481600 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Andrei Volykhin a5527071 2017-03-22T16:46:30 Add support for EXT_YUV_target Add new sampler type "__samplerExternal2DY2YEXT" to sample a YUV texture image and output color value without any color conversion, new additional type to specify color space standard formula and built-in functions for yuv to rgb transformation. Change-Id: I1780650fe84cd75191c1ca1e4118e89d585bfd92 Reviewed-on: https://chromium-review.googlesource.com/454697 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Olli Etuaho 6ca2b65c 2017-02-19T18:05:10 Implement location layout qualifier for uniforms This is a complete implementation of the uniform location layout qualifier. Uniform location set in the shader is plumbed to shader linking, which does several link-time checks for conflicts and recursively applies the location to struct members. Validate that location is consistent as specified in the table in section 9.2.1 of the ESSL 3.10.4 spec. The location set in the shader overrides the one set via the CHROMIUM_bind_uniform_location API. Location conflicts must be checked even if the uniforms are not statically used. Because of this unused uniforms are now recorded during uniform linking. After linking checks are done, unused uniforms are pruned from the program state. Location is validated against the maximum number of uniform locations at compile time as specified in section 4.4.3 of the ESSL 3.10.4 spec. All dEQP uniform location tests don't yet pass due to unrelated bugs. BUG=angleproject:1442 TEST=angle_end2end_tests, dEQP-GLES31.functional.uniform_location.* Change-Id: I1f968e971f521fbc804b01e1a7c2b4d14f24d20f Reviewed-on: https://chromium-review.googlesource.com/447942 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Jamie Madill a818c327 2017-01-03T13:48:05 translator: Remove non-sh scoped APIs. Now that Chromium is switched over, we can remove the old global APIs so they no longer conflict with glslang/Vulkan. BUG=angleproject:1319 Change-Id: Ia673d47caa7ca40139e4989fac374acd48f52ab9 Reviewed-on: https://chromium-review.googlesource.com/408517 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: 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>
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 acb4b81a 2016-11-07T13:50:29 translator: Put ShaderLang APIs in "sh" namespace. Working with glslang in Vulkan means we are static linking libANGLE with functions that have the same name as our translator APIs. We can fix this by scoping our APIs. We don't need to scope the types of the file, since they don't conflict. This will require a follow-up patch to remove the unscoped APIs once we switch over Chromium. We also scope TCompiler and some related classes to avoid multiply defined link errors with glslang. BUG=angleproject:1576 Change-Id: I729b19467d2ff7d374a82044b16dbebdf2dc8f16 Reviewed-on: https://chromium-review.googlesource.com/408337 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 08e229e7 2016-10-05T17:16:13 translator: Return null uniform map if no HLSL. This replaces the global empty map. BUG=angleproject:1459 Change-Id: If7d824cbf4492e722cbf99d1045402a26535af5c Reviewed-on: https://chromium-review.googlesource.com/394236 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Qiankun Miao 7ebb97fc 2016-09-08T18:01:50 Use 64-bits compile options BUG=chromium:645071 Change-Id: I31825123bf4cb45fb37a93f538e8936487beb5ff Reviewed-on: https://chromium-review.googlesource.com/382712 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Martin Radev 4c4c8e72 2016-08-04T12:25:34 Add compute program compilation and linking support Compute shaders can be now compiled and linked to create programs. Some tests are added to verify successful and unsuccessful compute shader linking. The patch also replaces std::array<int, 3> with a custom struct WorkGroupSize. BUG=angleproject:1442 TEST=angle_end2end_tests TEST=angle_unittests Change-Id: I4ab0ac05755d0167a6d2a798f8d7f1516cf54d84 Reviewed-on: https://chromium-review.googlesource.com/366740 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Olli Etuaho <oetuaho@nvidia.com> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
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>
Corentin Wallez aae1e4ae 2016-08-01T09:44:09 ShCheckVariablesWithinPackingLimits: remove deprecated overload BUG=621031 Change-Id: Ib4cdd88ecd58f617813a91379a8b8b518fba149b Reviewed-on: https://chromium-review.googlesource.com/364910 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Corentin Wallez e58e1416 2016-07-18T16:40:46 ShCheckVariablesWithinPackingLimits add sh::ShaderVariable overload This overload doesn't take a stripped down version of the variable information, which makes it possible to handle varying structs correctly by flattening them as individual variables. BUG=621031 Change-Id: I367629fce3d17dd7e1f876c5937eb37f3d97c7f4 Reviewed-on: https://chromium-review.googlesource.com/361460 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Corentin Wallez <cwallez@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>
Olli Etuaho 9696316d 2016-03-21T11:54:33 Support ESSL structs containing samplers on D3D Since HLSL can't natively handle samplers in structs, samplers need to be extracted out of structs into separate variables in the translated shader code. In HLSL 4.1, samplers that were in structs go into the normal sampler arrays and are identified by index constants. In other HLSL versions, samplers that were in structs are translated as uniform variables. These transformations are done inside the HLSL output classes, not as tree transformations. This helps to keep the uniform API provided by the shader translator intact. Wherever a struct containing samplers is passed into a user-defined function, the translated HLSL code passes the separate sampler variables alongside a struct where the samplers have been removed. The D3D backend in libANGLE queries the uniform registers of any samplers that were in uniform structs, and adds them to the register maps, so that correct sampler state gets assigned to them. The extracted sampler variables are prefixed with "angle_" instead of the usual "_" to prevent any name conflicts between them and regular variables. BUG=angleproject:504 TEST=angle_end2end_tests, dEQP-GLES*.functional.shaders.struct.uniform.* (all pass), dEQP-GLES*.functional.uniform_api.* (most now pass) Change-Id: Ib79cba2fa0ff8257a973d70dfd917a64f0ca1efb Reviewed-on: https://chromium-review.googlesource.com/333743 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Olli Etuaho 19d1dc99 2016-03-08T17:18:46 Add option to limit the number of function parameters Trying to compile user-defined functions that have thousands of parameters introduces some instability in native compilers, so it is better to reject shaders with large numbers of function parameters in ANGLE. The check is only enabled if the SH_LIMIT_EXPRESSION_COMPLEXITY flag is turned on. The default limit for the number of parameters is 1024, but it can also be configured. BUG=angleproject:1338 TEST=angle_unittests Change-Id: I5c9b7a4e97e67f36e77f969368336fa8fffba1c3 Reviewed-on: https://chromium-review.googlesource.com/331970 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Corentin Wallez 700ad289 2015-12-07T15:57:47 Don't crash when calling ShConstructCompiler with a wrong output BUG=angleproject:446 Change-Id: Ic1c326f79105950e5c3eb8724eba12fca187a2ec Reviewed-on: https://chromium-review.googlesource.com/316610 Tryjob-Request: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Corentin Wallez <cwallez@chromium.org>
Jamie Madill a0a9e12d 2015-09-02T15:54:30 translator: Add sh::OutputVariable type. This replaces the dual-use of sh::Attribute, which can be a bit confusing to people expecting a literal output variable. Currently not used in Chromium, so should be safe to land. BUG=angleproject:1146 Change-Id: I436f2bc9dc4ddc3709369cb2baa344c6b13a21a2 Reviewed-on: https://chromium-review.googlesource.com/296683 Reviewed-by: Kenneth Russell <kbr@chromium.org> Reviewed-by: Zhenyao Mo <zmo@chromium.org> Tested-by: Jamie Madill <jmadill@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>
Dmitry Skiba 2539fffa 2015-06-16T17:56:09 Add ShClearResults() for clearing last compilation results. This helps reclaiming memory used by the results when we don't need them anymore. BUG=492725 Change-Id: I4bc11be27b23589548120f0dc43e9979bf894089 Reviewed-on: https://chromium-review.googlesource.com/277808 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Dmitry Skiba <dskiba@google.com> Tested-by: Dmitry Skiba <dskiba@google.com> Reviewed-by: Dmitry Skiba <dskiba@google.com>
Daniel Bratell 73941deb 2015-02-25T14:34:49 Disable the HLSL code in Angle if it is not being used. We're only using the HLSL code in Windows so it's not necessary to compile and distribute it on other platforms. This adds a defined ANGLE_ENABLE_HLSL that can be checked in files that are used by non-HLSL code as well. Mostly the HLSL code is just not include by the build system. Details of the space savings (heavily truncated) Total change: -165717 bytes =========================== -606 - Source: angle/src/common/utilities.cpp -627 - Source: angle/src/compiler/translator/FlagStd140Structs.cpp -695 - Source: /usr/include/c++/4.8/bits/stl_algo.h -710 - Source: angle/src/compiler/translator/TranslatorHLSL.cpp -713 - Source: angle/src/compiler/translator/IntermNode.h -863 - Source: /usr/include/c++/4.8/bits/stl_map.h -935 - Source: angle/src/compiler/translator/blocklayout.cpp -1515 - Source: angle/src/compiler/translator/BuiltInFunctionEmulator.cpp -1655 - Source: angle/src/compiler/translator/UnfoldShortCircuit.cpp -2375 - Source: /usr/include/c++/4.8/bits/vector.tcc -3135 - Source: angle/src/compiler/translator/RewriteElseBlocks.cpp -4656 - Source: angle/src/compiler/translator/UtilsHLSL.cpp -5265 - Source: angle/src/compiler/translator/BuiltInFunctionEmulatorHLSL.cpp -6505 - Source: /usr/include/c++/4.8/bits/stl_tree.h -11480 - Source: angle/src/compiler/translator/UniformHLSL.cpp -13580 - Source: angle/src/compiler/translator/StructureHLSL.cpp -18964 - Source: ?? (constant strings and a few vtbls) -89332 - Source: angle/src/compiler/translator/OutputHLSL.cpp Change-Id: I23ccc98abd0a21f847dd34f9482800b3ba679d56 Reviewed-on: https://chromium-review.googlesource.com/251528 Tested-by: bratell at Opera <bratell@opera.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
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>
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 4de44cb6 2014-10-29T18:03:46 Change ShaderLang APIs from c style to c++ style. BUG=angle:816 TEST=gpu_unittests,angle_unittests,webgl_conformance Change-Id: I0b46c11f6055a82511bb946a6dc491360835526e Reviewed-on: https://chromium-review.googlesource.com/226410 Reviewed-by: Zhenyao Mo <zmo@chromium.org> Tested-by: Zhenyao Mo <zmo@chromium.org>
Zhenyao Mo 409078f1 2014-10-28T13:23:18 Remove ShGetVariableInfo() and related code. BUG=angle:775 TEST=chromium builds and runs fine Change-Id: Ic62d3a3c9a8f034880b77a96f7f1c6be2691985e Reviewed-on: https://chromium-review.googlesource.com/226004 Tested-by: Zhenyao Mo <zmo@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shannon Woods <shannonwoods@chromium.org>
Kimmo Kinnunen 7c1cfd61 2014-10-15T14:59:57 Make ShBuiltInResources comparable with memcmp Chromium builds a std::map with ShBuiltInResources as part of the key. Comparator for == and < are needed for the map implementation. Currently Chromium uses memcmp as the comparator. Padding in ShBuiltInResources causes uninitialized reads. Fix this by clearing the padding with memset during ShBuiltInResources initialization. Change-Id: I78aa3c59ce165503831aa2a67c96cf8af316c152 Reviewed-on: https://chromium-review.googlesource.com/223431 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Shannon Woods <shannonwoods@chromium.org>
Olli Etuaho e61209af 2014-09-26T12:01:17 Add option to support EXT_draw_buffers with NV_draw_buffers After this patch, it is possible to set a flag to change EXT_draw_buffers extension directives to NV_draw_buffers in ESSL. This enables users of ANGLE to emulate EXT_draw_buffers by using NV_draw_buffers in combination with GLES3.0. Change-Id: I5dacdbd6cd0d0362424ea3791557342c42efd4bd Reviewed-on: https://chromium-review.googlesource.com/219941 Reviewed-by: Olli Etuaho <oetuaho@nvidia.com> Tested-by: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill e294bb87 2014-07-17T14:16:26 Add new shader inspection APIs. Each new entry point corresponds to one of the variable types: varyings, attributes, uniforms, output variables, and interface blocks. They return a pointer to the vector with all of the parsed variables, which then the app can copy to its own memory. Currently we do not support the staticUse field in the HLSL translator. BUG=angle:466 Change-Id: I7dc09e761ab070feef5360ad27740110c44853b3 Reviewed-on: https://chromium-review.googlesource.com/208750 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Zhenyao Mo <zmo@chromium.org> Reviewed-by: Nicolas Capens <capn@chromium.org>
Jamie Madill a3fe2b4e 2014-07-18T10:33:13 Update non-default constructors in shadervars.h. Most of these constructors are unused. Remove the unused ones, and change the usage of existing constructors to be consistent. BUG=angle:466,697 Change-Id: I455dd314036e1dfcb8c4690bab577b81dd0e060c Reviewed-on: https://chromium-review.googlesource.com/208355 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Nicolas Capens <capn@chromium.org>
Jamie Madill 9fe25e9e 2014-07-18T10:33:08 Add a uniform register query to the translator. This returns the uniform index that we assigned for default uniforms. All the dependent structure offsets can be determined from the base register, so we won't have to store uniform information in the shader variable. BUG=angle:466 Change-Id: I0dd05251e8dba00c20d09fd865dfb150de56738e Reviewed-on: https://chromium-review.googlesource.com/207254 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Zhenyao Mo <zmo@chromium.org> Reviewed-by: Nicolas Capens <capn@chromium.org>
Jamie Madill 4e1fd412 2014-07-10T17:50:10 Store a map of interface block registers. The shader translator can return the assigned register for a block via a new API. This will let us delete the member variable in interface blocks for the register -- a nice thing for GLSL. BUG=angle:466 Change-Id: I9bc38e0cd031e32f90787be42c2324fc7c79dbf9 Reviewed-on: https://chromium-review.googlesource.com/206828 Reviewed-by: Zhenyao Mo <zmo@chromium.org> Reviewed-by: Nicolas Capens <capn@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 23a8a433 2014-07-09T13:27:42 Store compact and expanded shader variables. The current shader API ShGetVariableInfo relies on an expanded list of shader variables. That means that struct, or user-defined variables, are expanded into separate entries for the app to easily query struct members. The new API will preserve the struct layout, so we can store both to support both the old and new queries. BUG=angle:466 Change-Id: Id30a1d7d1bb49c7e745510e0d699f94ad3184b9c Reviewed-on: https://chromium-review.googlesource.com/206569 Reviewed-by: Zhenyao Mo <zmo@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Nicolas Capens <capn@chromium.org>
Jamie Madill 47cdb2aa 2014-07-03T16:05:38 Allow ConvertPrecision to return undefined. The overly-restrictive check would fail on sampler types or other GL types with no defined precision. This fixes failures on the Debug GPU FYI bots. BUG=angle:691 Change-Id: I443b7038a7b7a05675898b9b21e6112b1ac4c5ca Reviewed-on: https://chromium-review.googlesource.com/206552 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 1da63af4 2014-07-03T15:00:53 Fix ConvertPrecision. This method had never been fully implemented, and was returning "highp" for every case value. This should fix problems with the GPU FYI bots. BUG=angle:691 Change-Id: Ie6ffa80cf2c063e506df06fb25d622227edeffa3 Reviewed-on: https://chromium-review.googlesource.com/206565 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Nicolas Capens <capn@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill ed27c729 2014-07-02T15:31:23 Consolidate shader variable storage in Compiler. The Compiler base class now stores all the shader variables and interface block information, instead of duplicating the information in the HLSL translator. BUG=angle:466 Change-Id: Ia69079fde64fbd6b0cbfc66defd5e37d99ee3e6e Reviewed-on: https://chromium-review.googlesource.com/206020 Reviewed-by: Zhenyao Mo <zmo@chromium.org> Reviewed-by: Nicolas Capens <capn@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill a718c1e0 2014-07-02T15:31:22 Use shader variable types for variable collection. Retire the old TVariableInfoList structure, and use the new objects which we will expose more directly through the API. BUG=angle:466 Change-Id: I999a97369bfb67cf73cd659c4fe885b41429d304 Reviewed-on: https://chromium-review.googlesource.com/205839 Tested-by: Jamie Madill <jmadill@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>
Jamie Madill d4a3a317 2014-06-25T16:04:56 Rename ShHandle.h to Compiler.h. Since the above source file matches Compiler.cpp, more closely follow our standard naming convention. BUG=angle:466 Change-Id: Ib1422f87f16097f91f2bcdad550ec5bd940ce711 Reviewed-on: https://chromium-review.googlesource.com/204681 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Jamie Madill 68fe74aa 2014-05-27T12:56:01 Add a compiler query for the translator output type. This is useful for determining if we are compiling to a D3D9 or D3D11 shader outside of the internal translator classes. BUG=angle:656 Change-Id: Ib1c1d3de569edaa2b65c24c09d05aa4dd229d3e4 Reviewed-on: https://chromium-review.googlesource.com/201564 Reviewed-by: Nicolas Capens <nicolascapens@chromium.org> Reviewed-by: Shannon Woods <shannonwoods@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Shannon Woods 2d76e5f6 2014-05-16T17:46:41 Adds resource string generation to ANGLE This will avoid Chrome source having to be updated each time that ANGLE's ShBuiltInResources changes. BUG=374942 Change-Id: If54dba8351de9b261ff269e885f231547c08ff0a Reviewed-on: https://chromium-review.googlesource.com/200171 Reviewed-by: Kenneth Russell <kbr@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Nicolas Capens <nicolascapens@chromium.org> Tested-by: Shannon Woods <shannonwoods@chromium.org>
Geoff Lang f20f0206 2014-04-28T11:02:07 Verify that the compiler has been initialized before freeing it. BUG=angle:625 Change-Id: I8bba0dea26eacf02df4568cfb6840aa332bd0df8 Reviewed-on: https://chromium-review.googlesource.com/197655 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Zhenyao Mo 7faf1a14 2014-04-25T18:03:56 Fix a mem corruption in ANGLE translator. Basically outside TCompile::compile(), the global parse context is invalid, and should never be queried. BUG=angle:568 TEST=webgl conformance tests, no crash Change-Id: I5573ce2bf3bf838ab24f59dda00948f60a0b023d Reviewed-on: https://chromium-review.googlesource.com/197178 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org> Tested-by: Zhenyao Mo <zmo@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>
Geoff Lang cebb5aa0 2014-04-07T14:13:40 Fix warnings about unreferenced local variables. BUG=angleproject:602 Change-Id: I2eb04fe6eed60b3877b14628e81c0b1fe3b68647 Reviewed-on: https://chromium-review.googlesource.com/193431 Tested-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Shannon Woods <shannonwoods@chromium.org>
Jamie Madill 477bc781 2014-02-26T09:54:17 Fix crash on multiple calls to ShInitialize(). The previous fix would allow the calling app to trigger an ASSERT if it did not first call ShFinalize. Chrome would do this in some cases, causing a test failure. BUG=344043 Change-Id: I33fa0c4668dac8750ca949febc7f02cc7d3d95e7 Reviewed-on: https://chromium-review.googlesource.com/187849 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Shannon Woods <shannonwoods@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill b4d192cd 2014-02-26T09:54:10 Re-initialize shader translator properly after one shutdown. Because of a local static, we could get stuck and never re-initialize the translator after calling ShFinalize. BUG=344043 Change-Id: Ib4d18da886eac28f3e1bc959a7eadf5b34d9410f Reviewed-on: https://chromium-review.googlesource.com/186975 Reviewed-by: Nicolas Capens <nicolascapens@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/187848
Jamie Madill 5508f39d 2014-02-20T13:31:36 Fix breaking the build with missing GetGlobalMaxTokenSize. Because the preprocessor is used independently from the compiler, we need a way to track max token size when we don't have access to the parse context with the current spec. BUG=angle:550 Change-Id: Idf5035ec2c001ee75f264151ab3c4e92f3cd44d7 Reviewed-on: https://chromium-review.googlesource.com/187140 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Shannon Woods <shannonwoods@chromium.org> Reviewed-by: Nicolas Capens <nicolascapens@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 88f6e946 2014-02-19T10:27:53 Proper support for token max size in WebGL+ES3. WebGL specifies a maximum token size of 256 characters, while ES3 specifies 1024 characters. We can determine the proper max size to support from the spec. BUG=angle:550 Change-Id: I6aeabe8af3b6184a27b456248ce2f84f361b76e4 Reviewed-on: https://chromium-review.googlesource.com/186973 Reviewed-by: Shannon Woods <shannonwoods@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Nicolas Capens 7d649a00 2014-02-07T11:24:32 Fix initializing the MaxExpressionComplexity and MaxCallStackDepth compiler limits. BUG=339860 Change-Id: I64600db4bef62236c6acd8728902471df06a8f0a Reviewed-on: https://chromium-review.googlesource.com/185380 Tested-by: Nicolas Capens <nicolascapens@chromium.org> Reviewed-by: Shannon Woods <shannonwoods@chromium.org>
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.