-
Notifications
You must be signed in to change notification settings - Fork 6k
[Impeller] dont use half precision constants / Fixes for SPIRV tools roll #52213
Conversation
It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact "@test-exemption-reviewer" in the #hackers channel in Chat (don't just cc them here, they won't see it! Use Discord!). If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix? Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
@@ -12,15 +12,15 @@ layout(constant_id = 0) const float supports_decal = 1.0; | |||
|
|||
// These values must correspond to the order of the items in the | |||
// 'FilterContents::MorphType' enum class. | |||
const float16_t kMorphTypeDilate = 0.0hf; | |||
const float16_t kMorphTypeErode = 1.0hf; | |||
const float kMorphTypeDilate = 0.0; |
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.
Even with these changes, the duplicate constant error is still showing up:
shaderc: internal error: compilation succeeded but failed to optimize: ID '27' decorated with RelaxedPrecision multiple times is not allowed.
%float_0 = OpConstant %float 0
Also, similar changes are needed to:
engine/impeller/entity/shaders/filters/yuv_to_rgb_filter.frag
Lines 16 to 17 in 132d364
const float16_t kBT601LimitedRange = 0.0hf; | |
const float16_t kBT601FullRange = 1.0hf; |
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.
Updated. Sorry, do you mean that even with this change there are still compilation errors?
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.
Yeah that's what I meant. The compiler doesn't like 0 and 1 as constants for this file and yuv_to_rgb_filter.frag
.
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.
The latest commit 80579dd fixes the issue 🙂
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.
woot, thanks for helping with this @jiahaog
…147023) flutter/engine@6e4a15d...442d14a 2024-04-18 [email protected] [Impeller] dont use half precision constants / Fixes for SPIRV tools roll (flutter/engine#52213) 2024-04-18 [email protected] Roll Skia from edece87ce734 to 8fd4d8eaadc2 (1 revision) (flutter/engine#52238) 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
…lutter#147023) flutter/engine@6e4a15d...442d14a 2024-04-18 [email protected] [Impeller] dont use half precision constants / Fixes for SPIRV tools roll (flutter/engine#52213) 2024-04-18 [email protected] Roll Skia from edece87ce734 to 8fd4d8eaadc2 (1 revision) (flutter/engine#52238) 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
See b/335381180
In an upcoming version of SPIRV tools, these constants are being flagged as invalid. Due to some combination of the macros + inlining we're ending up with multiple precision modifiers on the constants:
We don't really benefit from half precision on these, since we're either using them for equality or can cheaply convert to half precision anyway.