src/compiler/translator/SymbolTable_autogen.cpp


Log

Author Commit Date CI Message
Shahbaz Youssefi d469dcb1 2021-05-06T15:13:42 Translator: remove image2DRect There is no such thing as image2DRect in GLSL. imageRect (the right type) is present, but the code was mistakenly using image2DRect. Bug: angleproject:4889 Change-Id: I42bacd2ad8866c715af0d9711bebc95897607354 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2878095 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 1f8e35b5 2021-04-09T12:29:22 Remove EvqBaseVertex and EvqBaseInstance qualifiers They are only used to mark angle_BaseVertex and angle_BaseInstance uniforms, but they make it complicated for the rest of the code to identify them as uniforms. Bug: angleproject:4889 Change-Id: I0c632bb595dc9a7fcda19db11ecb27539b1c33e6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2818144 Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Alexey Knyazev 54294c9a 2021-03-02T22:15:05 Partially upgrade codegen to Python 3 Bug: angleproject:5707 Change-Id: I4e26c2c7ba4a36185b28ecd6e87be1161b60431a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2729567 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Mohan Maiya 550f2a3e 2021-02-24T09:49:42 Vulkan: Shader support for EXT_shader_framebuffer_fetch_non_coherent Translator can accept gl_LastFragData and 'inout' variable to gain access to framebuffer attachment data. The Vulkan translator replaces it with the SubpassInput type variable. Note that this works only for the noncoherent version of the extension. Bug: angleproject:5454 Test: *EXTShaderFramebufferFetchNoncoherent*.* Change-Id: I392f84ee3ad3eb9fbd09d0b7ff83731a9a3f33f6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2598060 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Mohan Maiya <m.maiya@samsung.com>
Shahbaz Youssefi 5e0a8f9b 2021-01-27T13:46:08 Translator: Enable geometry and tessellation in ES3.2 Symbols that these extensions introduced were only accepted if the extension directive was present. This is not necessary for es 320 shaders. This change adds a new tag to builtin variable and function declarations in the translator, namely "essl_extension_becomes_core_in" which makes gen_builtin_symbols.py automatically create two entries for the builtin; one with the specified level and extension, one with the core level and without extension. Entries in builtin_function_declarations.txt can potentially be deduplicated as a follow up to take advantage of this tag, though likely an anologous "glsl_extension_becomes_core_in" needs to be introduced. Bug: angleproject:5557 Bug: angleproject:5579 Change-Id: I84c19f48a3ccc89d82d80a4f35f7833205bbc88f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2649449 Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Mohan Maiya 8f9e17d5 2020-12-14T14:11:11 Add EXT_clip_cull_distance extension autogen code Addition of shader autogen code for EXT_clip_cull_distance extension. Bug: angleproject:5458 Change-Id: I299528957c0e747fd84987c420588c314f54aae0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2590989 Commit-Queue: Mohan Maiya <m.maiya@samsung.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Mohan Maiya 8a401051 2020-11-19T07:58:05 Vulkan: Support OES_sample_variables extension Enable OES_sample_variables extension on Vulkan backend. Add support for built-in variables, uniform state and constants - gl_SampleId, gl_SamplePosition, gl_SampleMask, gl_SampleMaskIn - gl_NumSamples - gl_MaxSamples Bug: angleproject:3588 Tests: dEQP-GLES31.functional.shaders.sample_variables.* KHR-GLES31.core.sample_variables.* Change-Id: Idf37c7b4ccb0331dbda7acd6389ff4e1022ba959 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2477907 Commit-Queue: Mohan Maiya <m.maiya@samsung.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Mohan Maiya 738092ae 2020-11-18T07:58:53 Add auto generated code for GL_EXT_tessellation_shader To support tessellation, code and auto generated code are added. Entry points function, ShaderTypes, built in variables and constants, builtin function barrier and patch keyword are added. Bug: angleproject:3572 Change-Id: Ia5fe473e884466cb88cea7138e13377a1d7b4fa0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2538393 Commit-Queue: Mohan Maiya <m.maiya@samsung.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Jamie Madill aca3d408 2020-11-05T20:53:37 Fix return value of cube map array imageStore. Should be void according to the spec. Noticed while working on texture buffer. Bug: angleproject:3584 Change-Id: I79a671c82fa117bab69bc2e6b35c840aa30429c5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2521241 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Jamie Madill 43acf3ba 2020-07-31T15:43:57 GL: Compiler changes for GL_OES_texture_buffer This extension is core in GLES 3.2 This CL enables the extension, added 412 new dEQP tests for texture buffer. 410 of these tests pass, but there are two tests that fail, detailed in anglebug.com/4933 Also includes a fix for completeness checks. Based on a CL by Jonah Ryan-Davis. Bug: angleproject:3573 Bug: angleproject:4933 Change-Id: I45759d765c88c64f21b592eab01d910dc4bc8da3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2521239 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Mohan Maiya e895ced6 2020-10-29T09:06:00 Vulkan: Add OES_shader_image_atomic support Add support for shader builtins and enable the extension. Bug: angleproject:3578 Tests: dEQP-GLES31.functional.*image_atomic* Change-Id: Idd45b2ee62efe1474c6c5947c77da64ff2221bf6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2505540 Commit-Queue: Mohan Maiya <m.maiya@samsung.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Mohan Maiya 553726a4 2020-10-20T11:29:17 Vulkan: Add OES_shader_multisample_interpolation extension Addition of 'sample' qualifier keyword and 'interplateAt*' fragment shader builtin functions with autogen Bug: angleproject:3589 Change-Id: If358eb371fbcefffa715c8da4ba5e96eefaf6f52 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2477904 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Geoff Lang 7e815c77 2020-07-08T13:43:40 Implement EXT_shadow_samplers Bug: angleproject:4863,b/161716126 Change-Id: I6beb45d91f59a851787c9f40b40266fb985198d5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2288330 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: back sept 10 - Jamie Madill <jmadill@chromium.org>
Jonah Ryan-Davis eadc387c 2020-04-01T16:53:31 GL: Support GL_OES_texture_cube_map_array in shader translator GL_OES_texture_cube_map_array is core in 3.2. This CL adds support for this extension in the shader translator. Now passes dEQP.KHR_GLES31/core_texture_cube_map_array.*, dEQP.GLES31/functional_fbo_color_texcubearray_*, and dEQP.GLES31/functional_opaque_type_indexing*samplercubearray* with GL backend. Bug: angleproject:3584 Change-Id: I1a8485c7d9d3fffb9b5109d292b35b0c56a3c665 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2133086 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jonah Ryan-Davis <jonahr@google.com>
Le Hoang Quyen dadd1986 2020-04-21T01:50:00 Implement GL_APPLE_clip_distance - Built-in variable gl_ClipDistance has been added to compiler. - Desktop GL: gl_ClipDistance is supported since GL 3.0. Enable/Disable each gl_ClipDistances[i] works out of the box via glEnable(). - Vulkan/Metal: Use uniform variable to control writing to each gl_ClipDistance. One bit flag controls one element in the gl_ClipDistance array. The writing to the disabled element in vertex shader will be ignored, and turned into zero assignment instead. - Direct3D/Mobile GL: Not implemented yet. - Added ClipDistanceTest to gl_tests and compiler unittests. - GL_APPLE_clip_distance is a subset of GL_EXT_clip_cull_distance, so GL_EXT_clip_cull_distance could be implemented in future if needed. Bug: angleproject:4452 Change-Id: I571ac8b56826989808a680226a04bec4cf59988e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2084324 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi 5a7356ae 2020-01-16T23:22:31 Add support for non-float mix The non-float variations of the mix builtin were conditioned to desktop GLSL, but they are present in ESSL 3.1+. This change also implements constant folding of these builtins as exercised by dEQP. Bug: angleproject:4300 Change-Id: Iec34de4cf370e00d67fd605148cd7848f9e122f8 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2006809 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Shahbaz Youssefi beb33691 2019-12-20T16:15:20 Vulkan: EXT_gpu_shader5: Fix textureGatherOffsets builtin This function is the only builtin with arrays as parameter. A new constexpr constructor is added to TType to support this, and gen_builtin_symbols is changed to emit the correct type for offsets parameter of this function. Bug: angleproject:3569 Change-Id: I55af58b43f24cd605c622ee685b359535e11ef85 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1975431 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 4b80fbc8 2019-12-18T23:40:15 Fix textureGatherOffsets classification sampler2DRect was placed under ESSL while sampler2DArrayShadow was placed under desktop GLSL. They are swapped. Bug: angleproject:3569 Change-Id: Ibf39868d4cd702d9d1da7fc286171bb70b80d6df Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1975430 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Yan 17b3c2f3 2019-10-14T14:13:59 Implement SamplerVideoWEBGL for WEBGL_video_texture extension on desktop WEBGL_video_texture is an extension that will improve uploading video frame to WebGL performance. (https://www.khronos.org/registry/webgl/extensions/proposals/WEBGL_video_texture/) This extension introduced a new texture type TEXTURE_VIDEO_IMAGE_WEBGL and a new sampler type samplerVideoWEBGL to sample it. In chromium implementation, TEXTURE_VIDEO_IMAGE_WEBGL maps to different native texture type based on platform. On desktop, it maps to GL_TEXTURE2D(Currently supported). On Android, it should map to GL_TEXTURE_EXTERNAL(TODO). SamplerVideoWEBGL needs to be mapped to sampler2D or samplerExternalOES according to TEXTURE_VIDEO_IMAGE_WEBGL implementation. This patch implements samplerVideoWEBGL in Angle to support WEBGL_video_texture on desktop. In this case, samplerVideoWEBGL should map to sampler2D. Bug: chromium:776222, angleproject:3889 Change-Id: Idb0a5fcde37ca75ccc1181226b91f257212e7500 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1866274 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Shahbaz Youssefi 19868b7e 2019-12-13T14:29:57 Restructure textureGatherOffset* builtin declarations This is in preparation of textureGatherOffsets support. Bug: angleproject:3569 Change-Id: I4ce5a1e102790181c8f843735961b9c249a69221 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1965720 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 9af3e137 2019-12-05T15:35:33 Vulkan: EXT_gpu_shader5 support: fma Add the fma() builtin function to ESSL. Bug: angleproject:3569 Change-Id: Ic8419b4c117ecdd8b47aa733bf7aff9ee7579bbf Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1954484 Reviewed-by: Jiajia Qin <jiajia.qin@intel.com> Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Tobin Ehlis 240befe5 2019-11-15T14:40:31 Add support for gl_HelperInvocation Added HelperInvocation to builtin_variables.json, regenerate the codegen portions of compiler, and plumb support for HelperInvocation through the rest of the compiler. Skipping some fails on Android and Swiftshader for this initial change and will debug/fix those issues in a follow-on. Bug: angleproject:4110 Change-Id: I781a2782ace84200bc615a2cc26b908a62e2aa26 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1922061 Commit-Queue: Tobin Ehlis <tobine@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill a905cbcd 2019-09-19T23:05:39 Compact built-in symbol table. Should reduce the binary size bloat from the perfect hashing. Local testing on Windows shows a significant size reduction. Bug: chromium:998535 Change-Id: I411cc5a917036d2239d15353d760f44e40faa26c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1814725 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com>
Jamie Madill c37d2370 2019-09-19T18:54:40 Reland "Refactor built-in symbol table." This is a reland of 59d982c0dcad580ccbf4e29f32ffa3ea9a280122 Original change's description: > Refactor built-in symbol table. > > In preparation for reducing binary size. Shortend a bunch of strings > and symbol prefixes so the autogen file will be more compact. > > Bug: chromium:998535 > Change-Id: If1bedaaacc06dce9678d432055ffa0c9215a8dbd > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1814724 > Reviewed-by: Tim Van Patten <timvp@google.com> > Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> > Commit-Queue: Jamie Madill <jmadill@chromium.org> Bug: chromium:998535 Change-Id: Iebc5b1b5e1a084257fba3c50026cc62df5a879b3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1817499 Reviewed-by: Zhenyao Mo <zmo@chromium.org> Commit-Queue: Zhenyao Mo <zmo@chromium.org>
Zhenyao Mo f585c2fb 2019-09-21T02:12:37 Revert "Refactor built-in symbol table." This reverts commit 59d982c0dcad580ccbf4e29f32ffa3ea9a280122. Reason for revert: crbug.com/1006501 Original change's description: > Refactor built-in symbol table. > > In preparation for reducing binary size. Shortend a bunch of strings > and symbol prefixes so the autogen file will be more compact. > > Bug: chromium:998535 > Change-Id: If1bedaaacc06dce9678d432055ffa0c9215a8dbd > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1814724 > Reviewed-by: Tim Van Patten <timvp@google.com> > Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> > Commit-Queue: Jamie Madill <jmadill@chromium.org> TBR=timvp@google.com,jonahr@google.com,jmadill@chromium.org Change-Id: Ie540da8ea4429e075a3284183e5a004cbcf1307b No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: chromium:998535,chromium:1006501 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1817497 Reviewed-by: Zhenyao Mo <zmo@chromium.org> Commit-Queue: Zhenyao Mo <zmo@chromium.org>
Jamie Madill 59d982c0 2019-09-19T18:54:40 Refactor built-in symbol table. In preparation for reducing binary size. Shortend a bunch of strings and symbol prefixes so the autogen file will be more compact. Bug: chromium:998535 Change-Id: If1bedaaacc06dce9678d432055ffa0c9215a8dbd Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1814724 Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
shrekshao cd31f286 2019-06-25T14:22:41 Implement Draw base vertex and base instance functions This patch implements functionality of glDrawArraysInstancedBaseInstanceANGLE, glDrawElementsInstancedBaseVertexBaseInstanceANGLE, glMultiDrawArraysInstancedBaseInstanceANGLE, and glMultiDrawElementsInstancedBaseVertexBaseInstanceANGLE Workaround for OpenGL driver on Mac: gl_VertexID on Mac with AMD GPU doesn't include baseVertex value. So replace gl_VertexID with (gl_VertexID + angle_BaseVertex) if any. Workaround for Vulkan GLSL: gl_InstanceIndex on Vulkan includes baseInstance. So replace gl_InstanceIndex with (gl_InstanceIndex - angle_BaseInstance) when angle_BaseInstance is declared. Bug: chromium:891861, angleproject:3402 Change-Id: Ia1d94b5d4d7da7e635468c05c962c4f7eb1b1919 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1750126 Commit-Queue: Shrek Shao <shrekshao@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Clemen Deng d7d42540 2019-08-21T15:22:49 Don't build symbol table for GLSL built-ins if on Android The GLSL + ESSL autogenerated symbol table is too large for android, and android also doesn't need desktop GL functionality If on android, compile the ESSL only symbol table Bug: chromium:996286 Change-Id: I14dfc7748dae389e78c35f82a390c67962665356 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1757372 Commit-Queue: Clemen Deng <clemendeng@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Clemen Deng 56db3789 2019-08-01T17:09:53 Use flat arrays instead of switches for function lookups Current implementation of built in function lookup uses autogenerated switch statements. Instead, use the perfect hash mapping to have the lookup use arrays instead. This will improve runtime performance. Bug: angleproject:3805 Change-Id: I6d0ba62d79abd53a7fe818fe675282800781f256 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1756883 Commit-Queue: Clemen Deng <clemendeng@google.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Clemen Deng 05744c23 2019-08-21T16:21:30 Change gl_DrawID from level = ESSL1+ESSL3 to COMMON Built in variable gl_DrawID is exposed to ESSL1 with a suffix, when the variable is the exact same. No need to do this. Bug: angleproject:3805 Change-Id: I63c71791bb6a0e8aa7b644171a3f5a81099eddc0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1762359 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Clemen Deng <clemendeng@google.com>
Jonah Ryan-Davis 396527c9 2019-08-20T13:48:38 Autogenerated kFunction* variables detected as mutable constants The android binary size is increased incorrectly because the autogen kFunction* variables are detected as mutable constants. Rename them to function* to workaround this. Bug: angleproject:3823 Change-Id: Ia335d1ae97ce5276a0ff8b9e432b53181cc36680 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1762494 Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jonah Ryan-Davis <jonahr@google.com>
Clemen Deng 213ad6bd 2019-08-16T16:31:32 Get rid of gl_ViewID_OVR for ESSL1 Only use UInt gl_ViewID_OVR from ESSL3 OVR multiview should not be exposed in ESSL1 Bug: angleproject:3822 Change-Id: Ia9d6247e3a717b06db26f1d436e2b33336b12a7d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1759143 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Clemen Deng <clemendeng@google.com>
Clemen Deng bcae3828 2019-08-19T09:37:18 Auto-generated variables detected as mutable constants Need to rename kVar* variables to just var Bug: angleproject:3823 Change-Id: I34b9f4eec4ee7829d47dcac2f06f1acc6b35f867 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1758601 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Clemen Deng <clemendeng@google.com>
Clemen Deng 486f381f 2019-07-18T15:47:31 Add desktop GL built-in functions to symbol table Added GL built-in functions to symbol table autogeneration Built-in lookup now checks against spec and returns GL symbols when appropriate. Bug: angleproject:3719 Change-Id: I74786150f6063b40e13aebcb2eb9ea35e4ecaa53 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1731550 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Clemen Deng <clemendeng@google.com>
Clemen Deng 1d742ce8 2019-08-13T10:33:36 Deleted unnecessary built-in conditions A few built-in variables are checking against overly complicated extension conditions, deleting these will make the array lookup easier to implement. Also changed functionality to always enable GL_OVR_multiview when GL_OVR_multiview2 is enabled Bug: angleproject:3805 Change-Id: I10fc7db0fa8b496fbba8b2c27a7311ac3c24dbe4 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1752082 Commit-Queue: Clemen Deng <clemendeng@google.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Clemen Deng e7970c3e 2019-08-07T14:43:17 BasicMangledName class Need a class for basic mangled names since with the addition of GLSL types the number of basic types is > 52 (a-z, A-Z), so we need more than one character to represent a type Bug: angleproject:3719 Change-Id: I98beee9d42a016cb0c017f56ab82538c89212e33 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1742221 Commit-Queue: Clemen Deng <clemendeng@google.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Clemen Deng 9031bdd9 2019-07-26T14:51:23 Use perfect-hash module in gen_builtin_symbols.py The script currently takes ~4 minutes to run Using this module instead of manually hashing will improve runtime significantly Bug: angleproject:3747 Change-Id: I7e2d2ef5bbfd136b0299d571e0acc11f334c80b5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1724667 Commit-Queue: Clemen Deng <clemendeng@google.com> 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>
Jamie Madill c09ae15c 2019-02-01T14:16:32 Enable -Wextra-semi and -Wextra-semi-stmt. This will prevent users from accidentally making semicolon errors in the future. Bug: chromium:926235 Change-Id: I79a6fa376fb1ad8f0fcf1b65b1f572a035d1f4e9 Reviewed-on: https://chromium-review.googlesource.com/c/1446493 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Nico Weber <thakis@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Austin Eng 153e0224 2018-12-07T13:31:31 Add gl_DrawID emulation for ESSL3 with ANGLE_multi_draw Bug: chromium:890539 Change-Id: I3d9a9429608afb454f076013f3ed844e115c56cc Reviewed-on: https://chromium-review.googlesource.com/c/1368784 Reviewed-by: Kai Ninomiya <kainino@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Austin Eng <enga@chromium.org>
Geoff Lang fefaba5b 2018-10-26T16:16:53 Regenerate hashes for the builtin symbol table. BUG=chromium:890539 Change-Id: Ia5bdf652dc37a466560071b4fe2cdc7d89ff941f Reviewed-on: https://chromium-review.googlesource.com/c/1302837 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Austin Eng <enga@chromium.org> Commit-Queue: Geoff Lang <geofflang@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>
Jamie Madill 64b7c4ff 2018-10-19T11:38:04 Use angle::Result in front-end (Part 3) Handles the gl::Framebuffer class and its implementation. Bug: angleproject:2491 Change-Id: I3b9c0609e9277264ccdb370596500562df3b7d15 Reviewed-on: https://chromium-review.googlesource.com/c/1280743 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@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>
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>
Jiawei Shao a6a7842f 2018-06-28T08:32:54 ES31: Support atomic functions on D3D11 - Part I This patch is the first one of the implementation of atomic functions in D3D11. There are mainly two differences in the usage of GLSL and HLSL atomic functions: 1. All GLSL atomic functions have return values, which all represent the original value of the shared or ssbo variable; while all HLSL atomic functions don't, and the original value can be stored in the last parameter of the function call. 2. For HLSL atomic functions, the last parameter that stores the original value is optional except for InterlockedExchange and InterlockedCompareExchange. Missing original_value in the call of InterlockedExchange and InterlockedCompareExchange results in a compile error from HLSL compiler. To handle these differences, we plan to implement the translation in two steps: 1. Support direct translations from GLSL atomic functions to HLSL ones. Direct translation can only handle the following two situations: (1) The sentence is a GLSL atomic function call without requesting a return value and it is not atomicExchange or atomicCompSwap: e.g. GLSL: atomicAdd(mem, value); -> HLSL: InterlockedAdd(mem, value); (2) The sentence is a simple assignment expression: its right is a GLSL atomic function call and its left is a declared variable. e.g. GLSL: oldValue = atomicAdd(mem, value); -> HLSL: InterlockedAdd(mem, value, oldValue); 2. Support atomic functions in the situations that don't support direct translations. We will modify the intermediate tree to make direct translation work on all these situations. e.g. atomicExchange(mem, value); -> int oldValue; oldValue = atomicExchange(mem, value); int oldValue = atomicAdd(mem, value); -> int oldValue; oldValue = atomicAdd(mem, value); return atomicAdd(mem, value); -> int temp; temp = atomicAdd(mem, value); return temp; for (i = 0; i < atomicAdd(mem, value); ++i) -> int temp; temp = atomicAdd(mem, value); for (i = 0; i < temp; ++i) { ... temp = atomicAdd(mem, value); } int result = isTrue ? atomicAdd(mem, value) : 0; -> int result; if (isTrue) { result = atomicAdd(mem, value); } else { result = 0; } This patch completes Step 1 which mainly focus on the translation from GLSL atomic functions to HLSL ones. BUG=angleproject:2682 TEST=angle_end2end_tests Change-Id: I3b655b6e286dad4fd97f255f7fe87521c94db30c Reviewed-on: https://chromium-review.googlesource.com/1121835 Commit-Queue: Jiawei Shao <jiawei.shao@intel.com> Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Jamie Madill 4da0d315 2018-06-20T11:46:38 Vulkan: Handle embedded struct uniforms. Also known as nameless structs. Uniform structs without a struct name would not be parsed correctly. This fixes the bug by adding a tree transformation. The transformation gives an internally scoped name to the embedded struct. Bug: angleproject:2665 Change-Id: I43e4dad7d9ad64a40e382066bb136e4f8f719797 Reviewed-on: https://chromium-review.googlesource.com/1101566 Reviewed-by: Olli Etuaho <oetuaho@nvidia.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill f5557acc 2018-06-15T09:46:58 translator: Store symbol type in TField. This allows us to keep a separate symbol type for each field in a struct. This can allow us to assign internal names to struct types. It could also allow us to add internal fields to user defined stucts. Bug: angleproject:2665 Change-Id: I6a129107d9db66c54b98b07684c3ead5801712ba Reviewed-on: https://chromium-review.googlesource.com/1101565 Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Olli Etuaho 5fec7ab2 2018-04-04T11:58:33 Identify functions by unique id in BuiltInFunctionEmulator Now that unique ids of all builtins are compile-time constants, we can use them to look up functions in BuiltInFunctionEmulator. This is simpler than using a custom struct with the name and parameters for identifying functions. This requires that we store a reference to a TFunction in those TIntermUnary nodes that were created based on a function. This decreases shader_translator binary size by about 6 KB on Windows. BUG=angleproject:2267 BUG=chromium:823856 TEST=angle_unittests Change-Id: Idd5a00c772c6f26dd36fdbbfbe161d22ab27c2fe Reviewed-on: https://chromium-review.googlesource.com/995372 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Olli Etuaho 89398b65 2018-03-21T17:30:50 Avoid mangled name comparisons of 3-parameter functions The hash values used for looking up built-ins now encode whether the mangled name contains arrays, structs or interface blocks in its parameters list. This is written in the most significant bit of the hash value. We check this bit at the start of built-in lookup and if the bit is set we exit early. After that we know that the lookup name doesn't contain array, struct or interface block parameters. When we find a hash that matches a hash of a built-in function, we now know 3 things: 1) the length of the mangled name matches 2) the open parentheses in the mangled name matches 3) the lookup doesn't contain array, struct or block parameters. Additionally, we have an if statement checking whether the function name matches. Collisions are only possible with functions that 1) have the same name 2) have the same number of parameters With these preconditions we can check beforehand whether collisions are possible for 3-parameter functions. If there are no collisions, we don't need to compare the full mangled name. This is similar to what was already being done with functions that had 0 to 2 parameters. This reduces shader_translator binary size by around 4 KB on Windows. Besides increased complexity, the tradeoff is that an exhaustive search of hash values for possible 3-parameter combinations is costly, so the gen_builtin_functions.py code generation script now takes around one minute to run on a high-end workstation. Due to this, the script now exits early if it detects it has already been run with the same inputs based on a hash value stored in builtin_symbols_hash_autogen.txt. BUG=angleproject:2267 BUG=chromium:823856 TEST=angle_unittests Change-Id: I3ff8c6eb85b90d3c4971ac8d73ee171a07a7e55f Reviewed-on: https://chromium-review.googlesource.com/973372 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Olli Etuaho 3b678745 2018-03-21T12:59:19 Use a specialized hash function for mangled names The hash values used for looking up built-ins now encode the string length and the location of parentheses as six-bit values, so that we don't need to check for these if the hash matches. This decreases shader_translator binary size on Windows by around 10 KB. BUG=angleproject:2267 BUG=chromium:823856 TEST=angle_unittests Change-Id: If8c28e1c8851750633509ec6273f556e06e91cd1 Reviewed-on: https://chromium-review.googlesource.com/973243 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Olli Etuaho e79d0f86 2018-03-19T11:55:14 Rely on hash to check for some mangled name matches When we are looking up a function with only a few parameters, we can optimize the lookup by relying on the information encoded in the hash value. There's often only one list of parameters with the same function name and mangled name length that results in a matching hash, so we don't actually need to compare the full mangled name. We can just compare 1) the hash value of the mangled name 2) the mangled name length 3) the function name to make sure that the mangled name matches the mangled name of the function. This decreases the binary size since we don't need store as many mangled names of built-in functions. Effect on symbol lookup speed is marginal. BUG=angleproject:2267 BUG=chromium:823856 TEST=angle_unittests Change-Id: I3ef41d943209509d4e8e6ece14ebad7e2677abc6 Reviewed-on: https://chromium-review.googlesource.com/973242 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Olli Etuaho 4ba4a82b 2018-03-19T11:28:48 Only refer to built-in function mangled names in lookup TFunction entries for built-ins don't need to store mangled names. BUG=angleproject:2267 TEST=angle_unittests Change-Id: Ia88e8bfa5357719c98d725dc3d00885dd59c9f59 Reviewed-on: https://chromium-review.googlesource.com/973241 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Olli Etuaho 8574357f 2018-03-19T14:45:53 Share parameter arrays more between built-in functions The parameters of some built-ins are a subarray of the parameters of another built-in. In this kind of case they can point to the same parameters array, and just use a different parameter count. This shaves a few kilobytes from the binary size. BUG=angleproject:2267 TEST=angle_unittests Change-Id: Id166340b4bf5be966bf8c62ce6cd88e5409f647a Reviewed-on: https://chromium-review.googlesource.com/968601 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Olli Etuaho 115b2c4a 2018-03-15T17:46:29 Remove desktop GLSL builtins from symbol lookups Desktop GLSL builtins can be accessed through functions in BuiltIn_autogen.h. They don't need to be included in symbol table lookups. BUG=angleproject:2267 TEST=angle_unittests Change-Id: I8ba188a0d2584353e34159c2732c9e2bd420c168 Reviewed-on: https://chromium-review.googlesource.com/964447 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Olli Etuaho b391ec40 2018-03-12T17:04:59 Generate code for looking up built-ins Instead of storing built-ins in a std::unordered_map, we now generate a series of switch statements using the hash value of the look-up string. This works similarly to earlier implementation of looking up unmangled built-ins. Those built-ins that need to be initialized at run-time are stored as member variables of TSymbolTable. This increases compiler init performance significantly, as well as increasing compiler perf test scores around 1-2%. Binary size is larger than before though. BUG=angleproject:2267 TEST=angle_unittests Change-Id: If1dcd36f0d2b30c2ed315cdcf6e831ae9fe70c94 Reviewed-on: https://chromium-review.googlesource.com/960031 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Olli Etuaho d4bd963f 2018-03-08T16:32:44 Don't use TIntermSymbol nodes for function parameters Parameter nodes are not needed - it's simpler to just create a TVariable object for each parameter when the TFunction is initialized. With this change we also store only one object per each parameter type used in built-in functions, instead of one array of TConstParameter entries for each unique parameter sequence. This simplifies code and reduces binary size and compiler memory use. Compiler perf does not seem to be significantly affected. BUG=angleproject:2267 TEST=angle_unittests Change-Id: I2b82400dd594731074309f92a705e75135a4c82c Reviewed-on: https://chromium-review.googlesource.com/955589 Commit-Queue: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Olli Etuaho e600c0aa 2018-03-02T11:23:29 Use non-human-readable mangled names for types The new mangled name format is as follows: The first character is a hex digit from 0 to F that encodes vector or matrix size. For scalars, structs etc. the character is 0. Then, if it's a struct, the mangled name continues with "{s", followed by mangled names of fields, and ends with "}". If it's an interface block, the mangled name continues with "{i", followed by mangled names of fields, and ends with "}". If it's anything else, the second alphabetic character encodes the basic type. Characters are assigned to basic types in the enumeration order. If it's an array, the mangled name has a suffix [array_size]. This saves a few kilobytes from the binary size. The effect on symbol lookup speed seems mostly marginal. BUG=angleproject:2267 TEST=angle_unittests Change-Id: I26e65dcb48c3478df9a719ffff9c15f2fd12e293 Reviewed-on: https://chromium-review.googlesource.com/945910 Commit-Queue: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Olli Etuaho 391bda23 2018-02-23T11:43:14 Generate code for initializing built-in variables gen_builtin_symbols.py now generates code for initializing built-in variable symbols as well. Some of the variable symbols are static, but some of them also get initialized dynamically based on values in ShBuiltInResources. The static symbols have get functions in a header file so they can be referenced from AST traversers as well without doing a lookup. BUG=angleproject:2267 TEST=angle_unittests, angle_end2end_tests Change-Id: Ida7f3aeb06d2bce0f737f1483b1bd5833aeddd2e Reviewed-on: https://chromium-review.googlesource.com/911768 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Corentin Wallez 24180607 2018-03-02T14:12:13 Allow rectangle textures to be sample with texture() in ESSL3 This makes them consistent with the other texture types. Also adds a test for using texture(sampler2DRect, ...). BUG=chromium:757974 BUG=angleproject:1650 Change-Id: Ie966da928ae0c83850da1e530e72c0d501909394 Reviewed-on: https://chromium-review.googlesource.com/946675 Commit-Queue: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Olli Etuaho 065aa863 2018-02-22T15:30:27 Generate code for unmangled name lookup Instead of using an std::map at each symbol table level, use the gen_builtin_symbols.py script to build a function to query unmangled names. BUG=angleproject:2267 TEST=angle_unittests Change-Id: I4f1cf1df1f50fe9d909f3249150ee002ee6efb61 Reviewed-on: https://chromium-review.googlesource.com/931885 Commit-Queue: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Olli Etuaho 140152e7 2018-02-08T14:46:44 Statically allocate built-in function symbols A script gen_builtin_symbols.py now generates code for initializing built-in function symbols. The TFunction objects are initialized at C++ compile time. The source file used for the functions is in a format that's similar to how functions are given out in the GLSL spec, so it is easy to maintain. The function symbols are still inserted to the symbol table levels same as before. Getting rid of inserting the symbols at runtime is intended to be done as follow-up. This speeds up angle_unittests on Linux in release mode by a bit less than half, and in debug mode by more than half. BUG=angleproject:2267 TEST=angle_unittests Change-Id: I11c9de98c74d28e7e8cdf024516e2f6ee30ca33e Reviewed-on: https://chromium-review.googlesource.com/924155 Commit-Queue: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>