From 51cc13a0f46d517dc363dfb0d032f4d543887c22 Mon Sep 17 00:00:00 2001 From: mitchmindtree Date: Fri, 30 Nov 2018 10:14:43 +0700 Subject: [PATCH] Add a `union` method to the extensions types. (#1125) Add a `union` method to the extensions types. --- CHANGELOG_VULKANO.md | 1 + vulkano/src/extensions.rs | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/CHANGELOG_VULKANO.md b/CHANGELOG_VULKANO.md index 67abf86c..635dbae9 100644 --- a/CHANGELOG_VULKANO.md +++ b/CHANGELOG_VULKANO.md @@ -2,6 +2,7 @@ - Add support for `#include "..."` and `#include <...>` directives within source files. +- Add a `union` method for the extensions types. # Version 0.11.1 (2018-11-16) diff --git a/vulkano/src/extensions.rs b/vulkano/src/extensions.rs index 5b40e15c..302fc198 100644 --- a/vulkano/src/extensions.rs +++ b/vulkano/src/extensions.rs @@ -42,6 +42,17 @@ macro_rules! extensions { } } + /// Returns the union of this list and another list. + #[inline] + pub fn union(&self, other: &$sname) -> $sname { + $sname { + $( + $ext: self.$ext || other.$ext, + )* + _unbuildable: Unbuildable(()) + } + } + /// Returns the intersection of this list and another list. #[inline] pub fn intersection(&self, other: &$sname) -> $sname {