src/compiler/fuzz


Log

Author Commit Date CI Message
Tom Sepez 25390156 2025-08-21T00:13:19 Suppress unsafe buffers on a file-by-file basis in src/ [1 of N] In this CL, we suppress many files but stop short of actually enabling the warning by not removing the line from the unsafe_buffers_paths.txt file. That will happen in a follow-on CL, along with resolving any stragglers missed here. This is mostly a manual change so as to familiarize myself with the kinds of issues faced by the Angle codebase when applying buffer safety warnings. -- Re-generate affected hashes. -- Clang-format applied to all changed files. -- Add a few missing .reserve() calls to vectors as noticed. -- Fix some mismatches between file names and header comments. -- Be more consistent with header comment format (blank lines and trailing //-only lines when a filename comment adjoins license boilerplate). Bug: b/436880895 Change-Id: I3bde5cc2059acbe8345057289214f1a26f1c34aa Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6869022 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Geoff Lang b7582680 2025-02-24T18:04:32 Reland: GL: Allow untranslated shaders to pass through on GLES Add an EGL extension EGL_ANGLE_create_context_passthrough_shaders which uses the NULL translator and passes the original shader to the driver. The parser is still used for shader reflection. Always enable the null compiler backend. It has almost no binary size cost and is now potentially used when the null ANGLE backend is not enabled. Bug: angleproject:398857482 Change-Id: Id528189ccbbacb1c444eacb151baadfda9fcc04b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6488609 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Alexey Knyazev 56e9bfff 2025-06-19T00:00:00 GL: Remove obsolete macOS workarounds Bug: angleproject:427600175 Change-Id: I8bfc062b71f1a34de09cbf76b504293ccd081fe0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6676022 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
Martin Arjovsky a2b84cc0 2025-06-17T09:47:58 Fix bug in translator fuzzer. We were incorrectly checking a type against a spec. bug: angleproject:425580663 Change-Id: I7a57852b143ea26a41414015414d43720e2e53b1 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6650788 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Kimmo Kinnunen 94ee620d 2025-05-22T10:07:05 Metal: Allow optimization of simple loops Reimplement the feature to avoid undefined behavior of infinite loops. Add EnsureLoopForwardProgress rewrite pass that inserts a volatile variable access to all loops that it cannot analyze as being finite. Detect loops of form `for (; i <op> x; ++i)` as being finite. The <op> can be any of <,<=,>,>=,==, != operator. The i can be int or uint. The ++i can be -- or ++, -=1, +=1. This assumes that backends using the feature emit signed int arithmetic with defined wraparound semantics. Uses volatile write instead of asm("") due to asm not forcing the behavior in some compiler versions. The volatile variable access is defined in C++ as forward progress, and by inheritance this works in MSL. Later commits may remove injectAsmStatementIntoLoopBodies if ensureLoopForwardProgress is appropriate for all use-cases. Bug: angleproject:418918522 Change-Id: Ic9c29f57044b792195386483208632354d24c854 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6575051 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Auto-Submit: Kimmo Kinnunen <kkinnunen@apple.com> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Kimmo Kinnunen <kkinnunen@apple.com>
Shahbaz Youssefi 555038b8 2025-04-23T12:47:02 Translator Fuzzer: Enable required options Bug: chromium:409603851 Change-Id: I73067fcd3855f6cdcb6eea05b06bafa45d23fb19 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6482917 Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
Shahbaz Youssefi f355e2b3 2025-04-15T18:58:25 Vulkan: Remove preferDriverUniformOverSpecConst This was practically true for every vendor on Android (where rotation matters). For Qualcomm, it was also true due to a bug in version checking and didn't seem to be causing any concerns. Where pre-rotation is supported, it is better to enable this feature to avoid excessive pipeline creation. This change removes the feature and makes sure ANGLE always uses uniforms for rotation instead of spec consts. While technically this may have an adverse effect on platforms that never need pre-rotation, the ability is retained for all vendors since pre-rotation is finding its way into more platforms and would likely eventually be needed everywhere anyway. Bug: angleproject:42265878 Bug: angleproject:42262166 Change-Id: I4b64c04da46db08cfdd44b60789b66d93d8e8b17 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6459025 Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Reviewed-by: mohan maiya <m.maiya@samsung.com> Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Cody Northrop <cnorthrop@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Shahbaz Youssefi ae5c3b96 2024-10-08T17:02:21 Boilerplate for GL_ARM_shader_framebuffer_fetch_depth_stencil Bug: angleproject:352364582 Change-Id: I94c670db5546564a6f60bb513a6d7f3f5bd5778c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5916771 Reviewed-by: Yuxin Hu <yuxinhu@google.com> Reviewed-by: Charlie Lao <cclao@google.com>
Rafael Cintron d1a4b0ff 2019-05-04T17:15:42 Remove Feature Level 9_3 code Feature Level 9_3 was originally added for developers creating apps for devices which did not have the DirectX 9 API and are no longer supported. Hence, we can remove the corresponding code in the 11 backend. Bug: angleproject:355462523 Change-Id: I22db15640b435c61db4d82a815edbc65cecc4e12 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5824661 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Rafael Cintron <rafael.cintron@microsoft.com>
Shahbaz Youssefi 7691cea7 2024-07-22T13:46:14 Vulkan: Remove seamful cubemap emulation Practically, the Vulkan backend is never expected to run on ES2 hardware. It _may_ for WebGL, but seamful cubemap emulation was disabled for webgl anyway. Bug: angleproject:354729454 Change-Id: Iafa20fbdbe232c4df4c777b12e7698ef7a87cf24 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5730143 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yuxin Hu <yuxinhu@google.com> Reviewed-by: Charlie Lao <cclao@google.com>
Roman Lavrov df90bbc5 2024-07-12T18:04:53 Refactoring: move angle::HashMap and HashSet to own header Underlying abseil includes pull in a large set of headers Bug: angleproject:42266508 Change-Id: Icee47143a8a59bb0795a054b67c0aa4ddcfca4d4 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5704137 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Scott Marcy 46db3d73 2024-05-31T12:21:39 Enable limitExpressionComplexity in translator_fuzzer.cpp Turns on `limitExpressionComplexity` in the translator fuzzer. Bug: angleproject:343889868 Change-Id: Ibbb3db6c2572abf43362ae59fbe8e9a4a30f5345 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5588812 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Kimmo Kinnunen <kkinnunen@apple.com> Auto-Submit: Scott M <mscott@apple.com> Reviewed-by: Kimmo Kinnunen <kkinnunen@apple.com>
Shahbaz Youssefi 9b63700b 2023-07-11T10:25:40 Translator: Reorganize files This change makes the translator files more organized by: - Grouping files that are specific to a certain output under their own directory, - Moving transformations under tree_ops - Removing Direct from metal translation now that that SPIR-V Cross path is removed Bug: angleproject:6394 Change-Id: Iaf5bb8d5604b84748dece029821b1f77b2813967 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4678780 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Alexey Knyazev ad52f12e 2023-03-21T00:00:00 Implement EXT_conservative_depth Added translator frontend and GLSL backend support for gl_FragDepth redeclaration and layout qualifiers. Added mappings to DepthGreater, DepthLess, and DepthUnchanged SPIR-V execution modes. Bug: angleproject:8046 Change-Id: I23f19ff54380741107970a44055ea269eef179f6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4355028 Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Mohan Maiya 1d9b8d80 2023-01-24T16:50:32 Reland "Add support for glShaderBinary" This is a reland of commit 228973e73135924ddf6116e0b63eff5a1ccbf232 with the following fixes - 1. Apply patch from Yuly to fix chromium build errors 2. Fix ShaderBinaryTest instantiation call 3. Add ShaderBinaryTest to expectations file for IOS Original change's description: > Add support for glShaderBinary > > This patch adds the following - > 1. ANGLE_shader_binary extension and GL_SHADER_BINARY_ANGLE token. > 2. Compiler support to generate shader binaries. > 3. Update compiler to use SH_SPIRV_VULKAN_OUTPUT as output type for > Vulkan translator. > 4. Support to load GL_SHADER_BINARY_ANGLE binaries. > 5. end2end tests for glShaderBinary. > > Tests: ShaderBinaryTest* > Bug: angleproject:7833 > Change-Id: I191d5ba7c4d5304696f5e743c851dc945fa57858 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4137306 > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > Commit-Queue: mohan maiya <m.maiya@samsung.com> > Reviewed-by: Charlie Lao <cclao@google.com> Bug: angleproject:7833 Change-Id: I21135c52e2bae955342a99aff5631ba0e687eff1 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4195852 Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Yuly Novikov 0c9cbf39 2023-01-26T12:07:51 Revert "Add support for glShaderBinary" This reverts commit 228973e73135924ddf6116e0b63eff5a1ccbf232. Reason for revert: breaks compile on ANGLE into Chromium roll https://cr-buildbucket.appspot.com/build/8790942326644064097 https://cr-buildbucket.appspot.com/build/8790942759045412865 https://cr-buildbucket.appspot.com/build/8790942417069789217 Leaks detected on ASAN https://cr-buildbucket.appspot.com/build/8790946657703508337 Original change's description: > Add support for glShaderBinary > > This patch adds the following - > 1. ANGLE_shader_binary extension and GL_SHADER_BINARY_ANGLE token. > 2. Compiler support to generate shader binaries. > 3. Update compiler to use SH_SPIRV_VULKAN_OUTPUT as output type for > Vulkan translator. > 4. Support to load GL_SHADER_BINARY_ANGLE binaries. > 5. end2end tests for glShaderBinary. > > Tests: ShaderBinaryTest* > Bug: angleproject:7833 > Change-Id: I191d5ba7c4d5304696f5e743c851dc945fa57858 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4137306 > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > Commit-Queue: mohan maiya <m.maiya@samsung.com> > Reviewed-by: Charlie Lao <cclao@google.com> Bug: angleproject:7833 Change-Id: Ice19576acbc1351810ff0cd769ac17ad6c0abdf3 No-Try: true No-Presubmit: true Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4197375 Auto-Submit: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Mohan Maiya 228973e7 2023-01-24T16:50:32 Add support for glShaderBinary This patch adds the following - 1. ANGLE_shader_binary extension and GL_SHADER_BINARY_ANGLE token. 2. Compiler support to generate shader binaries. 3. Update compiler to use SH_SPIRV_VULKAN_OUTPUT as output type for Vulkan translator. 4. Support to load GL_SHADER_BINARY_ANGLE binaries. 5. end2end tests for glShaderBinary. Tests: ShaderBinaryTest* Bug: angleproject:7833 Change-Id: I191d5ba7c4d5304696f5e743c851dc945fa57858 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4137306 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: mohan maiya <m.maiya@samsung.com> Reviewed-by: Charlie Lao <cclao@google.com>
Alexey Knyazev 067ace47 2022-12-21T00:00:00 Add ANGLE_clip_cull_distance extension Added an extension spec. Trivially exposed it on GL, Vulkan, and D3D11. Adjusted tests and validation to allow no cull distance support for this extension string. Removed extra built-in variable definitions. Bug: angleproject:7904 Change-Id: Ic60772dfe28132c316eaa29aadc1afd66e3b0fa7 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4114290 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
Chris Dalton 8ee1b89f 2022-11-04T13:10:37 Refactor pixel local storage options The various different PLS options were getting scattered and unruly. We are also in need of more backend-specific PLS options that would be difficult to add as-is. This CL refactors them into a single "ShPixelLocalStorageOptions" struct that gets initialized all in one place, and shared between the compiler and the backends. Bug: angleproject:7279 Change-Id: Ic58dccb8d1ba350a0b6cc5848ce15bd687e30fad Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4006715 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Chris Dalton <chris@rive.app>
Shahbaz Youssefi 78e28cb8 2022-11-03T11:05:48 Vulkan: Remove glslang fallback ANGLE's SPIR-V generator is battle tested by now. Bug: angleproject:6210 Change-Id: I2ed88642e3ede435e3f906fbd701133be6873fb7 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4002868 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Kimmo Kinnunen c10326f1 2022-08-26T11:37:59 Make shader dump code compile after ShCompileOptions API change Make the output directory configurable with the define that turns on the dump feature. Write each aggregate struct in its own block of memory, so that if an aggregate changes, the binary format does not change so easily. Choose the filename based on the contents hash, so that multiple dump sessions do not produce excessive amount of dumps. Bug: angleproject:7612 Change-Id: Ifccd2d83e3361dc4633b601fd18f425c9ec44790 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3858263 Auto-Submit: Kimmo Kinnunen <kkinnunen@apple.com> Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
Shahbaz Youssefi 80a9ee71 2022-08-25T01:03:09 Fix translator fuzzer The GLSL mac-only options were being listed as unsupported only when the output is not GLSL. However, they should also be listed as unsupported on GLSL output when not on mac. Bug: chromium:1355076 Bug: chromium:1355281 Change-Id: I5a87d9a529e534b2ea6c030ad7132cd0f698e7d1 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3855700 Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com> Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com>
Shahbaz Youssefi 6f80f0f0 2022-08-06T02:29:19 Translator: Clean up the compile flag passing interface Historically, compile flags were sent to the translator as a bitmask. Recently, we were getting close to running out of bits. Additionally, direct-to-metal work had started to introduce constants to be passed to the translator, which were misplaced in ShBuiltInResources and Caps. Recent work on Pixel Local Storage adds even more constants, aggravating the situation. In this change, the interface to passing compile flags is reworked. A struct is passed (instead of a bitmask) that has one bit for each flag. This can be indefinitely extended. Additionally, the constants needed by metal and PLS are also placed in this struct. In turn, the backends can set these options directly, and don't have to hack them into Caps to further get hacked into ShBuiltInResources. Bug: angleproject:7559 Change-Id: If93f1e1b8818ad3a0ac708ab04ab93b4b397d114 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3812562 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com> Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org>
Amirali Abdolrashidi 3b988fef 2022-06-01T10:54:03 Vulkan: Remove enableLineRasterEmulation * Removed the Bresenham line raster emulation specialization constant, along with related variables and functions. Bug: angleproject:7366 Change-Id: If17c8ce9b459ad801bae8e887e5674bd9a3ff2bf Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3680860 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com>
Shahbaz Youssefi 98c2e169 2022-05-20T16:17:49 Vulkan: Reduce pre-rotation spec const to bool The specialization constant now only dictates whether x and y should be swapped. The complete 8 possible states of rotation and y-flip are achieved by using this swap in combination with a driver uniform for x and y flip. Swapping is still a specialization constant to avoid degrading performance of dFdx/dFdy which otherwise would need both to be evaluated instead of one. On platforms which don't support pre-rotation, the specialization constant will never change and driver uniforms entirely govern y-flip. On platforms that do support pre-rotation, only two variations of the pipeline are needed. Bug: angleproject:7366 Change-Id: I73f84e89fa9349d2098fa5b21573aee57d93a30c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3663151 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Lingfeng Yang <lfy@google.com> Reviewed-by: Charlie Lao <cclao@google.com>
Amirali Abdolrashidi fea19567 2022-05-17T17:44:06 Vulkan: Remove removeEarlyFragmentTestsOpt flag * Removed removeEarlyFragmentTestsOptimization and the related SPIRV transformation and variables. * Removed mUsesEarlyFragmentTestsOptimization. * Removed SH_EARLY_FRAGMENT_TESTS_OPTIMIZATION. * Merged updateUsesEarlyFragmentTestsOptimization() into updateFragmentInoutRange(). Bug: angleproject:7347 Change-Id: I7299bd4e8ab5363e5cf06eb48419d4f469106e12 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3648217 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com>
Brandon Schade 38fada35 2022-01-27T18:16:18 Vulkan: Add support for OES_primitive_bounding_box Add OES version of the primitive bound box extension Bug: angleproject:3576 Test: dEQP-GLES31.functional.primitive_bounding_box.* Change-Id: Ie44d952992a68dfffd5c124dda8dd11069f0c1e1 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3425086 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Brandon Schade <b.schade@samsung.com>
Cody Northrop e2e77baa 2021-10-18T16:04:43 Revert "Revert "Translator: Remove the SH_VALIDATE flag"" This reverts commit 701e8892f45e6f416dcbb0d23a155d346d0280fa. Reason for revert: Chromium dependency fixed in http://crrev/c/3214440 Original change's description: > Translator: Remove the SH_VALIDATE flag > > The SH_VALIDATE flag is a noop, defined as zero (0). > > Also move option descriptions up in the file. > > Bug: angleproject:6501 > Change-Id: I898106eb68b4508d8f94534cbff66652a69f4f3e > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3207360 > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > Commit-Queue: Cody Northrop <cnorthrop@google.com> Bug: angleproject:6501 Change-Id: I4d1514d6ac04e5bedf3624facf8e9339828fa291 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3229955 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Yuly Novikov 701e8892 2021-10-08T02:56:38 Revert "Translator: Remove the SH_VALIDATE flag" This reverts commit 4ca3d7d64388f043dab688d536776495df40532d. Reason for revert: breaks roll into Chromium crrev.com/c/3213239 SH_VALIDATE is used in gpu_unittests. Original change's description: > Translator: Remove the SH_VALIDATE flag > > The SH_VALIDATE flag is a noop, defined as zero (0). > > Also move option descriptions up in the file. > > Bug: angleproject:6501 > Change-Id: I898106eb68b4508d8f94534cbff66652a69f4f3e > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3207360 > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > Commit-Queue: Cody Northrop <cnorthrop@google.com> Bug: angleproject:6501 Change-Id: Ia9983eac58a07e2a6e3d5fe4d1bfccfb9c48ccd0 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3212709 Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
Cody Northrop 4ca3d7d6 2021-10-05T23:10:09 Translator: Remove the SH_VALIDATE flag The SH_VALIDATE flag is a noop, defined as zero (0). Also move option descriptions up in the file. Bug: angleproject:6501 Change-Id: I898106eb68b4508d8f94534cbff66652a69f4f3e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3207360 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Cody Northrop <cnorthrop@google.com>
Shahbaz Youssefi 1ce78397 2021-07-30T16:51:45 Remove support for WEBGL_debug_shader_precision This extension was rejected, and the implementation was hacky. This clean up is part of an ongoing work to improve precision handling. Bug: angleproject:6059 Change-Id: If08581ec6f19cf1698ffa3dd6d248dc5e68a1d31 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3064303 Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 09d5047b 2021-08-03T01:31:03 GL: Remove the rewriteVectorScalarArithmetic workaround This workaround was implemented for a bug in Nvidia driver 387 which is end-of-life. More recent driver branches (390 and 4XX) are fixed, and so this workaround is no longer required. The implementation of the workaround itself could introduce bugs. Bug: chromium:772651 Bug: chromium:1201084 Change-Id: I3db179eb90d9124235bdad2daacc712302906d8e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3067952 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org>
Brandon Schade 217acac2 2021-07-21T12:42:56 Vulkan: Add support for EXT_primitive_bounding_box 1. Added support for EXT_primitive_bounding_box extension 2. Renamed shader variable gl_BoundingBoxEXT[] to ANGLEBoundingBox[] Bug: angleproject:3576 Test: dEQP-GLES31.functional.primitive_bounding_box.* Change-Id: I15fa9af50c6fd8e86d225670ddd8eb39f6e65d35 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3053618 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 795d7543 2021-04-07T11:38:37 Remove unused translator option bits Usage of SH_DONT_REMOVE_INVARIANT_FOR_FRAGMENT_INPUT is removed from ANGLE by [1], and from the validating command decoder by [2]. The flag is only ever disabled in Firefox. SH_REMOVE_POW_WITH_CONSTANT_EXPONENT is removed from the validating command decoder by [3]. Not used in Firefox. [1]: https://chromium-review.googlesource.com/c/angle/angle/+/1558678 [2]: https://chromium-review.googlesource.com/c/chromium/src/+/2810880 [3]: https://chromium-review.googlesource.com/c/chromium/src/+/2810879 Bug: angleproject:4889 Change-Id: If7d9c31c48510b1486a2285a88475b3c01a77527 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2810806 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 2feb3db5 2021-04-07T11:36:06 Remove unused translator option bit SH_DONT_PRUNE_UNUSED_FUNCTIONS was only used by tests, and never used by ANGLE or chromium. Bug: angleproject:4889 Change-Id: I4926f86125e69b07e9d4d95134b7b70522e0d64f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2607491 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 776c6015 2021-02-26T00:00:57 Vulkan: Call glslang at compile time With this change, the ANGLE translator immediately compiles the generated GLSL into SPIR-V with glslang and discards the source. This is in preparation for generating SPIR-V directly, by making the frontend and backend already able to digest it. This change also allows the expensive glslang calls to be parallelized, improving the following perf test by about 20%: LinkProgramBenchmark.Run/vulkan_compile_and_link_multi_thread Previously, the test was run as such in the Vulkan backend: Main Thread 1 Thread 2 Compile1 ---> Compile2 ---------------------> Translator Translator <--- <--------------------- Link glslang for shader1 glslang for shader2 Done With this change, it is run as such: Main Thread 1 Thread 2 Compile1 ---> Compile2 ---------------------> Translator Translator glslang glslang <--- <--------------------- Link Done glslang_wrapper_utils no longer interacts with glslang! A rename will follow. Bug: angleproject:4889 Change-Id: If4303e8ba0ba43b1a2f47f8c0a9133d0bee1a19a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2721195 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi 60015ff6 2021-01-14T02:03:07 Vulkan: Redo RewriteStructSamplers This transformation is split into two. The first transformation solely takes out the samplers out of structs, and potentially generates array of array of samplers. A second transformation is added that takes any array of array of opaque uniforms and flattens it. A follow up change will simplify RewriteAtomicCounters which also handles array of arrays (which is no longer possible), and removes dependency on shaderStorageBufferArrayDynamicIndexing. Bug: angleproject:2703 Bug: angleproject:3881 Bug: angleproject:4071 Bug: angleproject:4211 Change-Id: I352bb2bbe65ac49f4d7d753c0ba3160fa3cc925a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2628138 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Mohan Maiya cea86910 2021-01-14T08:13:00 Vulkan: Support EXT_clip_cull_distance extension EXT_clip_cull_distance extension is supported except for some features related to EXT_tessellation_shader and EXT_geometry_shader. Also added a few compiler tests to validate the transformation from ESSL to GLSL for Vulkan backend. Bug: angleproject:5458 Tests: angle_end2end_tests --gtest_filter=Clip*DistanceTest* angle_unittests --gtest_filter=*Clip*Distance* Change-Id: Ie74e6b2b55112ad92ad111191d629b63506032ab Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2585987 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Mohan Maiya <m.maiya@samsung.com>
Shahbaz Youssefi 2aa4f7e5 2021-01-08T16:35:29 Fix translator fuzzer Since some ASTs are now disabled on certain conditions, this change lets the fuzzer know when it has generated invalid translator options. Bug: chromium:1164448 Change-Id: I1f1b120c33fb70f9776df858db033ec914d7ad89 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2618203 Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Tim Van Patten c859c0ac 2020-11-24T17:21:38 Batch replace std::unordered_map with angle::HashMap in src/ There are a few places that will remain std::unordered_map due to build or run-time errors, which will need to be evaluated more closely to determine if they should remain std::unordered_map or if there is another Abseil data structure that would be more efficient while still working correctly. Bug: angleproject:4873 Change-Id: Ib04253e3ad6398e63f4cc2bfe12c0f9e57cb112b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2558873 Commit-Queue: Tim Van Patten <timvp@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com>
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>
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 795a3559 2019-12-03T11:31:18 Vulkan: EXT_gpu_shader5 support: precise The precise keyword is used in tessellation shaders but introduced in this extension. EXT_gpu_shader5 introduces a handful of features to shaders. This change only implements the `precise` keyword. Bug: angleproject:3569 Change-Id: I2252b79098eb8ba2d2faa040d7eaed7548b7051e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1939851 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Stuart Morgan 9d737966 2019-08-14T12:25:12 Standardize copyright notices to project style For all "ANGLE Project" copyrights, standardize to the format specified by the style guide. Changes: - "Copyright (c)" and "Copyright(c)" changed to just "Copyright". - Removed the second half of date ranges ("Y1Y1-Y2Y2"->"Y1Y1"). - Fixed a small number of files that had no copyright date using the initial commit year from the version control history. - Fixed one instance of copyright being "The ANGLE Project" rather than "The ANGLE Project Authors" These changes are applied both to the copyright of source file, and where applicable to copyright statements that are generated by templates. BUG=angleproject:3811 Change-Id: I973dd65e4ef9deeba232d5be74c768256a0eb2e5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1754397 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
James Darpinian 22ec7dc9 2019-08-06T10:10:52 Remove all global constructors and exit time destructors. WebKit compiles with -Wglobal-constructors, so they want this. I decided to do -Wexit-time-destructors at the same time. Bug: angleproject:3439 Bug: angleproject:1459 Change-Id: I4b44ae4f8e6f066e07dc7f9f6ced9a5d49dc8f8a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1738438 Commit-Queue: James Darpinian <jdarpinian@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Martin Radev c39a19aa 2017-07-07T18:52:09 Select viewport index in the GLSL/ESSL vertex shader The patch enables viewport selection for multiview rendering in the GLSL/ESSL vertex shader through the use of the GL_NV_viewport_array2 extension. The AST is modified only for GLSL and ESSL to include the viewport selection expression after ViewID_OVR's initialization. BUG=angleproject:2062 TEST=angle_unittests Change-Id: Iee05bb5a4b687ed53ddbdd466f1572227b1f0cde
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>
Corentin Wallez 98e34077 2017-01-10T13:22:21 translator_fuzzer: destroy translator cache on exit. BUG=chromium:679725 Change-Id: I73b45b9ff2f1a270afce8c77a701e2659fd2b7c9 Reviewed-on: https://chromium-review.googlesource.com/426017 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
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 28cb0368 2016-11-22T15:42:37 Check for misconfiguration of shader built-ins Fail compiler initialization if the built-in resources are invalid. This avoids creating zero-sized arrays out of built-ins into the symbol table, which could later lead to asserts when these built-ins were indexed by constants. BUG=chromium:667468 TEST=angle_unittests Change-Id: I9553c7c91ea355abb35b9cc6088ee14b40b0922b Reviewed-on: https://chromium-review.googlesource.com/413037 Commit-Queue: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Jamie Madill 8bbbb820 2016-11-07T13:50:29 translator: Remove deprecated HLSL output flags. These flags were adding redundant configs to the fuzzer. BUG=angleproject:1522 Change-Id: I49ad56f0d7aceaae326d2d4387c4c750866465f3 Reviewed-on: https://chromium-review.googlesource.com/408338 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Geoff Lang <geofflang@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>
Corentin Wallez 28b6528c 2016-06-16T07:24:50 Add a fuzzer for the shader translator. BUG=angleproject:1522 Change-Id: Idbe8194ba478366e99c7460d403d03fe27dd89d0 Reviewed-on: https://chromium-review.googlesource.com/353153 Commit-Queue: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>