-
Notifications
You must be signed in to change notification settings - Fork 6k
[Impeller] Support binding multiple vertex buffer views. #49670
Conversation
79a8a26
to
7fd8dca
Compare
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.
Concern with this is that now we're on a path to do another heap allocation per command, despite most commands not needing it. Its possible I could also fix this in #49480 but I would prefer if this API starts out such that commands that only bind a single vertex buffer don't use any head allocated storage.
So you could have something like:
VertexBuffer {
BufferView single_vertex_buffer
std::vector additional_vectors
..
}
Maybe?
I'm strongly considering I know it seems cringe on the surface, but hear me out:
|
that seems reasonable to me, am I crazy 🤔 |
65d3846
to
f9282f9
Compare
ae0a146
to
d274e7d
Compare
std::vector<vk::Buffer> vertex_buffers; | ||
std::vector<vk::DeviceSize> vertex_buffer_offsets; |
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.
Move these under the else if clause so we don't have per-command heap allocation.
Need to rewrite this for the new command encoding interface, keeping it in draft for a while longer until I have time to iterate. |
This patch is still on my radar, will rewrite this against the updated HAL API when I find some time. |
Still on my radar |
Still on my radar, but closing to stop it from continuing to come up in the stale PR triage. |
Resolves flutter/flutter#116168. (Continuation of #49670) Makes it possible for us to use arbitrary vertex layouts, including SoA layouts with attributes stored in different DeviceBuffers. CanRenderPerspectiveCube was converted to an SoA attribute layout with two separate buffers as an example. Works on all the backends! OpenGLES: <img width="1136" alt="image" src="https://github.com/user-attachments/assets/e2398fde-532f-402d-899a-39aaa556f24f"> Vulkan: <img width="1136" alt="image" src="https://github.com/user-attachments/assets/1c1bf664-bec1-43cb-ab2e-eb2a74718bfd"> Metal: <img width="1136" alt="image" src="https://github.com/user-attachments/assets/bf59da17-cf52-4913-88e4-ab6f0bd6fc96">
…e#55856) Resolves flutter#116168. (Continuation of flutter/engine#49670) Makes it possible for us to use arbitrary vertex layouts, including SoA layouts with attributes stored in different DeviceBuffers. CanRenderPerspectiveCube was converted to an SoA attribute layout with two separate buffers as an example. Works on all the backends! OpenGLES: <img width="1136" alt="image" src="https://github.com/user-attachments/assets/e2398fde-532f-402d-899a-39aaa556f24f"> Vulkan: <img width="1136" alt="image" src="https://github.com/user-attachments/assets/1c1bf664-bec1-43cb-ab2e-eb2a74718bfd"> Metal: <img width="1136" alt="image" src="https://github.com/user-attachments/assets/bf59da17-cf52-4913-88e4-ab6f0bd6fc96">
Resolves flutter/flutter#116168.
Makes it possible for us to use arbitrary vertex layouts, including SoA layouts with attributes stored in different DeviceBuffers.