src/compiler/translator/TranslatorMetalDirect/EmitMetal.cpp


Log

Author Commit Date CI Message
Alexey Knyazev d37c97d1 2023-04-17T00:00:00 Metal: Implement OES_shader_multisample_interpolation * Added support for sample qualifier and shader interpolation functions * Added MSL-specific AST transformations * Adjusted minimum fragment interpolation offset state query test so that accurate limits could be reported * Drive-by: Y-flip gl_SamplePosition adjustment * Renamed ANGLESampleMaskEnabled function constant to ANGLEMultisampledRendering to correctly reflect its usage Bug: angleproject:8097 Bug: angleproject:8131 Change-Id: I25c9f36487e29f05bb9fe874e146d06378fef975 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4440827 Reviewed-by: Kenneth Russell <kbr@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
Alexey Knyazev 7bc4b7e3 2023-03-27T00:00:00 Metal: Implement OES_sample_variables New ESSL built-ins are mapped to their Metal counterparts and tweaked to follow OpenGL ES semantics when needed. Fixed A2C interaction with sample coverage by emulating the former on non-Apple GPUs. Bug: angleproject:8097 Fixed: angleproject:5087 Change-Id: I5d28a941af5cbc14743a3930731529f11f55febd Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4404896 Reviewed-by: Kenneth Russell <kbr@chromium.org> Reviewed-by: Kyle Piddington <kpiddington@apple.com> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
Alexey Knyazev fc7cb00e 2023-03-24T00:00:00 Metal: Support NV_shader_noperspective_interpolation Fixed: angleproject:8095 Change-Id: Ieded1f704f82963984f1aee5072f152de0de374c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4368473 Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Alexey Knyazev 648f3657 2023-03-21T00:00:00 Metal: Implement EXT_conservative_depth Bug: angleproject:8046 Change-Id: I3b9f497da19bf005c7948e552f2e1c7415d4ac6d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4363020 Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com> Reviewed-by: Kyle Piddington <kpiddington@apple.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Alexey Knyazev 1e6dd013 2023-03-21T00:00:00 Metal: Support centroid qualifier Fixed: angleproject:8090 Change-Id: I3137599e976bc469709347f423b7e8b71e6ed9f7 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4356667 Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Kyle Piddington <kpiddington@apple.com>
Alexey Knyazev 8c2fcc70 2023-02-02T00:00:00 Metal: Implement EXT_blend_func_extended Fixed: angleproject:8015 Change-Id: Ic92a8823869bf097349aee6241f6cfb86942c945 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4242128 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com> Reviewed-by: Kyle Piddington <kpiddington@apple.com>
Kyle Piddington b23bf47c 2023-01-25T18:50:40 Reland "Metal: rewrite default uniforms and uniform blocks" Instead of rewriting uniforms in shaders to match std140 layout, re-pack incoming uniform blocks' std140 packed variables to match Metal's layout. This change intorduces a new BlockLayoutEncoder for Metal types The block encoder handles packing typically larger GL types (bools) into smaller types, and adding support for more compressed matrix types. Since we no longer need to do shader-time packing and unpacking of data from std140 padded structs, complicated shader transformations have been removed. This patch greatly reduces register pressure, especially when working with shaders with arrays of previously expanded types. (Vec3's) Reland: Fix an issue where the default uniform block's final size was not aligned to the default uniform block's alignment requirements, causing crashes with the debug layer enabled. Bug: angleproject:7137 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3733524 Commit-Queue: Kyle Piddington <kpiddington@apple.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org> Change-Id: I89d3b817675486fde73b91b0be0f4c25986d4ba5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4209867
Kenneth Russell fb948319 2023-01-31T18:16:41 Revert "Metal: rewrite default uniforms and uniform blocks" This reverts commit b8bfe6f6c04a6cf4fac81f0363ad23a0b92b22f2. Reason for revert: potential cause of crashes/timeouts in crbug.com/1411755 Original change's description: > Metal: rewrite default uniforms and uniform blocks > > Instead of rewriting uniforms in shaders to match std140 layout, > re-pack incoming uniform blocks' std140 packed variables to match > Metal's layout. > > This change intorduces a new BlockLayoutEncoder for Metal types > The block encoder handles packing typically larger GL types (bools) > into smaller types, and adding support for more compressed matrix types. > > Since we no longer need to do shader-time packing and unpacking of data > from std140 padded structs, complicated shader transformations have been > removed. This patch greatly reduces register pressure, especially when > working with shaders with arrays of previously expanded types. (Vec3's) > > Bug: angleproject:7137 > Change-Id: Icd1da8c7a383f3354313a58618fc1bf6656726b4 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3733524 > Commit-Queue: Kyle Piddington <kpiddington@apple.com> > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > Reviewed-by: Kenneth Russell <kbr@chromium.org> Bug: angleproject:7137 Bug: chromium:1411755 Change-Id: I1b6a62d7eb542c3e7ef4b84858ab2683abb66f8b No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4210448 Commit-Queue: Kenneth Russell <kbr@chromium.org> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Kyle Piddington b8bfe6f6 2023-01-25T18:50:40 Metal: rewrite default uniforms and uniform blocks Instead of rewriting uniforms in shaders to match std140 layout, re-pack incoming uniform blocks' std140 packed variables to match Metal's layout. This change intorduces a new BlockLayoutEncoder for Metal types The block encoder handles packing typically larger GL types (bools) into smaller types, and adding support for more compressed matrix types. Since we no longer need to do shader-time packing and unpacking of data from std140 padded structs, complicated shader transformations have been removed. This patch greatly reduces register pressure, especially when working with shaders with arrays of previously expanded types. (Vec3's) Bug: angleproject:7137 Change-Id: Icd1da8c7a383f3354313a58618fc1bf6656726b4 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3733524 Commit-Queue: Kyle Piddington <kpiddington@apple.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org>
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>
Chris Dalton a4db9477 2022-10-06T10:35:39 Implement pixel local storage with metal::read_write textures Metal's programmable blending feature isn't available on non-Apple Silicon, so on these devices we have to polyfill pixel local storage using read_write textures, which can also be coherent if raster_order_groups are supported. This change leverages the existing PLS transformation to images, and implements just enough shader image functionality in Metal to support the pixel local storage usecase. Missing shader image features are marked with UNIMPLEMENTED(). Bug: angleproject:7279 Bug: angleproject:7792 Bug: angleproject:7794 Bug: angleproject:7797 Bug: angleproject:7803 Change-Id: Ia96a714693d352d57351a1bae4f45437dde000e4 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3993363 Reviewed-by: Kenneth Russell <kbr@chromium.org> Reviewed-by: Quyen Le <lehoangquyen@chromium.org> Commit-Queue: Chris Dalton <chris@rive.app> Reviewed-by: Kyle Piddington <kpiddington@apple.com>
Chris Dalton db67df60 2022-10-31T13:01:25 Metal texture cleanups * Record the texture arguments' location in main() instead of inferring their position based on an assumption that the texture pipeline comes last. * Fix one spot that was using mMainSamplerIndex that should have been using mMainTextureIndex. Bug: angleproject:7279 Change-Id: I53af0f016e52217c53d98b560011ffe958746cda Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3993362 Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Chris Dalton <chris@rive.app>
Alexey Knyazev c97edf51 2022-10-24T00:00:00 Metal: Enable APPLE_clip_distance Adjusted direct-to-Metal shader translator to support gl_ClipDistance built-in. Bug: angleproject:6291 Change-Id: Ice4cc3e4d7c131cbaac9726e845a5c1e59787e69 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3976428 Reviewed-by: Kyle Piddington <kpiddington@apple.com> Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
Chris Dalton 2d31fe98 2022-09-22T21:04:22 Implement PLS on Apple Silicon Implements a subset of EXT_shader_framebuffer_fetch in the Metal translator that is sufficient to support pixel local storage. Metal's "programmable blending" feature is available on all Apple family GPUs beginning with version 2. Support for non-Apple GPUs will come later via readWrite textures, which can also be coherent by annotating them with [[raster_order_goup(0)]]. Bug: angleproject:7279 Change-Id: Ic74f6c0d21e87eb919e1f487163388d08d126857 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3916794 Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Chris Dalton <chris@rive.app> Reviewed-by: Gregg Tavares <gman@chromium.org>
Shahbaz Youssefi 6f80f0f0 2022-08-06T02:29:19 Translator: Clean up the compile flag passing interface Historically, compile flags were sent to the translator as a bitmask. Recently, we were getting close to running out of bits. Additionally, direct-to-metal work had started to introduce constants to be passed to the translator, which were misplaced in ShBuiltInResources and Caps. Recent work on Pixel Local Storage adds even more constants, aggravating the situation. In this change, the interface to passing compile flags is reworked. A struct is passed (instead of a bitmask) that has one bit for each flag. This can be indefinitely extended. Additionally, the constants needed by metal and PLS are also placed in this struct. In turn, the backends can set these options directly, and don't have to hack them into Caps to further get hacked into ShBuiltInResources. Bug: angleproject:7559 Change-Id: If93f1e1b8818ad3a0ac708ab04ab93b4b397d114 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3812562 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com> Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org>
Eddie Hatfield 91976352 2022-06-21T15:41:02 Use C++17 attributes instead of custom macros Bug: angleproject:6747 Change-Id: Iad6c7cd8a18d028e01da49b647c5d01af11e0522 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3718999 Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Kyle Piddington 2f6dcf77 2022-06-01T14:51:47 Metal shaders fail to compile with "error: unknown type name 'uint' Replace 'uint' with uint32_t in emitted MSL. Some legacy configurations are showing compile errors when using this type. Bug: angleproject:7384 Change-Id: I7f262d417eaf46eed71da24e8b2c110b11677ab6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3684952 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Kyle Piddington <kpiddington@apple.com> Reviewed-by: Kenneth Russell <kbr@chromium.org>
Alexey Knyazev 7c616871 2022-02-01T15:12:53 Metal: Implement ANGLE_base_vertex_base_instance Includes command buffer and MSL translator updates. The DrawElementsInstancedBaseVertexBaseInstance tests from DrawBaseVertexVariantsTest suite fail for dynamic draw and stream draw buffer usages. Bug: angleproject:6963 Change-Id: I6caa144860356d5fc85948b72458bec282ea3a3b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3429819 Reviewed-by: Kyle Piddington <kpiddington@apple.com> Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Kenneth Russell <kbr@chromium.org>
John Cunningham 45237a04 2022-01-11T00:14:01 Metal: Fix undefined behavior of depth write Writing to an unbound depth attachment is undefined behavior in Metal. Fix this by emitting a function constant to guard depth buffer use in fragment shaders. Bug: angleproject:6865 Change-Id: Id7c10d0aeb349aacfe09c397bc292a71199ab50a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3380304 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Kenneth Russell <kbr@chromium.org>
Shahbaz Youssefi 0f00fbae 2022-01-21T00:28:48 Translator: Make vec/matrix size getters unsigned TType stored type's primary and secondary sizes as `unsigned char`, but the getters returned `int`. This caused unnecessary casts when the size was passed from one TType to another, as well as comparisons with other unsigned numbers. This change specifies the type of these members as `uint8_t` and makes the getters return the same type. The call sites are accordingly adjusted to remove unnecessary casts, use the correct type in local variables, and add casts when passed to ostream::operator<<. Bug: angleproject:6755 Change-Id: Ia4d86bd4ccb5c1a2ae1e10a0085a5166c3a6bcf7 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3402850 Reviewed-by: Tim Van Patten <timvp@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Alexey Knyazev f4b0a95f 2021-12-16T02:38:26 Metal: Implement EXT_shader_texture_lod Added CubeMapTextureTest.SampleCoordinateTransformGrad_ES3 Bug: angleproject:6815 Bug: angleproject:6824 Bug: angleproject:3814 Bug: angleproject:6891 Change-Id: I9007bf8ba91309fb9b597e2d1bd33281ff59644a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3343488 Reviewed-by: Gregg Tavares <gman@chromium.org> Reviewed-by: Kyle Piddington <kpiddington@apple.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
Stephen White 0b56267f 2021-11-02T12:25:40 Implement ANGLE_FALLTHROUGH macro. Use it instead of ABSL_FALLTHROUGH_INTENDED. (ANGLE shouldn't use absl unless angle_enable_absl is true. This is breaking the roll of ANGLE into Dawn.) Bug: angleproject:6647 Change-Id: I47f9a00841c4605fca52b17eeb68c0b1da5004c0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3258008 Commit-Queue: Stephen White <senorblanco@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Kyle Piddington 54d4bfe5 2021-09-28T17:27:57 Update ANGLE Metal to Webkit at Sept 29 2021 This commit merges changes from Webkit into ANGLE upstream. The following commits were used: Current: https://git.webkit.org/?p=WebKit.git;a=commit;h=e01d0bda8f4b7dc2fd834b92802d15d8c15735f Previous: https://git.webkit.org/?p=WebKit.git;a=commit;h=492f078198748e8ff248eea0bb979cf79e5f5adfj The following commits were merged in from the Webkit Repository: (Hashes from git://git.webkit.org/WebKit-https.git) 03ea44c78ce5665d4ec9add271260121cbc7bc6c Problems with drawElements in some conditions https://bugs.webkit.org/show_bug.cgi?id=230107 c8dc8e0c4d1109d39a62eb197b45e95132380290 ANGLE Metal: single-component swizzles do not compile https://bugs.webkit.org/show_bug.cgi?id=230472 7285dbaaf5af15877d6c332b30ef7a4d67225460 webgl-compressed-texture-s3tc-srgb.html fails on Intel+AMD Metal https://bugs.webkit.org/show_bug.cgi?id=229941 4c72f92967ecd2a095666fef431384c4f5f60fb4 fragcolor-fragdata-invariant.html fails https://bugs.webkit.org/show_bug.cgi?id=223317 cd943145467f54e5928793c0dd3dfa2313c007dd ANGLE Metal index buffer restart range cache could be maintained.. https://bugs.webkit.org/show_bug.cgi?id=227451 f075ff77e592eabd54dd659a8e13617cc5faedc8 ANGLE Metal infinities and NaNs generated with incorrect syntax https://bugs.webkit.org/show_bug.cgi?id=229439 5862073269122f4b2d43d96d3922757557755e86 [Metal ANGLE] Fix over-autorelease of rx::DisplayMtl::getMetalDeviceMatchingAttribute()... <https://webkit.org/b/229128> 85f797ad31db048cb82cbafd428ef77f0b839312 ANGLE Cocoa compiles.... https://bugs.webkit.org/show_bug.cgi?id=228987 a67918ba279ad4842b6ae84a79c3f1c0cdc35ace Avoid infinite recursion... https://bugs.webkit.org/show_bug.cgi?id=228978 d341f67de0033adcf1ec6373ace6a54b06c4a031 Cherry-pick ANGLE: Revise WebGL's shaderSource validation https://bugs.webkit.org/show_bug.cgi?id=228951 1e2714d981e97de8234ba055570dfdf56e8b6944 3.5 MB system-wide footprint impact due to thread-locals... https://bugs.webkit.org/show_bug.cgi?id=228240 d32e5cca34081997d32504b0b56c18b9703ff3be Build Default Metal library offline https://bugs.webkit.org/show_bug.cgi?id=227333 33702279faccfd4c8d1c8a6d549925f9ca9a4e8f WebGL2 demo doesn't work due to failing compilation.... https://bugs.webkit.org/show_bug.cgi?id=226865 0a075885d242db38c4e435a6597173dc3b082173 rAF driven WebGL submits excessive amount of GPU work... https://bugs.webkit.org/show_bug.cgi?id=227059 f38a92b3e7c17efda269caa7066e7ffe2f828e72 WebGL shader link error in iOS 15 beta: "Internal error..." https://bugs.webkit.org/show_bug.cgi?id=227723 98d48f011d561531470d97f26a022767b5452fb7 REGRESSION (r279466): [Big Sur] webgl/1.0.3/conformance &... https://bugs.webkit.org/show_bug.cgi?id=227596 Bug: angleproject:6471 Change-Id: I07166d0dc4b5c3579d98353485b3245b81c7b882 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3194322 Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Jonah Ryan-Davis <jonahr@google.com> Commit-Queue: Kyle Piddington <kpiddington@apple.com>
Kenneth Russell da3db87e 2021-07-06T14:00:58 Upstream latest changes to Metal backend from Apple to 7/1/2021 This CL merges in the ANGLE changes between these two WebKit commits: https://git.webkit.org/?p=WebKit.git;a=commit;h=8648b353ab1d7730438c2e08319e1a4d64982c31 https://git.webkit.org/?p=WebKit.git;a=commit;h=166e4924a52971d6a32ad48247a439b16c00e062 Include provoking vertex buffer out of bounds fix from https://bugs.webkit.org/show_bug.cgi?id=230107 Fix bad merge of resetting of dirty bits, breaking DepthStencilFormatsTest.DepthTextureRender test and perhaps others. Disable GL_APPLE_clip_distance when the direct-to-Metal compiler is active. It can not yet handle the gl_ClipDistance array. Disable use of rectangular textures for IOSurfaces. Metal can bind IOSurfaces to 2D textures, and this was passing all tests in the SPIR-V Metal backend. Introducing rectangular textures breaks the SPIR-V Metal backend, and the tests currently fail on the direct-to-Metal backend. Fix several bugs with ProvokingVertex, which was causing both the SpirV and Direct backends to incorrectly draw indices. (https://bugs.webkit.org/show_bug.cgi?id=230107) Skip the following tests on the Metal backend which is still failing RobustResourceInitTestES3.BlitDepthStencilAfterClearBuffer GLSLTest_ES3.GLVertexIDIntegerTextureDrawArrays/ES3_Metal With these changes, angle_end2end_tests again runs to completion. Bug: angleproject:6395 Change-Id: I3cc58f531426a95fc8f177a4ad87f56c1855a546 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3167010 Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Kyle Piddington <kpiddington@apple.com>
Kyle Piddington f6616c71 2021-09-14T17:42:22 Reimplement transform feedback on direct-to-Metal backend Connect the Transform Feedback code generation from Webkit ANGLE to the shader specialization code. Bug: angleproject:6393 Change-Id: I090c44c6ee97e8e0af8c38433bfb74c2080784f9 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3161455 Reviewed-by: Kenneth Russell <kbr@chromium.org> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Gregg Tavares <gman@chromium.org> Commit-Queue: Kenneth Russell <kbr@chromium.org>
Gregg Tavares 411137bf 2021-08-24T11:46:51 Emit INFINITY for infinite constants GLSL had `v = 1.0e40` which was output as `v = inff` in MSL. Changed to output `v = INFINITY`. Fixes Tests: GLSLTest_ES3.LiteralInfinityOutput/ES3_Metal GLSLTest_ES3.LiteralNegativeInfinityOutput/ES3_Metal Bug: angleproject:5505 Change-Id: Ib651583e608351784dcd49d602a23b5ecb8475cb Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3116548 Reviewed-by: Kenneth Russell <kbr@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org> Commit-Queue: Gregg Tavares <gman@chromium.org>
Gregg Tavares 5ca0953d 2021-08-18T13:22:22 Use the correct attribute locations in Metal Fixes these tests: BlendIntegerTest.MRTSigned/ES3_Metal BlendIntegerTest.MRTUnsigned/ES3_Metal DrawBuffersTest.Gaps/ES3_Metal DrawBuffersTest.BlendWithGaps/ES3_Metal DrawBuffersTest.FirstAndLast/ES3_Metal DrawBuffersTest.FirstHalfNULL/ES3_Metal DrawBuffersWebGL2Test.TwoProgramsWithDifferentOutputsAndClear/ES3_Metal WebGLCompatibilityTest.DrawBuffers/ES3_Metal Bug: angleproject:5505 Change-Id: I9ea82a8c7a0c5bbc78eb69eb92552909e3f437f3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3105439 Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Kenneth Russell <kbr@chromium.org>
Peter Kasting 5bda5f91 2021-07-26T20:37:52 Fix some instances of -Wunreachable-code-aggressive. Bug: chromium:1066980 Change-Id: I1e769b78c51d939067e8855beab32ec7c006c00e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3055794 Reviewed-by: Nico Weber <thakis@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Nico Weber <thakis@chromium.org>
Kenneth Russell b3cbfd55 2021-07-07T12:31:57 Fix multiple end2end crashes in direct-to-MSL compiler. This set of changes: - Adds a single place (CompilerMtl::useDirectToMSLCompiler) where the direct-to-MSL compiler can be enabled, still at compile time rather than run time. It is still disabled by default. - Initializes MTLWaitableCompileEventImpl::mShader, without which all shader compiles crash. - Fixes a mismatch of the ANGLERasterizerDisabled variable name in the generated MSL. - Removes the transform feedback bindings as an argument to the vertex shader's main0(). Transform feedback support needs to be reimplemented in this compiler backend. - Added an option to the DriverUniform class to emit as either an interface block or a struct. The direct-to-MSL backend assumes it is a struct. - Disable variable reference validation when referencing either sample mask or rasterizer discard functionality in the shader. - Disable struct usage validation when inserting references to ANGLE_TextureEnv. This occurs during pipeline rewriting and it's infeasible to disable it at that point, so disable it during pipeline rewriting - which means it's disabled for all shaders. - For angle_end2end_tests, disable the file API hooking which disables the Metal shader cache. This speeds up the tests significantly - by roughly a factor of 5. With these changes, several hundred angle_end2end_tests run without any assertion failures, though still with many test failures. The next crash is in: GLSLTest.NamelessScopedStructs/ES2_Metal and will likely require a larger bug fix, or more changes to be upstreamed from WebKit's repository. Bug: angleproject:5505 Change-Id: Ia1ea9a13867f00035d4aeccf907fd032255588e3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3010486 Commit-Queue: Kenneth Russell <kbr@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Kyle Piddington d33a2222 2021-04-26T16:56:15 Upstream Apple's direct-to-Metal backend: compile libANGLE. This change is meant to merge the metal backend changes from Apple's direct-to-Metal backend. Taken from Kyle Piddington's CL: https://chromium-review.googlesource.com/c/angle/angle/+/2857366/ The goal of this CL is to merge the metal backend code in a state that compiles, but not to switch the Metal backend over to using the direct-to-metal backend yet. Bug: angleproject:5505 Bug: angleproject:6127 Change-Id: If6783e06e0086b3a1dd25c6f53caca5cfc96cb86 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2950067 Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Jonah Ryan-Davis <jonahr@google.com>
Jamie Madill cb87d78c 2021-07-08T08:28:04 Enable -Wshadow with Clang. Also fixes a few instances of variable shadowing in the code. Bug: angleproject:6148 Change-Id: Ic51d722a3f953f246f51af6d74abb302f832cf44 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3014875 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi 8b869a95 2021-06-13T01:09:27 Translator: Generate Ops for all built-in functions EOpCallBuiltInFunction is removed in this change, as well as the "op": "auto" property in builtin_function_declarations.txt. Instead, gen_builtin_symbols.py automatically generates Ops for every built-in function and generates the TOperator enum accordingly. This simplifies SPIR-V code generation by allowing switches to be used on operators instead of string comparisons. Bug: angleproject:4589 Bug: angleproject:4889 Change-Id: Ia351524400b0e12a10a5572e27e9b88c6ec2e61c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2958869 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Tim Van Patten <timvp@google.com>
Kyle Piddington d7aa0130 2021-04-26T16:56:15 Upstream Apple's direct-to-Metal backend: compile translator. This change is meant to merge the translator changes from Apple's direct-to-Metal backend. Taken from Kyle Piddington's CL: https://chromium-review.googlesource.com/c/angle/angle/+/2857366/ The goal of this CL is to merge the translator code in a state that compiles, but not to switch the Metal backend over to use this translator backend yet. Bug: angleproject:5505 Change-Id: I68a6354604498cd5fd1eb96c13fc56f3b38f2bd0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2897536 Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Commit-Queue: Jonah Ryan-Davis <jonahr@google.com>