-
Notifications
You must be signed in to change notification settings - Fork 543
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proposal: Remove Slice #1392
Comments
I'm in favor of removing fn draw<D: PipelineData<R>>(
&mut self,
vertex_range: VertexRange,
base_vertex: VertexCount,
instances: Option<InstanceParams>,
index_buffer: Option<IndexBuffer<R>>,
pipeline: &PipelineState<R, D::Meta>,
user_data: &D
) |
Actually, do you mean that the parameter |
Yes there might be confusion between the vertices of the vertex buffer and the virtual vertices resulting of indexing, |
We could also just split drawing with and without an index buffer into two methods ( |
FWIW, my personal preference is to clearly separate indexed from non-indexed draw calls, either using an enum as parameter or using separate methods in the encoder. |
@nical thanks for filing this very detailed RFC! It's a pleasure to read :) I agree that separating vertex range from index range makes it cleaner, and I'd love to see us using built-in ranges ( pub enum VertexRange<R> {
Straight { range: Range<VertexCount> },
Indexed { ibo: IndexBuffer<R>, range: Range<IndexCount>, base_vertex: VertexCount },
} |
Hey OP, just wondering if you've had any time to work on this. I'm pretty interested in removing slice as well, and as seeing my other pull-request is wrapping up I'm looking for more things to do.. and slice is super confusing |
pinging @nical |
@bjadamson I started toying with this a bit but I am far from getting it building (Slice is all over the place) and more importantly I haven't had a lot of time to spend on it lately. Don't hesitate to take this. I'll put what I have done in a branch somewhere for you to see in case it helps. |
Siiick thanks! No promises about doing this, but I'll definitely look through your work once you post it :) |
I started to dig through this, some notes for myself. It seems more practical to wait until the LL branch gets merged into master before working on this, or work on doing this work ontop of the LL branch. The LL branch seems to contain fixes/simplifications that I'd be duplicating if working from the master branch. |
While we agree that |
Slice is my least favorite thing in gfx's API:
IndexBuffer::Auto
variant). This is inconsistent and confusing. Every other resource is cannot be "null", which encourages you to assume the same for IndexBuffer. I am mentioning my gripe against IndexBuffer being different because it looks like this comes from how it is stored in Slice, so I blame Slice. I think that it is ok for IndexBuffer to be an enum with variant for u16 and u32 indices, (because people can use the API to its full extent without knowing that), but it is not ok to have this Auto variant (a None variant would be bad, Auto is actually even more magical in a bad way). It may look like I am getting too excited about little things, but consistent APIs are a lot easier to learnSo, What I propose is to remove Slice, and add:
Additionally, remove
Factory::create_vertex_buffer_with_slice
and let people useFactory::create_vertex_buffer
andFactory::create_index_buffer
separately. And also remove theIndexBuffer::Auto
variant.Replace DrawType with some other name that you like, as long as it reflects that it is something used when submitting draw calls, or split
Encoder::draw
intoEncoder::draw
andEncoder::draw_indexed
.If there is no outstanding objection, I'll put up a PR to experiment with this when I have some time to spare (maybe after finishing the current doc PR).
The text was updated successfully, but these errors were encountered: