Skip to content

Commit

Permalink
Merge #2461
Browse files Browse the repository at this point in the history
2461: Added supports_transfer function. r=kvark a=bbrown683

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

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/gfx-rs/gfx/2461)
<!-- Reviewable:end -->


Co-authored-by: Ben Brown <[email protected]>
  • Loading branch information
bors[bot] and bbrown683 committed Nov 12, 2018
2 parents 440e3d2 + d6037c9 commit 11c4f74
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
6 changes: 5 additions & 1 deletion src/hal/src/queue/capability.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,11 @@ impl Capability for Compute {
impl Capability for Transfer {
fn supported_by(qt: QueueType) -> bool {
match qt {
_ => true
QueueType::General |
QueueType::Compute |
QueueType::Graphics |
QueueType::Transfer => true,
_ => false,
}
}
}
Expand Down
8 changes: 6 additions & 2 deletions src/hal/src/queue/family.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
use Backend;
use backend::RawQueueGroup;
use queue::{CommandQueue, QueueType};
use queue::capability::{Capability, Graphics, Compute};
use queue::capability::{Capability, Graphics, Compute, Transfer};

use std::any::Any;
use std::fmt::Debug;
Expand All @@ -20,10 +20,14 @@ pub trait QueueFamily: Debug + Any + Send + Sync {
fn supports_graphics(&self) -> bool {
Graphics::supported_by(self.queue_type())
}
/// Returns true if the queue supports graphics operations.
/// Returns true if the queue supports compute operations.
fn supports_compute(&self) -> bool {
Compute::supported_by(self.queue_type())
}
/// Returns true if the queue supports transfer operations.
fn supports_transfer(&self) -> bool {
Transfer::supported_by(self.queue_type())
}
/// Returns the queue family ID.
fn id(&self) -> QueueFamilyId;
}
Expand Down

0 comments on commit 11c4f74

Please sign in to comment.