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

Query API and basic support on Metal #2334

Merged
merged 6 commits into from
Aug 23, 2018
Merged

Query API and basic support on Metal #2334

merged 6 commits into from
Aug 23, 2018

Conversation

kvark
Copy link
Member

@kvark kvark commented Aug 20, 2018

Fixes #1638 (for the most part)
PR checklist:

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

@kvark
Copy link
Member Author

kvark commented Aug 20, 2018

Looks like we are blocked on ash-rs/ash#100 for Vulkan :(
cc @MaikKlein

@kvark
Copy link
Member Author

kvark commented Aug 21, 2018

Current status: 136 / 150 occlusion tests passing
Known 2 issues:

  1. sometimes getting the query results synchronously gets stuck
  2. in some cases copying results with availability doesn't produce correct results

@kvark kvark changed the title [WIP] Query API and basic support on Metal Query API and basic support on Metal Aug 21, 2018
@kvark
Copy link
Member Author

kvark commented Aug 21, 2018

Vulkan is blocked on ash-rs/ash#105 now

@kvark
Copy link
Member Author

kvark commented Aug 22, 2018

Update on Metal: all the known issues are resolved. We pass 150/150 tests without failures or hangs 🎉
The PR is blocked on reviews and getting Vulkan backend to compile. In the worst case we'll comment out the Vulkan parts that are blocking.

Copy link
Contributor

@msiglreith msiglreith left a comment

Choose a reason for hiding this comment

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

HAL changes LGTM


/// Destroy a query pool object
fn destroy_query_pool(&self, pool: B::QueryPool);

/// Get query pool results into the specified CPU memory.
/// Returns `Ok(false)` if the resutls are not ready yet and neither of `WAIT` or `PARTIAL` flags are set.
Copy link
Contributor

Choose a reason for hiding this comment

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

resutls -> results

) {
let mut flags = vk::QueryControlFlags::empty();
if control.contains(query::QueryControl::PRECISE) {
if control.contains(query::ControlFlags::PRECISE) {
Copy link
Contributor

Choose a reason for hiding this comment

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

map_query_control_flags instead?

let is_ready = if flags.contains(query::ResultFlags::WAIT) {
let mut guard = visibility.allocator.lock();
while !visibility.are_available(pool_range.start, &queries) {
println!("query: not available"); //TEMP
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this left here intentionally?

let queries = self.active_visibility_queries
.drain(..)
.collect::<SmallVec<[_; BLOCK_BUCKET]>>();
Some((Arc::clone(&self.shared), queries))
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need to cloneself.shared?

Copy link
Member Author

Choose a reason for hiding this comment

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

we clone the Arc, so that we can use the visibility shared structures in the callback

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh, I didn't notice the callback block. Sounds good

size: size_meta,
},
};
// An extra paddig is requred if the client expects 64bits availability without a wait
Copy link
Contributor

Choose a reason for hiding this comment

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

paddig -> padding

@kvark
Copy link
Member Author

kvark commented Aug 22, 2018

Thanks @grovesNL ! comments are addressed


let (com_avail, com_pad) = if flags.contains(query::ResultFlags::WITH_AVAILABILITY | query::ResultFlags::WAIT) {
// Technically waiting is a no-op on a single queue. However,
// the client expects the avaiability to be set regardless.
Copy link
Contributor

Choose a reason for hiding this comment

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

avaiability -> availability

@kvark
Copy link
Member Author

kvark commented Aug 23, 2018

Landing, as per approval on gitter.
bors r=grovesNL

bors bot added a commit that referenced this pull request Aug 23, 2018
2334: Query API and basic support on Metal r=grovesNL a=kvark

Fixes #1638 (for the most part)
PR checklist:
- [x] `make` succeeds (on *nix)
- [x] `make reftests` succeeds
- [ ] tested examples with the following backends:
- [ ] `rustfmt` run on changed code


Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
@bors
Copy link
Contributor

bors bot commented Aug 23, 2018

Build failed

@kvark
Copy link
Member Author

kvark commented Aug 23, 2018 via email

bors bot added a commit that referenced this pull request Aug 23, 2018
2334: Query API and basic support on Metal r=grovesNL a=kvark

Fixes #1638 (for the most part)
PR checklist:
- [x] `make` succeeds (on *nix)
- [x] `make reftests` succeeds
- [ ] tested examples with the following backends:
- [ ] `rustfmt` run on changed code


Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
@bors
Copy link
Contributor

bors bot commented Aug 23, 2018

Build failed

@kvark
Copy link
Member Author

kvark commented Aug 23, 2018 via email

@kvark
Copy link
Member Author

kvark commented Aug 23, 2018 via email

@bors
Copy link
Contributor

bors bot commented Aug 23, 2018

Not awaiting review

bors bot added a commit that referenced this pull request Aug 23, 2018
2334: Query API and basic support on Metal r=grovesNL a=kvark

Fixes #1638 (for the most part)
PR checklist:
- [x] `make` succeeds (on *nix)
- [x] `make reftests` succeeds
- [ ] tested examples with the following backends:
- [ ] `rustfmt` run on changed code


Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
@kvark
Copy link
Member Author

kvark commented Aug 23, 2018 via email

@bors
Copy link
Contributor

bors bot commented Aug 23, 2018

@bors bors bot merged commit 255959b into gfx-rs:master Aug 23, 2018
@kvark kvark deleted the query branch August 23, 2018 14:06
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