Skip to content
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

Dynamic buffers #2111

Merged
merged 4 commits into from
Jun 5, 2018
Merged

Dynamic buffers #2111

merged 4 commits into from
Jun 5, 2018

Conversation

msiglreith
Copy link
Contributor

@msiglreith msiglreith commented Jun 5, 2018

Start defining the basic API for dynamic buffer descriptors. Atm based upon vulkan, not optimal but provides the best performance. Other possbiel API design could use (set, Option<Offset>) for descriptor set binding, but involves more work on the portability layer and might be more typing for users.

Feedback appreciated.
More backends to follow ..

Addresses #1949
PR checklist:

  • make succeeds (on *nix)
  • make reftests succeeds
  • tested examples with the following backends:

Copy link
Member

@kvark kvark left a comment

Choose a reason for hiding this comment

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

So, to clarify: the length of this extra iterator should be equal to the number of dynamic buffers in the given descriptor sets, right?
In this case, I think the approach makes sense, it's roughly similar to the way we provide clear values and immutable samplers, so it's consistent.

@@ -4,6 +4,7 @@ use std::borrow::Borrow;

use {Backend, WorkGroupCount};
use buffer::Offset;
use command::raw::DescriptorSetOffset;
use queue::capability::{Compute, Supports};
use super::{CommandBuffer, RawCommandBuffer, Shot, Level};
Copy link
Member

Choose a reason for hiding this comment

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

should probably include the DescriptorSetOffset here

@@ -5,6 +5,7 @@ use std::ops::Range;
use Backend;
use {image, pso};
use buffer::IndexBufferView;
use command::raw::DescriptorSetOffset;
Copy link
Member

Choose a reason for hiding this comment

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

similarly, let's move that down into use super::{...}

@msiglreith
Copy link
Contributor Author

So, to clarify: the length of this extra iterator should be equal to the number of dynamic buffers in the given descriptor sets, right?

y, that's correct.

I: IntoIterator,
I::Item: Borrow<n::DescriptorSet>,
J: IntoIterator,
J::Item: Borrow<com::DescriptorSetOffset>,
Copy link
Member

Choose a reason for hiding this comment

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

Actually, I don't think there is much value in going with Borrow<> here, since the offsets are easily copyable. Mind changing it to just IntoIterator<Item = com::DescriptorSetOffset>?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure, beside that I'm done with the PR from my side as far as I can see.

Copy link
Member

Choose a reason for hiding this comment

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

great! i'm also ready with Metal side, just blocked on that IntoIterator change

Copy link
Contributor Author

Choose a reason for hiding this comment

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

hold up, actually not that much a fan of the intoIterator change, makes using slices difficult/impossible as far as I can see.

Copy link
Member

Choose a reason for hiding this comment

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

aha, good point

@kvark kvark changed the title [WIP] Dynamic buffers Dynamic buffers Jun 5, 2018
&mut self,
layout: &n::PipelineLayout,
first_set: usize,
sets: T,
sets: I,
offsets: J,
Copy link
Contributor

Choose a reason for hiding this comment

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

Where is offsets used? Or should it be _offsets?

@kvark
Copy link
Member

kvark commented Jun 5, 2018 via email

bors bot added a commit that referenced this pull request Jun 5, 2018
2111: Dynamic buffers r=kvark a=msiglreith

Start defining the basic API for dynamic buffer descriptors. Atm based upon vulkan, not optimal but provides the best performance. Other possbiel API design could use `(set, Option<Offset>)` for descriptor set binding, but involves more work on the portability layer and might be more typing for users.

Feedback appreciated.
More backends to follow ..

Addresses #1949
PR checklist:
- [x] `make` succeeds (on *nix)
- [x] `make reftests` succeeds
- [ ] tested examples with the following backends:


Co-authored-by: msiglreith <[email protected]>
Co-authored-by: Dzmitry Malyshau <[email protected]>
@bors
Copy link
Contributor

bors bot commented Jun 5, 2018

@bors bors bot merged commit b61f215 into gfx-rs:master Jun 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants