-
Notifications
You must be signed in to change notification settings - Fork 6k
[Impeller] Prefer moving vertex buffer, place on command instead of binding object. #48630
Conversation
| if (command.vertex_count == 0u) { | ||
| continue; | ||
| } | ||
| if (command.instance_count == 0u) { | ||
| continue; |
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 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) { |
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 already checked in render_pass.cc
| SampledImageSlot slot; | ||
| TextureResource texture; | ||
| SamplerResource sampler; | ||
| std::shared_ptr<const Sampler> sampler; |
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.
We don't need a Resource wrapper for the sampler since we only support combined image+sampler.
| std::shared_ptr<const Texture> texture, | ||
| std::shared_ptr<const Sampler> sampler) override; | ||
|
|
||
| BufferView GetVertexBuffer() const; |
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 isn't really that useful so I removed it.
|
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 I'd be tempted to go back and make Command move only, but BufferView and VertexBuffer feels bad man. |
matanlurey
left a comment
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 as mostly trivial
…ead of binding object. (flutter/engine#48630)
…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
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.