From d6037c9be2f4c6cddc286c252abf633d2be78cc9 Mon Sep 17 00:00:00 2001 From: Ben Brown Date: Tue, 6 Nov 2018 18:42:43 -0600 Subject: [PATCH] Added supports_transfer function. Adding supports_transfer function. --- src/hal/src/queue/capability.rs | 6 +++++- src/hal/src/queue/family.rs | 8 ++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/hal/src/queue/capability.rs b/src/hal/src/queue/capability.rs index ac5ba9dd730..0f3151c59ab 100644 --- a/src/hal/src/queue/capability.rs +++ b/src/hal/src/queue/capability.rs @@ -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, } } } diff --git a/src/hal/src/queue/family.rs b/src/hal/src/queue/family.rs index 5a96e313523..8a792ffd82d 100644 --- a/src/hal/src/queue/family.rs +++ b/src/hal/src/queue/family.rs @@ -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; @@ -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; }