Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Conversation

@jonahwilliams
Copy link
Contributor

Placing the vertex buffer on the binding object meant that we were actually paying 2x the size cost for it (one for vertex bindings, one for fragment bindings). By moving this object onto command itself, we reduce the size and avoid spliting up the command state in a weird way.

Also updates most of the contents to prefer moving the VertexBuffer.

Comment on lines -437 to -441
if (command.vertex_count == 0u) {
continue;
}
if (command.instance_count == 0u) {
continue;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is already checked in render_pass.cc

PassBindingsCache& command_buffer_cache,
const ISize& target_size,
const vk::DescriptorSet vk_desc_set) {
if (command.vertex_count == 0u || command.instance_count == 0u) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is already checked in render_pass.cc

SampledImageSlot slot;
TextureResource texture;
SamplerResource sampler;
std::shared_ptr<const Sampler> sampler;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need a Resource wrapper for the sampler since we only support combined image+sampler.

@chinmaygarde chinmaygarde changed the title [Impeller] prefer moving vertex buffer, place on command instead of binding object. [Impeller] Prefer moving vertex buffer, place on command instead of binding object. Dec 4, 2023
@jonahwilliams jonahwilliams requested a review from dnfield December 5, 2023 00:04
std::shared_ptr<const Texture> texture,
std::shared_ptr<const Sampler> sampler) override;

BufferView GetVertexBuffer() const;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't really that useful so I removed it.

@jonahwilliams
Copy link
Contributor Author

FYI. I've been trying to make more types move only. What I've found is that if we have any user defined constructors then we can't use the aggregate initialization syntax, so no VertexBuffer{....} which I actually quite like.

I'd be tempted to go back and make Command move only, but BufferView and VertexBuffer feels bad man.

Copy link
Contributor

@matanlurey matanlurey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM as mostly trivial

@jonahwilliams jonahwilliams added the autosubmit Merge PR when tree becomes green via auto submit App label Dec 5, 2023
@auto-submit auto-submit bot merged commit 7261ed4 into flutter:main Dec 5, 2023
@jonahwilliams jonahwilliams deleted the change_vertex_binding branch December 5, 2023 21:03
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 5, 2023
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Dec 5, 2023
…139595)

flutter/engine@9660439...c49b861

2023-12-05 [email protected] Avoid non-const sizes in VLAs. (flutter/engine#48693)
2023-12-05 [email protected] [Impeller] Prefer moving vertex buffer, place on command instead of binding object. (flutter/engine#48630)
2023-12-05 [email protected] Roll Skia from c759bbf16310 to 5f54e9f84cff (3 revisions) (flutter/engine#48692)

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
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

autosubmit Merge PR when tree becomes green via auto submit App e: impeller

Projects

No open projects
Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants