Skip to content

Commit 1881800

Browse files
[CP-beta][Impeller] separate immutable sampler descriptors. (flutter#169074)
This pull request is created by [automatic cherry pick workflow](https://github.com/flutter/flutter/blob/main/docs/releases/Flutter-Cherrypick-Process.md#automatically-creates-a-cherry-pick-request) Please fill in the form below, and a flutter domain expert will evaluate this cherry pick request. ### Issue Link: What is the link to the issue this cherry-pick is addressing? flutter#168114 ### Changelog Description: Explain this cherry pick in one line that is accessible to most Flutter developers. See [best practices](https://github.com/flutter/flutter/blob/main/docs/releases/Hotfix-Documentation-Best-Practices.md) for examples This cherry pick fixes an issue with video flickering after a user scroll event in the package video_player on devices using Vulkan for rendering. ### Impact Description: What is the impact (ex. visual jank on Samsung phones, app crash, cannot ship an iOS app)? Does it impact development (ex. flutter doctor crashes when Android Studio is installed), or the shipping production app (the app crashes on launch) Visual jank on devices using Vulkan rendering and the video_player package. ### Workaround: Is there a workaround for this issue? No. ### Risk: What is the risk level of this cherry-pick? ### Test Coverage: Are you confident that your fix is well-tested by automated tests? pixel diffing is difficult to do without being flakey, video rendering pixel diffing is even harder. Was tested manually in the initial pr. ### Validation Steps: What are the steps to validate that this fix works? Using a device that utilizes Vulkan rendering, start the video_player example app, press play on the video, then scroll up or down - the visual flickering should be evident.
1 parent 2e6bde0 commit 1881800

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

engine/src/flutter/impeller/renderer/backend/vulkan/pipeline_vk.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -582,8 +582,10 @@ std::shared_ptr<PipelineVK> PipelineVK::CreateVariantForImmutableSamplers(
582582
if (!device_holder) {
583583
return nullptr;
584584
}
585+
// Note: immutable sampler variant of a pipeline is the negation of the
586+
// existing pipeline key. This keeps the descriptors separate.
585587
return (immutable_sampler_variants_[cache_key] =
586-
Create(desc_, device_holder, library_, pipeline_key_,
588+
Create(desc_, device_holder, library_, -1 * pipeline_key_,
587589
immutable_sampler));
588590
}
589591

engine/src/flutter/impeller/renderer/pipeline.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
namespace impeller {
2020

21-
using PipelineKey = uint64_t;
21+
using PipelineKey = int64_t;
2222

2323
class PipelineLibrary;
2424
template <typename PipelineDescriptor_>

0 commit comments

Comments
 (0)