-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Impeller] Add support for specialization constants redux. #47678
[Impeller] Add support for specialization constants redux. #47678
Conversation
…/engine into add_specialization_support
@@ -59,7 +52,31 @@ | |||
descriptor.stencilAttachmentPixelFormat = | |||
ToMTLPixelFormat(desc.GetStencilPixelFormat()); | |||
|
|||
return descriptor; | |||
const auto& constants = desc.GetSpecializationConstants(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is still a bit iffy, but we improve performance by not blocking on the specialization, it all goes into the same pipeline future which is only blocking once we actually trry to use it.
Since the compilation is out of process anyway, blocking on it is pointless and only serves to park the thread.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feels like we're writing javascript here with this chain of nested completion callbacks. ;) Looks safe to me, though.
@@ -133,19 +150,12 @@ | |||
)); | |||
promise->set_value(new_pipeline); | |||
}; | |||
auto mtl_descriptor = GetMTLRenderPipelineDescriptor(descriptor); | |||
#if FML_OS_IOS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Todo: add back
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, i see this issue is closed. Is this intended to be removed now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM modulo latch question. Crasher fix & new changes make sense.
@@ -59,7 +52,31 @@ | |||
descriptor.stencilAttachmentPixelFormat = | |||
ToMTLPixelFormat(desc.GetStencilPixelFormat()); | |||
|
|||
return descriptor; | |||
const auto& constants = desc.GetSpecializationConstants(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feels like we're writing javascript here with this chain of nested completion callbacks. ;) Looks safe to me, though.
return descriptor; | ||
// This latch is used to ensure that GetMTLFunctionSpecialized does not finish | ||
// before the descriptor is completely set up. | ||
auto latch = std::make_shared<fml::CountDownLatch>(1u); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nothing appears to be waiting on this latch, and I'm not sure why we'd need one. It looks like the descriptor is already done being set up by the time we call GetMTLFunctionSpecialized
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed. This was left over from an earlier iteration.
…47762) Reverts #47678 Initiated by: jonahwilliams This change reverts the following previous change: Original Description: Reland of #47432 Also includes: * #47617 * #47637 Fixes the performance on iOS by removing blocking on compilation of shaders. From local testing this has identical before/after numbers. Additional, ensures that we don't unecessarily specialize vertex shaders and notes this restriction in the documentation. ---- Adds support for Specialization constants to Impeller for our usage in the engine. A motivating example has been added in the impeller markdown docs. Fixes flutter/flutter#136210 Fixes flutter/flutter#119357
…138034) flutter/engine@1b20752...f8961d2 2023-11-07 98614782+auto-submit[bot]@users.noreply.github.com Reverts "[Impeller] Add support for specialization constants redux." (flutter/engine#47762) 2023-11-07 [email protected] [Impeller] added tests for matrices (flutter/engine#47754) 2023-11-07 [email protected] Roll Skia from 62fc1374cc5d to 030e21befbc9 (2 revisions) (flutter/engine#47756) 2023-11-07 [email protected] [ios] making objective-C smart pointers support ARC (flutter/engine#47612) 2023-11-07 [email protected] Don't use Skia BUILD.gn files (flutter/engine#47677) 2023-11-07 [email protected] [Impeller] Add support for specialization constants redux. (flutter/engine#47678) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Reland of #47432
Also includes:
Fixes the performance on iOS by removing blocking on compilation of shaders. From local testing this has identical before/after numbers. Additional, ensures that we don't unecessarily specialize vertex shaders and notes this restriction in the documentation.
Adds support for Specialization constants to Impeller for our usage in the engine. A motivating example has been added in the impeller markdown docs.
Fixes flutter/flutter#136210
Fixes flutter/flutter#119357